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
nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe));
nlassert(adpcmData.size() == mono16Data.size() / 2);
// nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe));
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);
mono16Buffers[j].swap(mono16Data);

@ -83,6 +83,18 @@ if not args.noconf:
DatabaseDirectory
except NameError:
DatabaseDirectory = "W:/database"
try:
SoundDirectory
except NameError:
SoundDirectory = "V:"
try:
SoundSheetsDirectory
except NameError:
SoundSheetsDirectory = "V:"
try:
SoundSheetsDfnDirectory
except NameError:
SoundSheetsDfnDirectory = "V:/DFN"
try:
ExportBuildDirectory
except NameError:
@ -218,6 +230,9 @@ if not args.noconf:
ScriptDirectory = askVar(log, "[IN] Script Directory", os.getcwd().replace("\\", "/")).replace("\\", "/")
WorkspaceDirectory = askVar(log, "[IN] Workspace Directory", WorkspaceDirectory).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("\\", "/")
InstallDirectory = askVar(log, "[OUT] Install Directory", InstallDirectory).replace("\\", "/")
ClientDevDirectory = askVar(log, "[OUT] Client Dev Directory", ClientDevDirectory).replace("\\", "/")
@ -301,6 +316,9 @@ if not args.noconf:
sf.write("\n")
sf.write("# Data build directories\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("\n")
sf.write("# Install directories\n")
@ -415,6 +433,9 @@ if not args.noverify:
findTool(log, ToolDirectories, MakeSheetIdTool, ToolSuffix)
# findTool(log, ToolDirectories, BuildSheetsTool, 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, LightmapOptimizerTool, ToolSuffix)
findTool(log, ToolDirectories, BuildClodtexTool, ToolSuffix)

@ -73,6 +73,9 @@ TileEditTool = "tile_edit"
MakeSheetIdTool = "make_sheet_id"
# BuildSheetsTool = "th_build_sheets" # 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"
LightmapOptimizerTool = "lightmap_optimizer"
BuildClodtexTool = "build_clodtex"

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

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

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

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

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

Loading…
Cancel
Save