Ver código fonte

Adding FileConverter.hx time precision as public static final

clementlandrin 11 meses atrás
pai
commit
81932f07f4
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      hxd/fs/FileConverter.hx

+ 4 - 1
hxd/fs/FileConverter.hx

@@ -26,6 +26,9 @@ typedef ConvertCommand = {
 
 class FileConverter {
 
+	// Date implementation has a second resolution on some platforms.
+	public static final FILE_TIME_PRECISION = 1000;
+
 	public var configuration(default,null) : String;
 
 	var baseDir : String;
@@ -311,7 +314,7 @@ class FileConverter {
 
 		if( !sys.FileSystem.exists(fullPath) ) throw "Missing "+fullPath;
 
-		var time = std.Math.floor(getFileTime(fullPath) / 1000);
+		var time = std.Math.floor(getFileTime(fullPath) / FILE_TIME_PRECISION);
 		var alreadyGen = sys.FileSystem.exists(fullOutPath) && match.ver == conv.version #if disable_res_cache && false #end;
 
 		if( alreadyGen && match.time == time )