|
@@ -328,7 +328,9 @@ export class Effect implements IDisposable {
|
|
var vertexSource: any;
|
|
var vertexSource: any;
|
|
var fragmentSource: any;
|
|
var fragmentSource: any;
|
|
|
|
|
|
- if (baseName.vertexElement) {
|
|
|
|
|
|
+ if (baseName.vertexSource) {
|
|
|
|
+ vertexSource = "source:" + baseName.vertexSource;
|
|
|
|
+ } else if (baseName.vertexElement) {
|
|
vertexSource = document.getElementById(baseName.vertexElement);
|
|
vertexSource = document.getElementById(baseName.vertexElement);
|
|
|
|
|
|
if (!vertexSource) {
|
|
if (!vertexSource) {
|
|
@@ -338,7 +340,9 @@ export class Effect implements IDisposable {
|
|
vertexSource = baseName.vertex || baseName;
|
|
vertexSource = baseName.vertex || baseName;
|
|
}
|
|
}
|
|
|
|
|
|
- if (baseName.fragmentElement) {
|
|
|
|
|
|
+ if (baseName.fragmentSource) {
|
|
|
|
+ fragmentSource = "source:" + baseName.fragmentSource;
|
|
|
|
+ } else if (baseName.fragmentElement) {
|
|
fragmentSource = document.getElementById(baseName.fragmentElement);
|
|
fragmentSource = document.getElementById(baseName.fragmentElement);
|
|
|
|
|
|
if (!fragmentSource) {
|
|
if (!fragmentSource) {
|
|
@@ -534,6 +538,12 @@ export class Effect implements IDisposable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Direct source ?
|
|
|
|
+ if (vertex.substr(0, 7) === "source:") {
|
|
|
|
+ callback(vertex.substr(7));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
// Base64 encoded ?
|
|
// Base64 encoded ?
|
|
if (vertex.substr(0, 7) === "base64:") {
|
|
if (vertex.substr(0, 7) === "base64:") {
|
|
var vertexBinary = window.atob(vertex.substr(7));
|
|
var vertexBinary = window.atob(vertex.substr(7));
|
|
@@ -570,6 +580,12 @@ export class Effect implements IDisposable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Direct source ?
|
|
|
|
+ if (fragment.substr(0, 7) === "source:") {
|
|
|
|
+ callback(fragment.substr(7));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
// Base64 encoded ?
|
|
// Base64 encoded ?
|
|
if (fragment.substr(0, 7) === "base64:") {
|
|
if (fragment.substr(0, 7) === "base64:") {
|
|
var fragmentBinary = window.atob(fragment.substr(7));
|
|
var fragmentBinary = window.atob(fragment.substr(7));
|