Procházet zdrojové kódy

fix with !allowSave

Nicolas Cannasse před 6 roky
rodič
revize
7dae079324
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      hxsl/CacheFile.hx

+ 3 - 3
hxsl/CacheFile.hx

@@ -36,7 +36,7 @@ class CacheFile extends Cache {
 	// sources
 	var compiledSources : Map<String,{ vertex : String, fragment : String }> = new Map();
 	var allSources : Map<String,String> = new Map();
-	
+
 	public var allowSave = #if usesys false #else true #end;
 
 	public function new( allowCompile, recompileRT = false ) {
@@ -412,7 +412,7 @@ class CacheFile extends Cache {
 
 	function save() {
 		if( !allowSave ) return;
-		
+
 		var out = new haxe.io.BytesOutput();
 		out.writeInt32(1); // version
 
@@ -706,7 +706,7 @@ class CacheFile extends Cache {
 	function addNewShader( s : RuntimeShader ) {
 		if( runtimeShaders.indexOf(s) < 0 )
 			runtimeShaders.push(s);
-		addSource(s);
+		if( allowSave ) addSource(s);
 		for( i in s.spec.instances ) {
 			var inst = shaders.get(i.shader.data.name);
 			if( inst == null ) {