Merge with default

This commit is contained in:
kaetemi 2013-07-25 00:37:00 +02:00
parent cbe1872eb8
commit b93ab158a5
12 changed files with 166 additions and 61 deletions

View file

@ -123,7 +123,7 @@ MACRO(NL_DEFAULT_PROPS name label)
VERSION ${NL_VERSION}
SOVERSION ${NL_VERSION_MAJOR}
COMPILE_FLAGS "/GA"
LINK_FLAGS "/VERSION:${NL_VERSION}")
LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}")
ENDIF(${type} STREQUAL EXECUTABLE AND WIN32)
IF(WITH_STLPORT AND WIN32)

View file

@ -104,6 +104,8 @@
// Windows 64bits platform SDK compilers doesn't support inline assembler
# define NL_NO_ASM
# endif
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0600 // force VISTA minimal version in 64 bits
# endif
// define NOMINMAX to be sure that windows includes will not define min max macros, but instead, use the stl template
# define NOMINMAX

View file

@ -1170,8 +1170,7 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight
{
// Last patch
uint lastPatch=firstPatch+patchCountByThread;
if (lastPatch>patchCount)
lastPatch=patchCount;
lastPatch %= patchCount;
// Last patch computed
_LastPatchComputed[process] = firstPatch;
@ -3772,6 +3771,8 @@ uint CZoneLighter::getAPatch (uint process)
uint index = _LastPatchComputed[process];
uint firstIndex = index;
nlassert(index < _PatchInfo.size());
if (access.value().size() == 0)
// no more patches
return 0xffffffff;

View file

@ -197,6 +197,8 @@ namespace NLGUI
{
#ifdef LUA_NEVRAX_VERSION
_State = lua_open(l_realloc_func, l_free_func);
#elif defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
_State = luaL_newstate();
#else
_State = lua_open();
#endif

View file

@ -88,8 +88,6 @@ def generateSimpleMaxExporter(processName, fileExtension, sourceDirectoriesVaria
generateSimpleMaxExporter("pacs_prim", "pacs_prim", "PacsPrimSourceDirectories", "PacsPrimExportDirectory", "PacsPrimInstallDirectory")
generateSimpleMaxExporter("skel", "skel", "SkelSourceDirectories", "SkelExportDirectory", "SkelInstallDirectory")
generateSimpleMaxExporter("swt", "swt", "SwtSourceDirectories", "SwtExportDirectory", "SwtInstallDirectory")

View file

@ -100,6 +100,8 @@ def generateTaggedMaxExporter(processName, fileExtension, sourceDirectoriesVaria
generateTaggedMaxExporter("pacs_prim", "pacs_prim", "PacsPrimSourceDirectories", "PacsPrimExportDirectory", "PacsPrimTagExportDirectory", "PacsPrimInstallDirectory")
generateTaggedMaxExporter("clodbank", "clod", "ClodSourceDirectories", "ClodExportDirectory", "ClodTagExportDirectory", "ClodInstallDirectory")
generateTaggedMaxScript("ig", "ig")

View file

@ -6,7 +6,7 @@
#
# \file 1_export.py
# \brief Export pacs_prim
# \date 2011-09-28-07-42-GMT
# \date 2013-07-24-14-21-GMT
# \author Jan Boon (Kaetemi)
# Python port of game data build pipeline.
# Export pacs_prim
@ -33,7 +33,9 @@ sys.path.append("../../configuration")
if os.path.isfile("log.log"):
os.remove("log.log")
log = open("log.log", "w")
if os.path.isfile("temp_log.log"):
os.remove("temp_log.log")
log = open("temp_log.log", "w")
from scripts import *
from buildsite import *
from process import *
@ -47,6 +49,7 @@ printLog(log, "-------")
printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
printLog(log, "")
# Find tools
# ...
@ -58,15 +61,18 @@ if MaxAvailable:
printLog(log, ">>> Export pacs_prim 3dsmax <<<")
mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory)
mkPath(log, ExportBuildDirectory + "/" + PacsPrimTagExportDirectory)
for dir in PacsPrimSourceDirectories:
mkPath(log, DatabaseDirectory + "/" + dir)
if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimExportDirectory, ".pacs_prim")):
if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimTagExportDirectory, ".max.tag")):
scriptSrc = "maxscript/pacs_prim_export.ms"
scriptDst = MaxUserDirectory + "/scripts/pacs_prim_export.ms"
outputLogfile = ScriptDirectory + "/processes/pacs_prim/log.log"
outputDirectory = ExportBuildDirectory + "/" + PacsPrimExportDirectory
tagDirectory = ExportBuildDirectory + "/" + PacsPrimTagExportDirectory
maxSourceDir = DatabaseDirectory + "/" + dir
tagList = findFiles(log, outputDirectory, "", ".pacs_prim")
maxRunningTagFile = tagDirectory + "/max_running.tag"
tagList = findFiles(log, tagDirectory, "", ".max.tag")
tagLen = len(tagList)
if os.path.isfile(scriptDst):
os.remove(scriptDst)
@ -77,18 +83,50 @@ if MaxAvailable:
newline = line.replace("%OutputLogfile%", outputLogfile)
newline = newline.replace("%MaxSourceDirectory%", maxSourceDir)
newline = newline.replace("%OutputDirectory%", outputDirectory)
newline = newline.replace("%TagDirectory%", tagDirectory)
sDst.write(newline)
sSrc.close()
sDst.close()
zeroRetryLimit = 3
while tagDiff > 0:
mrt = open(maxRunningTagFile, "w")
mrt.write("moe-moe-kyun")
mrt.close()
printLog(log, "MAXSCRIPT " + scriptDst)
subprocess.call([ Max, "-U", "MAXScript", "pacs_prim_export.ms", "-q", "-mi", "-vn" ])
tagList = findFiles(log, outputDirectory, "", ".pacs_prim")
if os.path.exists(outputLogfile):
try:
lSrc = open(outputLogfile, "r")
for line in lSrc:
lineStrip = line.strip()
if (len(lineStrip) > 0):
printLog(log, lineStrip)
lSrc.close()
os.remove(outputLogfile)
except Exception:
printLog(log, "ERROR Failed to read 3dsmax log")
else:
printLog(log, "WARNING No 3dsmax log")
tagList = findFiles(log, tagDirectory, "", ".max.tag")
newTagLen = len(tagList)
tagDiff = newTagLen - tagLen
tagLen = newTagLen
printLog(log, "Exported " + str(tagDiff) + " .pacs_prim files!")
addTagDiff = 0
if os.path.exists(maxRunningTagFile):
printLog(log, "FAIL 3ds Max crashed and/or file export failed!")
if tagDiff == 0:
if zeroRetryLimit > 0:
zeroRetryLimit = zeroRetryLimit - 1
addTagDiff = 1
else:
printLog(log, "FAIL Retry limit reached!")
else:
addTagDiff = 1
os.remove(maxRunningTagFile)
printLog(log, "Exported " + str(tagDiff) + " .max files!")
tagDiff += addTagDiff
os.remove(scriptDst)
printLog(log, "")
@ -99,8 +137,10 @@ if os.path.isfile(listPath):
printLog(log, "")
log.close()
if os.path.isfile("log.log"):
os.remove("log.log")
shutil.move("temp_log.log", "log.log")
# end of file

