Add samplebank build process

feature/opengl3
kaetemi 5 years ago
parent 2faa1d7ab8
commit 9307cac83c

@ -768,8 +768,11 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
} }
// Sample number MUST be even // Sample number MUST be even
nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe)); // nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe));
nlassert(adpcmData.size() == mono16Data.size() / 2); if (mono16Data.size() & 1)
nlwarning("Uneven sample numbers, ADPCM will miss a sample. File: %s, Samples: %i, ADPCM Size: %i",
sampleList[j].c_str(), (int)mono16Data.size(), (int)adpcmData.size());
nlassert(adpcmData.size() == (mono16Data.size() >> 1));
adpcmBuffers[j].swap(adpcmData); adpcmBuffers[j].swap(adpcmData);
mono16Buffers[j].swap(mono16Data); mono16Buffers[j].swap(mono16Data);

@ -83,6 +83,18 @@ if not args.noconf:
DatabaseDirectory DatabaseDirectory
except NameError: except NameError:
DatabaseDirectory = "W:/database" DatabaseDirectory = "W:/database"
try:
SoundDirectory
except NameError:
SoundDirectory = "V:"
try:
SoundSheetsDirectory
except NameError:
SoundSheetsDirectory = "V:"
try:
SoundSheetsDfnDirectory
except NameError:
SoundSheetsDfnDirectory = "V:/DFN"
try: try:
ExportBuildDirectory ExportBuildDirectory
except NameError: except NameError:
@ -218,6 +230,9 @@ if not args.noconf:
ScriptDirectory = askVar(log, "[IN] Script Directory", os.getcwd().replace("\\", "/")).replace("\\", "/") ScriptDirectory = askVar(log, "[IN] Script Directory", os.getcwd().replace("\\", "/")).replace("\\", "/")
WorkspaceDirectory = askVar(log, "[IN] Workspace Directory", WorkspaceDirectory).replace("\\", "/") WorkspaceDirectory = askVar(log, "[IN] Workspace Directory", WorkspaceDirectory).replace("\\", "/")
DatabaseDirectory = askVar(log, "[IN] Database Directory", DatabaseDirectory).replace("\\", "/") DatabaseDirectory = askVar(log, "[IN] Database Directory", DatabaseDirectory).replace("\\", "/")
SoundDirectory = askVar(log, "[IN] Sound Directory", SoundDirectory).replace("\\", "/")
SoundSheetsDirectory = askVar(log, "[IN] Sound Sheets Directory", SoundSheetsDirectory).replace("\\", "/")
SoundSheetsDfnDirectory = askVar(log, "[IN] Sound Sheets DFN Directory", SoundSheetsDfnDirectory).replace("\\", "/")
ExportBuildDirectory = askVar(log, "[OUT] Export Build Directory", ExportBuildDirectory).replace("\\", "/") ExportBuildDirectory = askVar(log, "[OUT] Export Build Directory", ExportBuildDirectory).replace("\\", "/")
InstallDirectory = askVar(log, "[OUT] Install Directory", InstallDirectory).replace("\\", "/") InstallDirectory = askVar(log, "[OUT] Install Directory", InstallDirectory).replace("\\", "/")
ClientDevDirectory = askVar(log, "[OUT] Client Dev Directory", ClientDevDirectory).replace("\\", "/") ClientDevDirectory = askVar(log, "[OUT] Client Dev Directory", ClientDevDirectory).replace("\\", "/")
@ -301,6 +316,9 @@ if not args.noconf:
sf.write("\n") sf.write("\n")
sf.write("# Data build directories\n") sf.write("# Data build directories\n")
sf.write("DatabaseDirectory = \"" + str(DatabaseDirectory) + "\"\n") sf.write("DatabaseDirectory = \"" + str(DatabaseDirectory) + "\"\n")
sf.write("SoundDirectory = \"" + str(SoundDirectory) + "\"\n")
sf.write("SoundSheetsDirectory = \"" + str(SoundSheetsDirectory) + "\"\n")
sf.write("SoundSheetsDfnDirectory = \"" + str(SoundSheetsDfnDirectory) + "\"\n")
sf.write("ExportBuildDirectory = \"" + str(ExportBuildDirectory) + "\"\n") sf.write("ExportBuildDirectory = \"" + str(ExportBuildDirectory) + "\"\n")
sf.write("\n") sf.write("\n")
sf.write("# Install directories\n") sf.write("# Install directories\n")
@ -415,6 +433,9 @@ if not args.noverify:
findTool(log, ToolDirectories, MakeSheetIdTool, ToolSuffix) findTool(log, ToolDirectories, MakeSheetIdTool, ToolSuffix)
# findTool(log, ToolDirectories, BuildSheetsTool, ToolSuffix) # kaetemi stuff, ignore this # findTool(log, ToolDirectories, BuildSheetsTool, ToolSuffix) # kaetemi stuff, ignore this
# findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) # kaetemi stuff, ignore this # findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) # kaetemi stuff, ignore this
# findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix)
findTool(log, ToolDirectories, BuildSoundbankTool, ToolSuffix)
findTool(log, ToolDirectories, BuildSamplebankTool, ToolSuffix)
findTool(log, ToolDirectories, BuildCoarseMeshTool, ToolSuffix) findTool(log, ToolDirectories, BuildCoarseMeshTool, ToolSuffix)
findTool(log, ToolDirectories, LightmapOptimizerTool, ToolSuffix) findTool(log, ToolDirectories, LightmapOptimizerTool, ToolSuffix)
findTool(log, ToolDirectories, BuildClodtexTool, ToolSuffix) findTool(log, ToolDirectories, BuildClodtexTool, ToolSuffix)

