From f085e226c67a04c19f0857b9648cfc3e36f45b43 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 8 Feb 2014 22:54:25 +0100 Subject: [PATCH] Implement skip for ig elevation --- .../build_gamedata/processes/ig/2_build.py | 77 ++++++++++++------- 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/code/nel/tools/build_gamedata/processes/ig/2_build.py b/code/nel/tools/build_gamedata/processes/ig/2_build.py index 538071b7d..55d9475f4 100644 --- a/code/nel/tools/build_gamedata/processes/ig/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ig/2_build.py @@ -54,34 +54,56 @@ mkPath(log, configDir) def igElevation(inputIgDir, outputIgDir): printLog(log, ">>> IG Elevation <<<") - - mkPath(log, inputIgDir) - mkPath(log, outputIgDir) - mkPath(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory) - - configFile = configDir + "/ig_elevation.cfg" - if os.path.isfile(configFile): + needUpdateIg = needUpdateDirByTagLog(log, inputIgDir, ".ig", outputIgDir, ".ig") + if needUpdateIg: + printLog(log, "DETECT UPDATE IG->Elevated") + else: + printLog(log, "DETECT SKIP IG->Elevated") + needUpdateHeightMap = needUpdateFileDirNoSubdir(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1, outputIgDir) or needUpdateFileDirNoSubdir(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2, outputIgDir) + if needUpdateHeightMap: + printLog(log, "DETECT UPDATE HeightMap->Elevated") + else: + printLog(log, "DETECT SKIP HeightMap->Elevated") + needUpdateLand = needUpdateFileDirNoSubdir(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand, outputIgDir) + if needUpdateLand: + printLog(log, "DETECT UPDATE Land->Elevated") + else: + printLog(log, "DETECT SKIP Land->Elevated") + if needUpdateIg or needUpdateHeightMap or needUpdateLand: + printLog(log, "DETECT DECIDE UPDATE") + mkPath(log, inputIgDir) + mkPath(log, outputIgDir) + mkPath(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory) + + configFile = configDir + "/ig_elevation.cfg" + if os.path.isfile(configFile): + os.remove(configFile) + + printLog(log, "CONFIG " + configFile) + cf = open(configFile, "w") + cf.write("// ig_elevation.cfg\n") + cf.write("\n") + cf.write("InputIGDir = \"" + inputIgDir + "\";\n") + cf.write("OutputIGDir = \"" + outputIgDir + "\";\n") + cf.write("\n") + cf.write("CellSize = 160.0;") + cf.write("\n") + cf.write("HeightMapFile1 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1 + "\";\n") + cf.write("ZFactor1 = " + LigoExportZFactor1 + ";\n") + cf.write("HeightMapFile2 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2 + "\";\n") + cf.write("ZFactor2 = " + LigoExportZFactor2 + ";\n") + cf.write("\n") + cf.write("LandFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand + "\";\n") + cf.write("\n") + cf.close() + subprocess.call([ IgElevation, configFile ]) os.remove(configFile) - - printLog(log, "CONFIG " + configFile) - cf = open(configFile, "w") - cf.write("// ig_elevation.cfg\n") - cf.write("\n") - cf.write("InputIGDir = \"" + inputIgDir + "\";\n") - cf.write("OutputIGDir = \"" + outputIgDir + "\";\n") - cf.write("\n") - cf.write("CellSize = 160.0;") - cf.write("\n") - cf.write("HeightMapFile1 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1 + "\";\n") - cf.write("ZFactor1 = " + LigoExportZFactor1 + ";\n") - cf.write("HeightMapFile2 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2 + "\";\n") - cf.write("ZFactor2 = " + LigoExportZFactor2 + ";\n") - cf.write("\n") - cf.write("LandFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand + "\";\n") - cf.write("\n") - cf.close() - subprocess.call([ IgElevation, configFile ]) - os.remove(configFile) + + # Copy remaining IG files + copyFilesLogless(log, inputIgDir, outputIgDir) + else: + printLog(log, "DETECT DECIDE SKIP") + printLog(log, "SKIP *") # Build process if (ContinentLeveldesignWorldDirectory != "") or (len(IgOtherSourceDirectories) > 0): @@ -134,7 +156,6 @@ if (ContinentLeveldesignWorldDirectory != "") or (len(IgOtherSourceDirectories) igElevation(ExportBuildDirectory + "/" + LigoIgLandBuildDirectory, ExportBuildDirectory + "/" + IgElevLandLigoBuildDirectory) igElevation(ExportBuildDirectory + "/" + IgStaticLandExportDirectory, ExportBuildDirectory + "/" + IgElevLandStaticBuildDirectory) - printLog(log, ">>> Merge land IGs <<<") mkPath(log, ExportBuildDirectory + "/" + IgTempLandMergeBuildDirectory)