|
@@ -41,13 +41,13 @@ class CacheFile extends Cache {
|
|
|
|
|
|
public var allowSave = #if usesys false #else true #end;
|
|
|
|
|
|
- public function new( allowCompile, recompileRT = false ) {
|
|
|
+ public function new( allowCompile, recompileRT = false, showProgress = false ) {
|
|
|
super();
|
|
|
this.allowCompile = allowCompile;
|
|
|
this.recompileRT = recompileRT || allowCompile;
|
|
|
this.file = FILENAME;
|
|
|
sourceFile = this.file + "." + getPlatformTag();
|
|
|
- load();
|
|
|
+ load(showProgress);
|
|
|
}
|
|
|
|
|
|
function getPlatformTag() {
|
|
@@ -120,7 +120,7 @@ class CacheFile extends Cache {
|
|
|
for( r in wait ) {
|
|
|
if (showProgress && (waitCount % 5 == 0 || waitCount <= 1)) {
|
|
|
var progress = Std.int((1 - (waitCount / fullCount)) * 1000) / 10;
|
|
|
- Sys.print('$progress% \t(${fullCount - waitCount}/$fullCount) \r');
|
|
|
+ log('$progress% \t(${fullCount - waitCount}/$fullCount) \r');
|
|
|
}
|
|
|
|
|
|
addNewShader(r);
|
|
@@ -135,7 +135,14 @@ class CacheFile extends Cache {
|
|
|
}
|
|
|
#else
|
|
|
haxe.Timer.delay(function() {
|
|
|
- for( r in wait ) {
|
|
|
+ var shaderCount = wait.length;
|
|
|
+ if ( showProgress )
|
|
|
+ log('Compiling ${shaderCount} shaders');
|
|
|
+ for( i => r in wait ) {
|
|
|
+ if ( showProgress && i % 5 == 0 ) {
|
|
|
+ var progress = Std.int((i / shaderCount) * 1000) / 10;
|
|
|
+ log('$progress% \t($i/$shaderCount) \r');
|
|
|
+ }
|
|
|
addNewShader(r);
|
|
|
hxd.System.timeoutTick();
|
|
|
}
|