@ -73,6 +73,9 @@ TileEditTool = "tile_edit"
MakeSheetIdTool = "make_sheet_id" MakeSheetIdTool = "make_sheet_id"
# BuildSheetsTool = "th_build_sheets" # kaetemi stuff, ignore this # BuildSheetsTool = "th_build_sheets" # kaetemi stuff, ignore this
# BuildSoundTool = "th_build_sound" # kaetemi stuff, ignore this # BuildSoundTool = "th_build_sound" # kaetemi stuff, ignore this
# BuildSoundTool = "build_sound"
BuildSoundbankTool = "build_soundbank"
BuildSamplebankTool = "build_samplebank"
BuildCoarseMeshTool = "build_coarse_mesh" BuildCoarseMeshTool = "build_coarse_mesh"
LightmapOptimizerTool = "lightmap_optimizer" LightmapOptimizerTool = "lightmap_optimizer"
BuildClodtexTool = "build_clodtex" BuildClodtexTool = "build_clodtex"

@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# #
# \file 0_setup.py # \file 0_setup.py
# \brief Setup sound # \brief Setup samplebank
# \date 2009-06-03 10:47GMT # \date 2009-06-03 10:47GMT
# \author Jan Boon (Kaetemi) # \author Jan Boon (Kaetemi)
# Python port of game data build pipeline. # Python port of game data build pipeline.
# Setup sound # Setup samplebank
# #
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2009-2014 by authors # Copyright (C) 2009-2014 by authors
@ -38,29 +38,25 @@ from directories import *
printLog(log, "") printLog(log, "")
printLog(log, "-------") printLog(log, "-------")
printLog(log, "--- Setup sound") printLog(log, "--- Setup samplebank")
printLog(log, "-------") printLog(log, "-------")
printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
printLog(log, "") printLog(log, "")
# Setup source directories # Setup source directories
printLog(log, ">>> Setup source directories <<<") printLog(log, ">>> Setup source directories <<<")
mkPath(log, LeveldesignDirectory) mkPath(log, SoundDirectory + "/" + SoundSamplebanksSourceDirectory)
mkPath(log, LeveldesignDfnDirectory)
mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory)
# Setup export directories # Setup export directories
printLog(log, ">>> Setup export directories <<<") printLog(log, ">>> Setup export directories <<<")
# Setup build directories # Setup build directories
printLog(log, ">>> Setup build directories <<<") printLog(log, ">>> Setup build directories <<<")
mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory)
# Setup client directories # Setup client directories
printLog(log, ">>> Setup client directories <<<") printLog(log, ">>> Setup client directories <<<")
mkPath(log, InstallDirectory + "/" + SoundSheetsInstallDirectory) mkPath(log, InstallDirectory + "/" + SoundInstallDirectory)
mkPath(log, InstallDirectory + "/" + SoundSamplebanksInstallDirectory)
log.close() log.close()

@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# #
# \file 1_export.py # \file 1_export.py
# \brief Export sound # \brief Export samplebank
# \date 2009-06-03 10:47GMT # \date 2009-06-03 10:47GMT
# \author Jan Boon (Kaetemi) # \author Jan Boon (Kaetemi)
# Python port of game data build pipeline. # Python port of game data build pipeline.
# Export sound # Export samplebank
# #
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2009-2014 by authors # Copyright (C) 2009-2014 by authors
@ -38,7 +38,7 @@ from directories import *
printLog(log, "") printLog(log, "")
printLog(log, "-------") printLog(log, "-------")
printLog(log, "--- Export sound") printLog(log, "--- Export samplebank")
printLog(log, "-------") printLog(log, "-------")
printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
printLog(log, "") printLog(log, "")