View file

@ -8,6 +8,9 @@
-- Allocate 20 Me for the script
heapSize += 15000000
-- In case of error just abort the app and don't show nel report window
NelForceQuitOnMsgDisplayer()
nlErrorFilename = "%OutputLogfile%"
nlErrorStream = openFile nlErrorFilename mode:"a"
if nlErrorStream == undefined then
@ -110,75 +113,128 @@ fn runNelMaxExport inputMaxFile =
removeRunningTag = true
try
(
-- Get files in the %MaxSourceDirectory% directory
files = getFiles "%MaxSourceDirectory%/*.max"
gc()
-- Sort files
sort files
gc()
-- No file ?
if files.count != 0 then
undo off
(
-- For each files
for i = 1 to files.count do
-- Get files in the %MaxSourceDirectory% directory
files = getFiles "%MaxSourceDirectory%/*.max"
gc()
-- Sort files
sort files
gc()
-- No file ?
if files.count != 0 then
(
inputMaxFile = files[i]
outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".pacs_prim")
try
-- For each files
for i = 1 to files.count do
(
-- Compare file date
if (NeLTestFileDate outputNelFile inputMaxFile) == true then
(
-- Free memory and file handles
gc()
heapfree
inputMaxFile = files[i]
outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag")
-- Reset 3dsmax
resetMAXFile #noprompt
-- Open the max project
nlerror("Scanning file " + inputMaxFile + " ...")
if (loadMaxFile inputMaxFile quiet:true) == true then
--try
--(
-- Compare file date
if (NeLTestFileDate outputTagFile inputMaxFile) == true then
(
runNelMaxExport(inputMaxFile)
-- Free memory and file handles
gc()
heapfree
-- Reset 3dsmax
resetMAXFile #noprompt
-- Open the max project
nlerror("Scanning file " + inputMaxFile + " ...")
if (loadMaxFile inputMaxFile quiet:true) == true then
(
tagThisFile = runNelMaxExport(inputMaxFile)
-- Write a tag file
if tagThisFile == true then
(
tagFile = createFile outputTagFile
if tagFile == undefined then
(
nlerror("WARNING can't create tag file " + outputTagFile)
removeRunningTag = false
)
else
(
print "mukyu" to: tagFile
close tagFile
)
)
else
(
removeRunningTag = false
)
)
else
(
-- Error
nlerror("ERROR exporting 'pacs_prim': can't open the file " + inputMaxFile)
removeRunningTag = false
)
)
else
(
-- Error
nlerror("ERROR exporting 'pacs_prim': can't open the file " + inputMaxFile)
nlerror("SKIPPED BY TAG " + inputMaxFile)
)
)
else
(
nlerror("SKIPPED " + inputMaxFile)
)
)
catch
(
-- Error
nlerror("ERROR error exporting 'pacs_prim' in files " + inputMaxFile)
--)
--catch
--(
-- -- Error
-- nlerror("ERROR error exporting 'pacs_prim' in file " + inputMaxFile)
-- removeRunningTag = false
--)
)
)
)
else
(
nlerror("WARNING no *.max file in folder %MaxSourceDirectory%")
else
(
nlerror("WARNING no *.max file in folder %MaxSourceDirectory%")
)
)
)
catch
(
-- Error
nlerror("ERROR fatal error exporting 'pacs_prim' in folder %MaxSourceDirectory%")
nlerror("ERROR Fatal error exporting 'pacs_prim' in folder %MaxSourceDirectory%")
nlerror("FAIL Fatal error occured")
NelForceQuitRightNow()
removeRunningTag = false
)
try
(
if (removeRunningTag) then
(
resetMAXFile #noPrompt
)
)
catch
(
nlerror("FAIL Last reset fails")
removeRunningTag = false
)
if (removeRunningTag) then
(
nlerror("SUCCESS All .max files have been successfully exported")
deleteFile("%TagDirectory%/max_running.tag")
)
else
(
nlerror("FAIL One or more issues occured")
NelForceQuitRightNow()
)
-- Bye
resetMAXFile #noprompt
nlerror("BYE")
quitMAX #noPrompt
quitMAX() #noPrompt

View file

@ -206,6 +206,7 @@ ZoneExportDirectory = CommonPath + "/zone"
# PACS primitives directories
PacsPrimExportDirectory = CommonPath + "/pacs_prim"
PacsPrimTagExportDirectory = CommonPath + "/pacs_prim_tag"
# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE ***

View file

@ -210,6 +210,7 @@ ZoneExportDirectory = CommonPath + "/zone"
# PACS primitives directories
PacsPrimExportDirectory = CommonPath + "/pacs_prim"
PacsPrimTagExportDirectory = CommonPath + "/pacs_prim_tag"
# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE ***

View file

@ -218,6 +218,7 @@ ZoneExportDirectory = CommonPath + "/zone"
# PACS primitives directories
PacsPrimExportDirectory = CommonPath + "/pacs_prim"
PacsPrimTagExportDirectory = CommonPath + "/pacs_prim_tag"
# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE ***

View file

@ -203,6 +203,7 @@ ZoneExportDirectory = CommonPath + "/zone"
# PACS primitives directories
PacsPrimExportDirectory = CommonPath + "/pacs_prim"
PacsPrimTagExportDirectory = CommonPath + "/pacs_prim_tag"
# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE ***