Explorar o código

Fix processor mistake

David Catuhe %!s(int64=6) %!d(string=hai) anos
pai
achega
0faf79131f
Modificáronse 2 ficheiros con 23 adicións e 4 borrados
  1. 22 3
      src/Engines/Processors/shaderCodeCursor.ts
  2. 1 1
      src/Engines/constants.ts

+ 22 - 3
src/Engines/Processors/shaderCodeCursor.ts

@@ -1,13 +1,32 @@
 /** @hidden */
 export class ShaderCodeCursor {
-    lines: string[];
+    private _lines: string[];
     lineIndex: number;
 
     get currentLine(): string {
-        return this.lines[this.lineIndex].trim();
+        return this._lines[this.lineIndex];
     }
 
     get canRead(): boolean {
-        return this.lineIndex < this.lines.length - 1;
+        return this.lineIndex < this._lines.length - 1;
+    }
+
+    set lines(value: string[]) {
+        this._lines = [];
+
+        for (var line of value) {
+            const split = line.split(";");
+
+            for (var index = 0; index < split.length; index++) {
+                let subLine = split[index];
+                subLine = subLine.trim();
+
+                if (!subLine) {
+                    continue;
+                }
+
+                this._lines.push(subLine + (index !== split.length - 1 ? ";" : ""));
+            }
+        }
     }
 }

+ 1 - 1
src/Engines/constants.ts

@@ -375,7 +375,7 @@ export class Constants {
     /**
      * Gets or sets base Assets URL
      */
-    public static readonly PARTICLES_BaseAssetsUrl = "https://assets.babylonjs.com/particles";
+    public static PARTICLES_BaseAssetsUrl = "https://assets.babylonjs.com/particles";
 
     /** Default culling strategy : this is an exclusion test and it's the more accurate.
      *  Test order :