@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# #
# \file 2_build.py # \file 2_build.py
# \brief Build sound # \brief Build samplebank
# \date 2009-06-03 10:47GMT # \date 2009-06-03 10:47GMT
# \author Jan Boon (Kaetemi) # \author Jan Boon (Kaetemi)
# Python port of game data build pipeline. # Python port of game data build pipeline.
# Build sound # Build samplebank
# #
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2009-2014 by authors # Copyright (C) 2009-2014 by authors
@ -38,28 +38,33 @@ from directories import *
printLog(log, "") printLog(log, "")
printLog(log, "-------") printLog(log, "-------")
printLog(log, "--- Build sound") printLog(log, "--- Build samplebank")
printLog(log, "-------") printLog(log, "-------")
printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
printLog(log, "") printLog(log, "")
# Find tools # Find tools
BuildSound = findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) BuildSamplebank = findTool(log, ToolDirectories, BuildSamplebankTool, ToolSuffix)
printLog(log, "") printLog(log, "")
# For each sound directory # For each samplebank directory
printLog(log, ">>> Build sound <<<") printLog(log, ">>> Build samplebank <<<")
if BuildSound == "": if BuildSamplebank == "":
toolLogFail(log, BuildSoundTool, ToolSuffix) toolLogFail(log, BuildSamplebankTool, ToolSuffix)
else: else:
mkPath(log, LeveldesignDirectory) sourcePath = SoundDirectory + "/" + SoundSamplebanksSourceDirectory
mkPath(log, LeveldesignDfnDirectory) buildPath = ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory
mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory) mkPath(log, sourcePath)
mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) mkPath(log, buildPath)
mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) for dir in os.listdir(sourcePath):
subprocess.call([ BuildSound, LeveldesignDirectory, LeveldesignDfnDirectory, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory ]) dirPath = sourcePath + "/" + dir
moveFilesExtNoTree(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, ".sample_bank") if (os.path.isdir(dirPath)) and dir != ".svn" and dir != "*.*":
printLog(log, "") samplebankPath = buildPath + "/" + dir + ".sample_bank"
if needUpdateDirNoSubdirFile(log, dirPath, samplebankPath):
# build_samplebank <source_samplebank> <build_samplebank> <samplebank_name>
subprocess.call([ BuildSamplebank, dirPath, buildPath, dir ])
else:
printLog(log, "SKIP " + samplebankPath)
log.close() log.close()

@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# #
# \file 3_install.py # \file 3_install.py
# \brief Install sound # \brief Install samplebank
# \date 2009-06-03 10:47GMT # \date 2009-06-03 10:47GMT
# \author Jan Boon (Kaetemi) # \author Jan Boon (Kaetemi)
# Python port of game data build pipeline. # Python port of game data build pipeline.
# Install sound # Install samplebank
# #
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2009-2014 by authors # Copyright (C) 2009-2014 by authors
@ -38,20 +38,15 @@ from directories import *
printLog(log, "") printLog(log, "")
printLog(log, "-------") printLog(log, "-------")
printLog(log, "--- Install sound") printLog(log, "--- Install samplebank")
printLog(log, "-------") printLog(log, "-------")
printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
printLog(log, "") printLog(log, "")
printLog(log, ">>> Install sound packed_sheets <<<") printLog(log, ">>> Install samplebank <<<")
mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory)
mkPath(log, InstallDirectory + "/" + SoundSheetsInstallDirectory)
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory, InstallDirectory + "/" + SoundSheetsInstallDirectory, ".packed_sheets")
printLog(log, ">>> Install sound samplebanks <<<")
mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory)
mkPath(log, InstallDirectory + "/" + SoundSamplebanksInstallDirectory) mkPath(log, InstallDirectory + "/" + SoundInstallDirectory)
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, InstallDirectory + "/" + SoundSamplebanksInstallDirectory, ".sample_bank") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, InstallDirectory + "/" + SoundInstallDirectory, ".sample_bank")
printLog(log, "") printLog(log, "")
log.close() log.close()

@ -56,6 +56,10 @@ namespace {
// your build script system. // // your build script system. //
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// this tool is deprecated by build_samplebank and build_soundbank //
/////////////////////////////////////////////////////////////////////
int main(int nNbArg, char **ppArgs) int main(int nNbArg, char **ppArgs)
{ {
// create debug stuff // create debug stuff

Loading…
Cancel
Save