From 7b8f1b9a61dc39ad9cef766f01afe29f454fe870 Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Sun, 29 Mar 2020 10:00:30 +0800 Subject: [PATCH 01/25] Update azure-pipelines.yml --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0e8396061..8108a1917 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,10 +33,10 @@ jobs: mkdir build cmake --version cd build - cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_TOOLS=ON -DWITH_NEL_TOOLS=ON -DWITH_NELNS=ON -DWITH_NELNS_LOGIN_SYSTEM=ON -DWITH_NELNS_SERVER=ON -DWITH_QT5=ON -DWITH_LIBGSF=ON ../code + cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_TOOLS=ON -DWITH_NEL_TOOLS=ON -DWITH_NELNS=ON -DWITH_NELNS_LOGIN_SYSTEM=ON -DWITH_NELNS_SERVER=ON -DWITH_QT5=ON -DWITH_LIBGSF=ON .. cat CMakeCache.txt displayName: 'CMake' - script: | cd build make -j`nproc` - displayName: 'Make' \ No newline at end of file + displayName: 'Make' From d036b616b5a546d1ae9bb9d0e89fa3c6c14b1621 Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Sun, 29 Mar 2020 11:11:56 +0800 Subject: [PATCH 02/25] Update azure-pipelines.yml --- azure-pipelines.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8108a1917..10d0b1e63 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,3 +40,44 @@ jobs: cd build make -j`nproc` displayName: 'Make' + - job: ubuntu18 + timeoutInMinutes: 120 + pool: + vmImage: 'ubuntu-18.04' + steps: + - script: | + sudo apt update + sudo apt install -y software-properties-common + # sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt install cmake build-essential -y + sudo apt install gcc-8 g++-8 -y + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60 + sudo apt install bison autoconf automake -y + sudo apt install libpng-dev -y + sudo apt install libjpeg-dev -y + sudo apt install libgif-dev libfreetype6-dev -y + sudo apt install freeglut3-dev -y + sudo apt install liblua5.2-dev libluabind-dev libcpptest-dev -y + sudo apt install libogg-dev libvorbis-dev libopenal-dev -y + sudo apt install libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev -y + sudo apt install libmysqlclient-dev -y + sudo apt install libxml2-dev -y + sudo apt install libcurl4-openssl-dev libssl-dev -y + sudo apt install libsquish-dev -y + sudo apt install liblzma-dev -y + sudo apt install libgsf-1-dev -y + sudo apt install qtbase5-dev qttools5-dev qttools5-dev-tools + displayName: 'Dependencies' + - script: | + mkdir build + cmake --version + cd build + cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=OFF -DWITH_LUA52=ON -DWITH_RYZOM=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_TOOLS=ON -DWITH_NEL_TOOLS=ON -DWITH_NELNS=ON -DWITH_NELNS_LOGIN_SYSTEM=ON -DWITH_NELNS_SERVER=ON -DWITH_QT5=ON -DWITH_LIBGSF=ON .. + cat CMakeCache.txt + displayName: 'CMake' + - script: | + cd build + make -j`nproc` + displayName: 'Make' From d2d89ac44fd76d57838339e98b711f24eaa86160 Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Sun, 29 Mar 2020 14:02:39 +0800 Subject: [PATCH 03/25] Simplified default folder structure --- nel/tools/build_gamedata/0_setup.py | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/nel/tools/build_gamedata/0_setup.py b/nel/tools/build_gamedata/0_setup.py index 00d19cbe6..115962b8f 100755 --- a/nel/tools/build_gamedata/0_setup.py +++ b/nel/tools/build_gamedata/0_setup.py @@ -78,63 +78,63 @@ if not args.noconf: try: WorkspaceDirectory except NameError: - WorkspaceDirectory = "L:/workspace" + WorkspaceDirectory = "R:/workspace" try: DatabaseDirectory except NameError: - DatabaseDirectory = "W:/database" + DatabaseDirectory = "R:/graphics" try: SoundDirectory except NameError: - SoundDirectory = "V:" + SoundDirectory = "R:/sound" try: SoundDfnDirectory except NameError: - SoundDfnDirectory = "V:/DFN" + SoundDfnDirectory = "R:/sound/DFN" try: ExportBuildDirectory except NameError: - ExportBuildDirectory = "T:/export" + ExportBuildDirectory = "R:/pipeline/export" try: InstallDirectory except NameError: - InstallDirectory = "T:/install" + InstallDirectory = "R:/pipeline/install" try: ClientDevDirectory except NameError: - ClientDevDirectory = "T:/client_dev" + ClientDevDirectory = "R:/pipeline/client_dev" try: ClientPatchDirectory except NameError: - ClientPatchDirectory = "T:/client_patch" + ClientPatchDirectory = "R:/pipeline/client_patch" try: ClientInstallDirectory except NameError: - ClientInstallDirectory = "T:/client_install" + ClientInstallDirectory = "R:/pipeline/client_install" try: ShardInstallDirectory except NameError: - ShardInstallDirectory = "T:/shard" + ShardInstallDirectory = "R:/pipeline/shard" try: WorldEditInstallDirectory except NameError: - WorldEditInstallDirectory = "T:/worldedit" + WorldEditInstallDirectory = "R:/pipeline/worldedit" try: LeveldesignDirectory except NameError: - LeveldesignDirectory = "L:/leveldesign" + LeveldesignDirectory = "R:/leveldesign" try: LeveldesignDfnDirectory except NameError: - LeveldesignDfnDirectory = "L:/leveldesign/DFN" + LeveldesignDfnDirectory = "R:/leveldesign/DFN" try: LeveldesignWorldDirectory except NameError: - LeveldesignWorldDirectory = "L:/leveldesign/world" + LeveldesignWorldDirectory = "R:/leveldesign/world" try: PrimitivesDirectory except NameError: - PrimitivesDirectory = "L:/primitives" + PrimitivesDirectory = "R:/leveldesign/primitives" try: GamedevDirectory except NameError: @@ -150,15 +150,15 @@ if not args.noconf: try: LeveldesignDataShardDirectory except NameError: - LeveldesignDataShardDirectory = "L:/shard" + LeveldesignDataShardDirectory = "R:/leveldesign/shard" try: LeveldesignDataCommonDirectory except NameError: - LeveldesignDataCommonDirectory = "L:/common" + LeveldesignDataCommonDirectory = "R:/leveldesign/common" try: TranslationDirectory except NameError: - TranslationDirectory = "L:/translation" + TranslationDirectory = "R:/leveldesign/translation" try: WorldEditorFilesDirectory except NameError: @@ -166,27 +166,27 @@ if not args.noconf: try: WindowsExeDllCfgDirectories except NameError: - WindowsExeDllCfgDirectories = [ 'C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/redist/x86', 'D:/libraries/external/bin', 'R:/build/dev/bin/Release', 'R:/code/ryzom/client', 'R:/code/nel/lib', 'R:/code/ryzom/bin', 'R:/code/ryzom/tools/client/client_config/bin' ] + WindowsExeDllCfgDirectories = [ 'C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/redist/x86', 'R:/external/bin', 'R:/build/dev/bin/Release', 'R:/code/ryzom/client', 'R:/code/nel/lib', 'R:/code/ryzom/bin', 'R:/code/ryzom/tools/client/client_config/bin' ] try: LinuxServiceExecutableDirectory except NameError: - LinuxServiceExecutableDirectory = "S:/devls_x64/bin" + LinuxServiceExecutableDirectory = "R:/build/gcc_server/bin" try: LinuxClientExecutableDirectory except NameError: - LinuxClientExecutableDirectory = "S:/devl_x64/bin" + LinuxClientExecutableDirectory = "R:/build/gcc_client/bin" try: PatchmanCfgAdminDirectory except NameError: - PatchmanCfgAdminDirectory = "R:/code/ryzom/server/patchman_cfg/admin_install" + PatchmanCfgAdminDirectory = "R:/patchman/admin_install" try: PatchmanCfgDefaultDirectory except NameError: - PatchmanCfgDefaultDirectory = "R:/code/ryzom/server/patchman_cfg/default" + PatchmanCfgDefaultDirectory = "R:/patchman/default" try: PatchmanBridgeServerDirectory except NameError: - PatchmanBridgeServerDirectory = "T:/bridge_server" + PatchmanBridgeServerDirectory = "R:/pipeline/bridge_server" try: SignToolExecutable except NameError: From c9163412ade7ac204bbd704370c2e02e8359fdfb Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Sun, 29 Mar 2020 14:05:07 +0800 Subject: [PATCH 04/25] Simplified default folder structure --- nel/tools/build_gamedata/0_setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nel/tools/build_gamedata/0_setup.py b/nel/tools/build_gamedata/0_setup.py index 115962b8f..de868d8eb 100755 --- a/nel/tools/build_gamedata/0_setup.py +++ b/nel/tools/build_gamedata/0_setup.py @@ -66,7 +66,7 @@ if not args.noconf: try: ToolDirectories except NameError: - ToolDirectories = [ 'R:/build/dev/bin/Release', 'D:/libraries/external/bin' ] + ToolDirectories = [ 'R:/build/dev/bin/Release', 'R:/external/bin' ] try: ToolSuffix except NameError: @@ -78,7 +78,7 @@ if not args.noconf: try: WorkspaceDirectory except NameError: - WorkspaceDirectory = "R:/workspace" + WorkspaceDirectory = "R:/leveldesign/workspace" try: DatabaseDirectory except NameError: From b713dccdc95b03a120dc5f393ef6c78beca2b757 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 29 Mar 2020 17:01:39 +0800 Subject: [PATCH 05/25] Retarget to R:\leveldesign and R:\graphics --- .../data/world_editor_classes.xml | 4 +- .../stream_file/data/world_editor_classes.xml | 4 +- nel/tools/3d/build_gamedata/cfg/site.cfg | 2 +- .../processes/rbank/cfg/template_draft.cfg | 2 +- .../processes/rbank/cfg/template_final.cfg | 2 +- nel/tools/3d/ig_elevation/main.cpp | 4 +- nel/tools/3d/object_viewer/object_viewer.cfg | 46 +-- .../3d/pipeline_max_rewrite_assets/main.cpp | 2 +- .../scripts/nel_assets_dump_timings.ms | 4 +- .../scripts/nel_assets_png_batched.ms | 4 +- .../scripts/nel_assets_ps_batched.ms | 4 +- .../plugin_max/scripts/nel_assets_resave.ms | 4 +- .../scripts/nel_assets_resave_hard.ms | 4 +- .../scripts/nel_old_zone_to_ligo.ms | 8 +- .../plugin_max/scripts/nel_zone_snapshot.ms | 4 +- nel/tools/misc/data_mirror/config.cfg | 4 +- nel/tools/pacs/build_rbank/prim_checker.cpp | 2 +- .../sound/build_sound/build_sound_readme.txt | 4 +- .../sound/build_sound/build_sound_script.bat | 2 +- .../build_soundbank_readme.txt | 4 +- .../build_soundbank_script.bat | 2 +- .../world_editor_classes.xml | 344 +++++++++--------- .../leveldesign/georges_dll/georges_edit.html | 4 +- .../icon_search/icon_search_default.cfg | 8 +- ryzom/tools/leveldesign/install/georges.cfg | 8 +- .../leveldesign/install/mission_compiler.cfg | 8 +- .../install/world_editor_plugin.cfg | 8 +- .../install/world_editor_script.xml | 12 +- .../leveldesign/mission_compiler_lib/main.cpp | 2 +- .../mp_generator/raw_material_generation.cfg | 4 +- .../primitive_id_assignator.cfg | 4 +- .../sheets_packer_shard.cpp | 2 +- .../bnp_manager/bnp_manager_window.cpp | 2 +- .../plugins/core/general_settings_page.cpp | 8 +- .../georges_editor/georges_editor_form.cpp | 6 +- .../georges_treeview_dialog.cpp | 2 +- 36 files changed, 269 insertions(+), 269 deletions(-) diff --git a/nel/samples/sound/sound_sources/data/world_editor_classes.xml b/nel/samples/sound/sound_sources/data/world_editor_classes.xml index 0a26dc5f0..031fc6e86 100644 --- a/nel/samples/sound/sound_sources/data/world_editor_classes.xml +++ b/nel/samples/sound/sound_sources/data/world_editor_classes.xml @@ -323,7 +323,7 @@ --> - + @@ -343,7 +343,7 @@ - + diff --git a/nel/samples/sound/stream_file/data/world_editor_classes.xml b/nel/samples/sound/stream_file/data/world_editor_classes.xml index 0a26dc5f0..031fc6e86 100644 --- a/nel/samples/sound/stream_file/data/world_editor_classes.xml +++ b/nel/samples/sound/stream_file/data/world_editor_classes.xml @@ -323,7 +323,7 @@ --> - + @@ -343,7 +343,7 @@ - + diff --git a/nel/tools/3d/build_gamedata/cfg/site.cfg b/nel/tools/3d/build_gamedata/cfg/site.cfg index 7314415cd..6c5614d73 100644 --- a/nel/tools/3d/build_gamedata/cfg/site.cfg +++ b/nel/tools/3d/build_gamedata/cfg/site.cfg @@ -22,4 +22,4 @@ database_server = client_directory = R:/code/snowballs2/client/data/3d # DFN directories -dfn_directory = L:\leveldesign\DFN +dfn_directory = R:\leveldesign\DFN diff --git a/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_draft.cfg b/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_draft.cfg index 78d66d0d8..83f58a4bf 100644 --- a/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_draft.cfg +++ b/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_draft.cfg @@ -7,7 +7,7 @@ BanksPath = "../smallbank/smallbank/"; Bank = "rbank_bank_name"; ZoneExt = ".zonew"; IGBoxes = "bbox/temp.bbox"; -LevelDesignWorldPath = "l:/leveldesign/World"; +LevelDesignWorldPath = "R:/leveldesign/world"; IgLandPath = "../ig/ig_land"; IgVillagePath = "../ig/ig_other"; diff --git a/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_final.cfg b/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_final.cfg index c8ee2e7b7..be54b55a1 100644 --- a/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_final.cfg +++ b/nel/tools/3d/build_gamedata/processes/rbank/cfg/template_final.cfg @@ -7,7 +7,7 @@ BanksPath = "../smallbank/smallbank/"; Bank = "rbank_bank_name"; ZoneExt = ".zonew"; IGBoxes = "bbox/temp.bbox"; -LevelDesignWorldPath = "l:/leveldesign/World"; +LevelDesignWorldPath = "R:/leveldesign/world"; IgLandPath = "../ig/ig_land"; IgVillagePath = "../ig/ig_other"; diff --git a/nel/tools/3d/ig_elevation/main.cpp b/nel/tools/3d/ig_elevation/main.cpp index 0d43b5acc..126c66c62 100644 --- a/nel/tools/3d/ig_elevation/main.cpp +++ b/nel/tools/3d/ig_elevation/main.cpp @@ -256,9 +256,9 @@ int main(int nNbArg, char**ppArgs) printf ("InputIGDir = \"ig_land_max\";\n"); printf ("OutputIGDir = \"ig_land_max_elev\";\n"); printf ("CellSize = 160.0;\n"); - printf ("HeightMapFile1 = \"w:/database/landscape/ligo/jungle/big.tga\";\n"); + printf ("HeightMapFile1 = \"R:/graphics/landscape/ligo/jungle/big.tga\";\n"); printf ("ZFactor1 = 1.0;\n"); - printf ("HeightMapFile2 = \"w:/database/landscape/ligo/jungle/noise.tga\";\n"); + printf ("HeightMapFile2 = \"R:/graphics/landscape/ligo/jungle/noise.tga\";\n"); printf ("ZFactor2 = 0.5;\n"); printf ("LandFile = \"w:/matis.land\";\n"); diff --git a/nel/tools/3d/object_viewer/object_viewer.cfg b/nel/tools/3d/object_viewer/object_viewer.cfg index 25e48d7fc..712731d27 100644 --- a/nel/tools/3d/object_viewer/object_viewer.cfg +++ b/nel/tools/3d/object_viewer/object_viewer.cfg @@ -3,29 +3,29 @@ // your searhc pathes, (where to find textures, shapes, tiles, zones ...) search_pathes = { - "w:\database\stuff\fyros\agents\_textures\actors", - "w:\database\stuff\tryker\agents\_textures\actors", - "w:\database\stuff\matis\agents\_textures\actors", - "w:\database\stuff\zorai\agents\_textures\actors", - "w:\database\stuff\fyros\agents\_textures\monster", - "w:\database\stuff\tryker\agents\_textures\monster", - "w:\database\stuff\matis\agents\_textures\monster", - "w:\database\stuff\zorai\agents\_textures\monster", - "w:\database\stuff\fyros\agents\_textures\accessories", - "w:\database\stuff\tryker\agents\_textures\accessories", - "w:\database\stuff\matis\agents\_textures\accessories", - "w:\database\stuff\zorai\agents\_textures\accessories", - "W:\Database\Stuff\Matis\Decors\_textures\batiments", - "W:\Database\Stuff\zorai\Decors\_textures\batiments", - "W:\Database\Stuff\tryker\Decors\_textures\batiments", - "W:\Database\Stuff\fyros\Decors\_textures\batiments", - "W:\Database\Stuff\fyros\Decors\_textures", - "W:\Database\SFX\maps", - "W:\Database\SFX\old_shapes", - "W:\Database\Stuff\Primes_Racines\Agents\_textures\Monster", - "W:\Database\Stuff\Jungle\Agents\_textures\Monster", - "W:\Database\Stuff\Goo\Agents\_textures\monster", - "W:\Database\Stuff\caravan\Agents\_textures\Actors", + "R:\graphics\stuff\fyros\agents\_textures\actors", + "R:\graphics\stuff\tryker\agents\_textures\actors", + "R:\graphics\stuff\matis\agents\_textures\actors", + "R:\graphics\stuff\zorai\agents\_textures\actors", + "R:\graphics\stuff\fyros\agents\_textures\monster", + "R:\graphics\stuff\tryker\agents\_textures\monster", + "R:\graphics\stuff\matis\agents\_textures\monster", + "R:\graphics\stuff\zorai\agents\_textures\monster", + "R:\graphics\stuff\fyros\agents\_textures\accessories", + "R:\graphics\stuff\tryker\agents\_textures\accessories", + "R:\graphics\stuff\matis\agents\_textures\accessories", + "R:\graphics\stuff\zorai\agents\_textures\accessories", + "R:\graphics\Stuff\Matis\Decors\_textures\batiments", + "R:\graphics\Stuff\zorai\Decors\_textures\batiments", + "R:\graphics\Stuff\tryker\Decors\_textures\batiments", + "R:\graphics\Stuff\fyros\Decors\_textures\batiments", + "R:\graphics\Stuff\fyros\Decors\_textures", + "R:\graphics\SFX\maps", + "R:\graphics\SFX\old_shapes", + "R:\graphics\Stuff\Primes_Racines\Agents\_textures\Monster", + "R:\graphics\Stuff\Jungle\Agents\_textures\Monster", + "R:\graphics\Stuff\Goo\Agents\_textures\monster", + "R:\graphics\Stuff\caravan\Agents\_textures\Actors", }; recursive_search_pathes= diff --git a/nel/tools/3d/pipeline_max_rewrite_assets/main.cpp b/nel/tools/3d/pipeline_max_rewrite_assets/main.cpp index e28d87627..1fdae49ee 100644 --- a/nel/tools/3d/pipeline_max_rewrite_assets/main.cpp +++ b/nel/tools/3d/pipeline_max_rewrite_assets/main.cpp @@ -427,7 +427,7 @@ void doFileInitialize(const std::string &filePath) KnownFileCache[NLMISC::CFile::getFilename(filePath)] = standardizePath(filePath, false); } -// maxRewritePaths W:/database/interfaces/anims_max +// maxRewritePaths R:/graphics/interfaces/anims_max void doDirectoryInitialize(const std::string &directoryPath) { diff --git a/nel/tools/3d/plugin_max/scripts/nel_assets_dump_timings.ms b/nel/tools/3d/plugin_max/scripts/nel_assets_dump_timings.ms index 2730ce345..13a14a36a 100644 --- a/nel/tools/3d/plugin_max/scripts/nel_assets_dump_timings.ms +++ b/nel/tools/3d/plugin_max/scripts/nel_assets_dump_timings.ms @@ -4,7 +4,7 @@ NEL3D_APPDATA_INTERFACE_FILE = 1423062700 -- Allocate 20 Me for the script heapSize += 30000000 -nlErrorFilename = "W:/database/timings.log" +nlErrorFilename = "R:/graphics/timings.log" nlErrorStream = openFile nlErrorFilename mode:"w" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -171,7 +171,7 @@ rollout assets_resave_rollout "Properties" ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" Progress.value = i*100/files.count - if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + if (UseTag.checked == false) or ((NeLTestFileDate file "R:/graphics/conversion.tag") == true) then ( resetMAXFile #noprompt diff --git a/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms index cb6c339c8..11210371d 100644 --- a/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms +++ b/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -4,7 +4,7 @@ NEL3D_APPDATA_INTERFACE_FILE = 1423062700 -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "W:/database/conversion.log" +nlErrorFilename = "R:/graphics/conversion.log" nlErrorStream = openFile nlErrorFilename mode:"w" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -447,7 +447,7 @@ rollout assets_png_rollout "Properties" ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" Progress.value = i*100/files.count - if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + if (UseTag.checked == false) or ((NeLTestFileDate file "R:/graphics/conversion.tag") == true) then ( resetMAXFile #noprompt diff --git a/nel/tools/3d/plugin_max/scripts/nel_assets_ps_batched.ms b/nel/tools/3d/plugin_max/scripts/nel_assets_ps_batched.ms index c4bc56800..4d373d2f3 100644 --- a/nel/tools/3d/plugin_max/scripts/nel_assets_ps_batched.ms +++ b/nel/tools/3d/plugin_max/scripts/nel_assets_ps_batched.ms @@ -4,7 +4,7 @@ NEL3D_APPDATA_INTERFACE_FILE = 1423062700 -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "W:/database/conversion.log" +nlErrorFilename = "R:/graphics/conversion.log" nlErrorStream = openFile nlErrorFilename mode:"w" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -230,7 +230,7 @@ rollout assets_ps_rollout "Properties" ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" Progress.value = i*100/files.count - if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + if (UseTag.checked == false) or ((NeLTestFileDate file "R:/graphics/conversion.tag") == true) then ( resetMAXFile #noprompt diff --git a/nel/tools/3d/plugin_max/scripts/nel_assets_resave.ms b/nel/tools/3d/plugin_max/scripts/nel_assets_resave.ms index dcd8fde63..6ca4ef334 100644 --- a/nel/tools/3d/plugin_max/scripts/nel_assets_resave.ms +++ b/nel/tools/3d/plugin_max/scripts/nel_assets_resave.ms @@ -4,7 +4,7 @@ NEL3D_APPDATA_INTERFACE_FILE = 1423062700 -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "W:/database/conversion.log" +nlErrorFilename = "R:/graphics/conversion.log" nlErrorStream = openFile nlErrorFilename mode:"w" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -171,7 +171,7 @@ rollout assets_resave_rollout "Properties" ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" Progress.value = i*100/files.count - if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + if (UseTag.checked == false) or ((NeLTestFileDate file "R:/graphics/conversion.tag") == true) then ( resetMAXFile #noprompt diff --git a/nel/tools/3d/plugin_max/scripts/nel_assets_resave_hard.ms b/nel/tools/3d/plugin_max/scripts/nel_assets_resave_hard.ms index 50bd4efe9..95ea26f45 100644 --- a/nel/tools/3d/plugin_max/scripts/nel_assets_resave_hard.ms +++ b/nel/tools/3d/plugin_max/scripts/nel_assets_resave_hard.ms @@ -4,7 +4,7 @@ NEL3D_APPDATA_INTERFACE_FILE = 1423062700 -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "W:/database/conversion.log" +nlErrorFilename = "R:/graphics/conversion.log" nlErrorStream = openFile nlErrorFilename mode:"w" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -171,7 +171,7 @@ rollout assets_resave_rollout "Properties" ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" Progress.value = i*100/files.count - if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + if (UseTag.checked == false) or ((NeLTestFileDate file "R:/graphics/conversion.tag") == true) then ( resetMAXFile #noprompt diff --git a/nel/tools/3d/plugin_max/scripts/nel_old_zone_to_ligo.ms b/nel/tools/3d/plugin_max/scripts/nel_old_zone_to_ligo.ms index bb065cfef..4dbd67e40 100644 --- a/nel/tools/3d/plugin_max/scripts/nel_old_zone_to_ligo.ms +++ b/nel/tools/3d/plugin_max/scripts/nel_old_zone_to_ligo.ms @@ -34,12 +34,12 @@ struct metazone (name, posMin, posMax) -- Trykers : X: [194 - 215] Y: [DV - EW] Generate : X: [96 - 115] Y: [-215 - -215+22] -- Parameters, uppercase for cell position -old_zone_directory_fyros = "w:/database/landscape/zones/fyros" -ligo_directory_fyros = "w:/database/landscape/ligo/desert" +old_zone_directory_fyros = "R:/graphics/landscape/zones/fyros" +ligo_directory_fyros = "R:/graphics/landscape/ligo/desert" metazones_fyros = #(metazone "1_MZ_city" "152_EK" "155_EO", metazone "bridge_a" "158_EM" "158_EO", metazone "brandon" "164_ES" "165_ET", metazone "ecorce_A" "155_EI" "157_EJ") -old_zone_directory_tryker = "w:/database/landscape/zones/tryker" -ligo_directory_tryker = "r:/database/landscape/ligo/lacustre" +old_zone_directory_tryker = "R:/graphics/landscape/zones/tryker" +ligo_directory_tryker = "R:/graphics/landscape/ligo/lacustre" metazones_tryker = #(metazone "village_a" "205_EC" "208_EE", metazone "village_b" "199_EH" "200_EI", metazone "village_c" "206_EH" "208_EJ", metazone "village_d" "206_DS" "208_DU") cell_size = 160.0 diff --git a/nel/tools/3d/plugin_max/scripts/nel_zone_snapshot.ms b/nel/tools/3d/plugin_max/scripts/nel_zone_snapshot.ms index edab4f35d..b964498a1 100644 --- a/nel/tools/3d/plugin_max/scripts/nel_zone_snapshot.ms +++ b/nel/tools/3d/plugin_max/scripts/nel_zone_snapshot.ms @@ -5,8 +5,8 @@ size_x = 7680-320 from_y = -25600+160 size_y = 5120-320 -targetdir = "W:/database/landscape/ligo/asteroids/max" -snapshotdir = "W:/database/landscape/ligo/asteroids/zonebitmaps" +targetdir = "R:/graphics/landscape/ligo/asteroids/max" +snapshotdir = "R:/graphics/landscape/ligo/asteroids/zonebitmaps" zonename = "anne" resumeonly = true diff --git a/nel/tools/misc/data_mirror/config.cfg b/nel/tools/misc/data_mirror/config.cfg index b4a970025..2e33d2328 100644 --- a/nel/tools/misc/data_mirror/config.cfg +++ b/nel/tools/misc/data_mirror/config.cfg @@ -1,5 +1,5 @@ -MainDirectory = "w:\database"; -MirrorDirectory = "q:\database"; +MainDirectory = "R:\graphics"; +MirrorDirectory = "Q:\graphics"; LogDirectory = ""; BinaryCompare = "false"; IgnoreDirectory = ""; \ No newline at end of file diff --git a/nel/tools/pacs/build_rbank/prim_checker.cpp b/nel/tools/pacs/build_rbank/prim_checker.cpp index cef6b36ae..3b8c11bf9 100644 --- a/nel/tools/pacs/build_rbank/prim_checker.cpp +++ b/nel/tools/pacs/build_rbank/prim_checker.cpp @@ -72,7 +72,7 @@ bool CPrimChecker::build(const string &primitivesPath, const string &igLandPath, // Init ligo if (!LigoConfig.readPrimitiveClass ("world_editor_classes.xml", false)) { - // Should be in l:\leveldesign\world_edit_files + // Should be in R:\leveldesign\world_edit_files nlwarning ("Can't load ligo primitive config file world_editor_classes.xml"); return false; } diff --git a/nel/tools/sound/build_sound/build_sound_readme.txt b/nel/tools/sound/build_sound/build_sound_readme.txt index c94157884..436996051 100644 --- a/nel/tools/sound/build_sound/build_sound_readme.txt +++ b/nel/tools/sound/build_sound/build_sound_readme.txt @@ -3,8 +3,8 @@ build_sound -leveldesign = L:\leveldesign\ -dfn = L:\leveldesign\dfn\ +leveldesign = R:\leveldesign\ +dfn = R:\leveldesign\dfn\ source_samplebanks = L:\assets\sound\samplebanks\ build_packed_sheets = L:\build\sound_sheets\ build_samplebanks = L:\build\sound_samplebanks\ diff --git a/nel/tools/sound/build_sound/build_sound_script.bat b/nel/tools/sound/build_sound/build_sound_script.bat index 343a02bbc..ce4a388c5 100644 --- a/nel/tools/sound/build_sound/build_sound_script.bat +++ b/nel/tools/sound/build_sound/build_sound_script.bat @@ -1 +1 @@ -build_sound_r L:\leveldesign\ L:\leveldesign\dfn\ L:\assets\sound\samplebanks\ L:\build\sound_sheets\ L:\build\sound_samplebanks +build_sound_r R:\leveldesign\ R:\leveldesign\dfn\ L:\assets\sound\samplebanks\ L:\build\sound_sheets\ L:\build\sound_samplebanks diff --git a/nel/tools/sound/build_soundbank/build_soundbank_readme.txt b/nel/tools/sound/build_soundbank/build_soundbank_readme.txt index ad22f55a0..126086855 100644 --- a/nel/tools/sound/build_soundbank/build_soundbank_readme.txt +++ b/nel/tools/sound/build_soundbank/build_soundbank_readme.txt @@ -3,8 +3,8 @@ build_soundbank -leveldesign = L:\leveldesign\ -dfn = L:\leveldesign\dfn\ +leveldesign = R:\leveldesign\ +dfn = R:\leveldesign\dfn\ build_packed_sheets = L:\build\sound_sheets\ Where L:\ is your game content database. diff --git a/nel/tools/sound/build_soundbank/build_soundbank_script.bat b/nel/tools/sound/build_soundbank/build_soundbank_script.bat index 9f1d3c8b3..c6d2d4ee6 100644 --- a/nel/tools/sound/build_soundbank/build_soundbank_script.bat +++ b/nel/tools/sound/build_soundbank/build_soundbank_script.bat @@ -1 +1 @@ -build_soundbank_r L:\leveldesign\ L:\leveldesign\dfn\ L:\build\sound_sheets\ +build_soundbank_r R:\leveldesign\ R:\leveldesign\dfn\ L:\build\sound_sheets\ diff --git a/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml b/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml index fb12350e3..b1d559365 100644 --- a/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml +++ b/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml @@ -98,7 +98,7 @@ - + @@ -128,7 +128,7 @@ @@ -147,7 +147,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -175,7 +175,7 @@ - + @@ -1566,15 +1566,15 @@ --> - + - + - + @@ -1596,13 +1596,13 @@ @@ -1704,7 +1704,7 @@ --> - + @@ -1865,7 +1865,7 @@ - + @@ -1888,7 +1888,7 @@ - + @@ -1997,11 +1997,11 @@ - - - - - + + + + + @@ -2014,11 +2014,11 @@ - - - - - + + + + + @@ -2033,11 +2033,11 @@ - - - - - + + + + + @@ -2111,7 +2111,7 @@ - + @@ -2131,7 +2131,7 @@ @@ -2151,7 +2151,7 @@ - + @@ -2166,7 +2166,7 @@ - + @@ -2180,7 +2180,7 @@ - + @@ -2196,7 +2196,7 @@ - + @@ -2470,22 +2470,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -2524,10 +2524,10 @@ --> - + - + @@ -2584,7 +2584,7 @@ --> - + @@ -2603,7 +2603,7 @@ --> - + @@ -2625,21 +2625,21 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -2731,10 +2731,10 @@ --> - + - + @@ -2772,10 +2772,10 @@ --> - + - + @@ -2813,10 +2813,10 @@ --> - + - + @@ -2839,10 +2839,10 @@ - + - + @@ -2880,7 +2880,7 @@ - + @@ -2899,7 +2899,7 @@ - + @@ -2918,7 +2918,7 @@ - + @@ -2935,7 +2935,7 @@ - + @@ -2964,17 +2964,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -3026,17 +3026,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -3071,11 +3071,11 @@ - + @@ -3119,17 +3119,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -3242,7 +3242,7 @@ - + - + @@ -4002,12 +4002,12 @@ --> - + @@ -4030,10 +4030,10 @@ --> - + - + @@ -4063,7 +4063,7 @@ --> - + @@ -4109,7 +4109,7 @@ - + @@ -4129,18 +4129,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -4200,7 +4200,7 @@ - + @@ -4225,18 +4225,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -4318,18 +4318,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -4504,7 +4504,7 @@ --> - + @@ -4646,7 +4646,7 @@ - + @@ -4681,7 +4681,7 @@ - + @@ -4715,7 +4715,7 @@ --> - + @@ -4749,7 +4749,7 @@ --> - + diff --git a/ryzom/tools/leveldesign/georges_dll/georges_edit.html b/ryzom/tools/leveldesign/georges_dll/georges_edit.html index fefd3e9d5..79da0501f 100644 --- a/ryzom/tools/leveldesign/georges_dll/georges_edit.html +++ b/ryzom/tools/leveldesign/georges_dll/georges_edit.html @@ -16,8 +16,8 @@ Config file Your "georges.cfg" config file MUST have the following entries:
    -
  • root_search_directory = "l:\"; // (Root search path for georges files)
  • -
  • typ_dfn_sub_folder = "dfn"; // (Sub directory for types and dfn files)
  • +
  • root_search_directory = "R:\leveldesign\"; // (Root search path for georges files)
  • +
  • typ_dfn_sub_folder = "DFN"; // (Sub directory for types and dfn files)
  • remember_list_size = 11; // (Size of remember list in combobox)
  • max_undo = 20; // (Size of the undo buffer)
  • default_type = "default.typ"; // (Default type used when insert a new element in a DFN)
  • diff --git a/ryzom/tools/leveldesign/icon_search/icon_search_default.cfg b/ryzom/tools/leveldesign/icon_search/icon_search_default.cfg index b343d9e7d..88fe51b5d 100644 --- a/ryzom/tools/leveldesign/icon_search/icon_search_default.cfg +++ b/ryzom/tools/leveldesign/icon_search/icon_search_default.cfg @@ -7,11 +7,11 @@ SearchGUI = 0; GUIPath = "R:\code\ryzom\data\gamedev\interfaces_v3\"; SearchLevelDesign = 1; -LevelDesignPath = "L:\"; +LevelDesignPath = "R:\leveldesign\"; -IconPath = { "\\amiga\3d\Database\Interfaces\v3_bricks", - "\\amiga\3d\Database\Interfaces\v3_dxtc_misc", - "\\amiga\3d\Database\Interfaces\v3_items" +IconPath = { "R:\graphics\interfaces\v3_bricks", + "R:\graphics\interfaces\v3_dxtc_misc", + "R:\graphics\interfaces\v3_items" }; SizeLimit = 10; diff --git a/ryzom/tools/leveldesign/install/georges.cfg b/ryzom/tools/leveldesign/install/georges.cfg index c7d975479..d108f3100 100644 --- a/ryzom/tools/leveldesign/install/georges.cfg +++ b/ryzom/tools/leveldesign/install/georges.cfg @@ -1,5 +1,5 @@ -RootSearchDirectory = "l:\leveldesign"; -TypDfnSubFolder = "dfn\"; +RootSearchDirectory = "R:\leveldesign"; +TypDfnSubFolder = "DFN\"; RememberListSize = 11; MaxUndo = 20; DefaultType = "default.typ"; @@ -11,5 +11,5 @@ SuperUser = 1; UserType = { }; StartExpanded = 1; -SamplePath = "L:\sound_files\samplebanks"; -PackedSheetPath = "L:\sound_files\"; +SamplePath = "R:\sound\samplebanks"; +PackedSheetPath = "R:\sound\"; diff --git a/ryzom/tools/leveldesign/install/mission_compiler.cfg b/ryzom/tools/leveldesign/install/mission_compiler.cfg index b95c51bdb..c0ee33d1b 100644 --- a/ryzom/tools/leveldesign/install/mission_compiler.cfg +++ b/ryzom/tools/leveldesign/install/mission_compiler.cfg @@ -1,10 +1,10 @@ // A list of recursive search path to build the primitive list -SearchPath = { "L:\primitives\" }; +SearchPath = { "R:\leveldesign\primitives\" }; // Ligo primitive configuration file path -LigoConfig = "L:\leveldesign\world_editor_files\world_editor_classes.xml"; +LigoConfig = "R:\leveldesign\world_editor_files\world_editor_classes.xml"; // Default filter DefaultFilter = ""; @@ -24,7 +24,7 @@ ServerPathPrim = { // Directory containing txt files ServerPathText = { -"R:\code\ryzom\tools\translation\work\phrases\rites", +"R:\leveldesign\translation\work\phrases\rites", // "\\linuxshard10\ryzom\cvs\code\ryzom\translation\work\phrases\rites", }; @@ -35,4 +35,4 @@ ServerName = { }; // Local path for text files -LocalTextPath = "R:\code\ryzom\tools\translation\work\phrases\rites"; +LocalTextPath = "R:\leveldesign\translation\work\phrases\rites"; diff --git a/ryzom/tools/leveldesign/install/world_editor_plugin.cfg b/ryzom/tools/leveldesign/install/world_editor_plugin.cfg index 1fb7d40c6..afeebd355 100644 --- a/ryzom/tools/leveldesign/install/world_editor_plugin.cfg +++ b/ryzom/tools/leveldesign/install/world_editor_plugin.cfg @@ -40,12 +40,12 @@ MOSHost = "devl1.ryzom.com"; ///////////////////////////////////////////////////////// PrimitivePluginPath = { - "L:/leveldesign/DFN", - "L:/leveldesign/Game_elem/Creature/objects", + "R:/leveldesign/DFN", + "R:/leveldesign/game_elem/creature/objects", }; -PrimitivePluginSheetId = "l:/leveldesign/Game_elem/sheet_id.bin"; +PrimitivePluginSheetId = "R:/leveldesign/game_elem/sheet_id.bin"; ///////////////////////////////////////////////////////// // Var related to shard monitor @@ -53,7 +53,7 @@ PrimitivePluginSheetId = "l:/leveldesign/Game_elem/sheet_id.bin"; // WARNING : the following path are not recursive ShardMonitorPath = { - "L:/leveldesign/Game_elem" // path where to find sheet_id.bin. + "R:/leveldesign/game_elem" // path where to find sheet_id.bin. }; // if you want to use a specific external editor, uncomment TextEditor and set the fullpath to the exe, by default, it's notepad diff --git a/ryzom/tools/leveldesign/install/world_editor_script.xml b/ryzom/tools/leveldesign/install/world_editor_script.xml index 32ff503ba..a12a1c39b 100644 --- a/ryzom/tools/leveldesign/install/world_editor_script.xml +++ b/ryzom/tools/leveldesign/install/world_editor_script.xml @@ -4,12 +4,12 @@ - - - - - - + + + + + + diff --git a/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp b/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp index b4bb6d77c..6c4285d46 100644 --- a/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp +++ b/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) if (leveldesignPath == NULL) { - printf("Error: You need to define RYZOM_LEVELDESIGN environment variable that points to previous L:\\ equivalent under Windows\n"); + printf("Error: You need to define RYZOM_LEVELDESIGN environment variable that points to previous R:\\leveldesign\\ equivalent under Windows\n"); return -1; } diff --git a/ryzom/tools/leveldesign/mp_generator/raw_material_generation.cfg b/ryzom/tools/leveldesign/mp_generator/raw_material_generation.cfg index 1df73f8ee..9e04bbd9f 100644 --- a/ryzom/tools/leveldesign/mp_generator/raw_material_generation.cfg +++ b/ryzom/tools/leveldesign/mp_generator/raw_material_generation.cfg @@ -1,5 +1,5 @@ -LevelDesignPath = "L:\" -TranslationPath = "R:\code\ryzom\translation\" +LevelDesignPath = "R:\leveldesign\" +TranslationPath = "R:\leveldesign\translation\" // Format: "sheetFilename", "PropertyName", "Value" CustomizedProperties = diff --git a/ryzom/tools/leveldesign/primitive_id_assignator/primitive_id_assignator.cfg b/ryzom/tools/leveldesign/primitive_id_assignator/primitive_id_assignator.cfg index a9c9b444e..35381c9f5 100644 --- a/ryzom/tools/leveldesign/primitive_id_assignator/primitive_id_assignator.cfg +++ b/ryzom/tools/leveldesign/primitive_id_assignator/primitive_id_assignator.cfg @@ -15,9 +15,9 @@ Filters = // the path (recursive) where the primitives are SearchPath = { - "l:/primitives", + "R:/leveldesign/primitives", }; // the index file that contains the indexed file database -IndexFile = "l:/primitives/file_index.cfg"; +IndexFile = "R:/leveldesign/primitives/file_index.cfg"; diff --git a/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp b/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp index 14ce53f4a..3062878ed 100644 --- a/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp +++ b/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp @@ -71,7 +71,7 @@ int main(int nNbArg, char **ppArgs) // verify all params if (nNbArg < 6) { - // sheets_packer_shard.exe L:\leveldesign L:\leveldesign\DFN R:\code\ryzom\server\data_shard\mirror_sheets T:\export\common\leveldesign\visual_slot_tab T:\test_shard + // sheets_packer_shard.exe R:\leveldesign R:\leveldesign\DFN R:\code\ryzom\server\data_shard\mirror_sheets T:\export\common\leveldesign\visual_slot_tab T:\test_shard nlinfo("ERROR : Wrong number of arguments\n"); nlinfo("USAGE : sheets_packer_shard \n"); nlinfo(" : Directory containing visual_slots.tab"); diff --git a/studio/src/plugins/bnp_manager/bnp_manager_window.cpp b/studio/src/plugins/bnp_manager/bnp_manager_window.cpp index c9e1a1894..9a4af0cd5 100644 --- a/studio/src/plugins/bnp_manager/bnp_manager_window.cpp +++ b/studio/src/plugins/bnp_manager/bnp_manager_window.cpp @@ -368,7 +368,7 @@ void BNPManagerWindow::readSettings() QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - m_DataPath = settings->value(Core::Constants::ASSETS_PATH, "w:/database").toString(); + m_DataPath = settings->value(Core::Constants::ASSETS_PATH, "R:/graphics").toString(); settings->endGroup(); } // *************************************************************************** diff --git a/studio/src/plugins/core/general_settings_page.cpp b/studio/src/plugins/core/general_settings_page.cpp index 79e1288a4..6fb51b128 100644 --- a/studio/src/plugins/core/general_settings_page.cpp +++ b/studio/src/plugins/core/general_settings_page.cpp @@ -211,10 +211,10 @@ void GeneralSettingsPage::readSettings() QStringList paths; settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - m_ui.leveldesignPathLineEdit->setText(settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString()); - m_ui.assetsPathLineEdit->setText(settings->value(Core::Constants::ASSETS_PATH, "w:/database").toString()); - m_ui.primitivesPathLineEdit->setText(settings->value(Core::Constants::PRIMITIVES_PATH, "l:/primitives").toString()); - m_ui.ligoConfigFileLineEdit->setText(settings->value(Core::Constants::LIGOCONFIG_FILE, "l:/leveldesign/world_editor_files/world_editor_classes.xml").toString()); + m_ui.leveldesignPathLineEdit->setText(settings->value(Core::Constants::LEVELDESIGN_PATH, "R:/leveldesign").toString()); + m_ui.assetsPathLineEdit->setText(settings->value(Core::Constants::ASSETS_PATH, "R:/graphics").toString()); + m_ui.primitivesPathLineEdit->setText(settings->value(Core::Constants::PRIMITIVES_PATH, "R:/leveldesign/primitives").toString()); + m_ui.ligoConfigFileLineEdit->setText(settings->value(Core::Constants::LIGOCONFIG_FILE, "R:/leveldesign/world_editor_files/world_editor_classes.xml").toString()); settings->endGroup(); } diff --git a/studio/src/plugins/georges_editor/georges_editor_form.cpp b/studio/src/plugins/georges_editor/georges_editor_form.cpp index 231a0efc3..009d2a6f0 100644 --- a/studio/src/plugins/georges_editor/georges_editor_form.cpp +++ b/studio/src/plugins/georges_editor/georges_editor_form.cpp @@ -116,7 +116,7 @@ namespace GeorgesQt m_lastSheetDir = "."; QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "R:/leveldesign").toString(); settings->endGroup(); connect(Core::ICore::instance(), SIGNAL(changeSettings()), @@ -234,7 +234,7 @@ namespace GeorgesQt settings->endGroup(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "R:/leveldesign").toString(); settings->endGroup(); } @@ -279,7 +279,7 @@ namespace GeorgesQt settings->beginGroup(Core::Constants::DATA_PATH_SECTION); QString oldLDPath = m_leveldesignPath; - m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "R:/leveldesign").toString(); settings->endGroup(); if (oldLDPath != m_leveldesignPath) diff --git a/studio/src/plugins/georges_editor/georges_treeview_dialog.cpp b/studio/src/plugins/georges_editor/georges_treeview_dialog.cpp index 48b444945..014b6c6ba 100644 --- a/studio/src/plugins/georges_editor/georges_treeview_dialog.cpp +++ b/studio/src/plugins/georges_editor/georges_treeview_dialog.cpp @@ -67,7 +67,7 @@ namespace GeorgesQt m_lastSheetDir = "."; QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "R:/leveldesign").toString(); settings->endGroup(); m_ui.setupUi(this); From 50be04111624b5443bafbc4c1b80c3cfaa623fc4 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 30 Mar 2020 02:43:28 +0800 Subject: [PATCH 06/25] Fix plugin build for 3ds Max 9 --- .../nel_3dsmax_shared/string_common.h | 22 ++++--------------- .../plugin_max/nel_patch_converter/script.cpp | 2 +- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/nel/tools/3d/plugin_max/nel_3dsmax_shared/string_common.h b/nel/tools/3d/plugin_max/nel_3dsmax_shared/string_common.h index 737b1a5dd..4a331a78a 100644 --- a/nel/tools/3d/plugin_max/nel_3dsmax_shared/string_common.h +++ b/nel/tools/3d/plugin_max/nel_3dsmax_shared/string_common.h @@ -21,6 +21,7 @@ #define NLMAX_STRING_COMMON_H #include +#include #if (MAX_VERSION_MAJOR < 15) #define GET_OBJECT_NAME_CONST @@ -37,9 +38,7 @@ static TSTR MaxTStrFromUtf8(const std::string &src) { TSTR dst; #if (MAX_VERSION_MAJOR < 15) - ucstring uc; - uc.fromUtf8(src); - dst = (const mwchar_t *)uc.c_str(); + dst = nlUtf8ToTStr(src); #else dst.FromUTF8(src.c_str()); #endif @@ -49,14 +48,7 @@ static TSTR MaxTStrFromUtf8(const std::string &src) static std::string MaxTStrToUtf8(const TSTR& src) { #if (MAX_VERSION_MAJOR < 15) -#ifdef _UNICODE - ucstring uc(src.data()); - return uc.toUtf8(); -#else - WStr ws = src; - ucstring uc((const ucchar *)ws.data()); - return uc.toUtf8(); -#endif + return NLMISC::tStrToUtf8(src.data()); #else return src.ToUTF8().data(); #endif @@ -64,13 +56,7 @@ static std::string MaxTStrToUtf8(const TSTR& src) static std::string MCharStrToUtf8(const MCHAR *src) { -#ifdef _UNICODE - ucstring uc((const ucchar *)src); - return uc.toUtf8(); -#else - ucstring uc((const ucchar *)WStr(src).data()); - return uc.toUtf8(); -#endif + return NLMISC::tStrToUtf8(src); } #endif /* #ifndef NLMAX_STRING_COMMON_H */ diff --git a/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp b/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp index 2c2f100f7..48bf1d921 100644 --- a/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp +++ b/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp @@ -1271,7 +1271,7 @@ Value* get_patch_vertex_cf (Value** arg_list, int count) // Check to see if the arguments match up to what we expect // We want to use 'TurnAllTexturesOn ' - const MCHAR *message= _M("NeLGetPatchVertex [NeLPatchMesh] [PatchId] [VertexId]"); + MCHAR *message= _M("NeLGetPatchVertex [NeLPatchMesh] [PatchId] [VertexId]"); type_check(arg_list[0], MAXNode, message); type_check(arg_list[1], Integer, message); type_check(arg_list[2], Integer, message); From 4f0bbbad69b6df008e4ae0096669070ff8b82c0e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 30 Mar 2020 08:38:17 +0800 Subject: [PATCH 07/25] String fixes --- nel/include/nel/misc/string_common.h | 8 ++++++++ nel/src/misc/i_xml.cpp | 5 +++-- .../world_editor/world_editor/world_editor.cpp | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/nel/include/nel/misc/string_common.h b/nel/include/nel/misc/string_common.h index 3fd46b835..9f6d59aae 100644 --- a/nel/include/nel/misc/string_common.h +++ b/nel/include/nel/misc/string_common.h @@ -290,6 +290,14 @@ inline bool endsWith(const char *str, const char *suffix) { return endsWith(str, inline bool endsWith(const std::string &str, const char *suffix) { return endsWith(str.c_str(), str.size(), suffix, strlen(suffix)); } inline bool endsWith(const std::string &str, const std::string &suffix) { return endsWith(str.c_str(), str.size(), suffix.c_str(), suffix.size()); } +// **************************************************************************** +// Conversion of strings between +// - UTF-8 +// - Local codepage (UTF-8 on Linux) +// - TString (Local codepage or wide on Windows) +// - Wide (wchar_t *, UTF-16 on Windows, UTF-32 on Linux) +// **************************************************************************** + // Convert local codepage to UTF-8 // On Windows, the local codepage is undetermined // On Linux, the local codepage is always UTF-8 (no-op) diff --git a/nel/src/misc/i_xml.cpp b/nel/src/misc/i_xml.cpp index 87f848ab9..24a2b7910 100644 --- a/nel/src/misc/i_xml.cpp +++ b/nel/src/misc/i_xml.cpp @@ -171,15 +171,16 @@ bool CIXml::init (IStream &stream) // Try binary mode if (_TryBinaryMode) { - char header[4]; + char header[5]; header[0] = buffer[0]; header[1] = buffer[1]; header[2] = buffer[2]; header[3] = buffer[3]; + header[4] = '\0'; toLower(header); // Does it a xml stream ? - if (!strcmp(header, " Date: Sun, 29 Mar 2020 13:54:09 +0300 Subject: [PATCH 08/25] Fixed: Hide 'sound disabled' warning on startup --- ryzom/client/src/interface_v3/music_player.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index 2deaa965b..f4d8b7db9 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -379,7 +379,10 @@ public: { if(!SoundMngr) { - CInterfaceManager::getInstance()->messageBox (CI18N::get ("uiSoundDisabled")); + // Do not show warning on volume change as its restored at startup + if (Params.find("volume") == std::string::npos) + CInterfaceManager::getInstance()->messageBox (CI18N::get ("uiMP3SoundDisabled")); + return; } From ddd16d485194407e534745b21c25d664d0e71734 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 29 Mar 2020 16:33:53 +0300 Subject: [PATCH 09/25] Fixed: Animal marker invalidates map on each frame --- ryzom/client/src/interface_v3/group_map.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ryzom/client/src/interface_v3/group_map.cpp b/ryzom/client/src/interface_v3/group_map.cpp index 5245ca304..24e1d14cc 100644 --- a/ryzom/client/src/interface_v3/group_map.cpp +++ b/ryzom/client/src/interface_v3/group_map.cpp @@ -1333,15 +1333,18 @@ void CGroupMap::checkCoords() { if( _AnimalLM[i] ) { + // update pos + sint32 px, py; + _AnimalPosStates[i]->getPos(px, py); + updateLMPosFromDBPos(_AnimalLM[i], px, py); + if (_IsIsland) { _AnimalLM[i]->setActive(false); } - else + else if (_AnimalLM[i]->getActive()) { - _AnimalLM[i]->setActive(true); // update texture from animal status - CInterfaceManager *pIM= CInterfaceManager::getInstance(); CCDBNodeLeaf *statusNode = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d", i) + ":STATUS", false); if (statusNode && ANIMAL_STATUS::isInStable((ANIMAL_STATUS::EAnimalStatus)statusNode->getValue32()) ) { @@ -1372,11 +1375,6 @@ void CGroupMap::checkCoords() case ANIMAL_TYPE::Demon: sPrefix = "uiPATitleDemon"; break; } _AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(sPrefix+toString(i+1))); - - // update pos - sint32 px, py; - _AnimalPosStates[i]->getPos(px, py); - updateLMPosFromDBPos(_AnimalLM[i], px, py); } } } From 67b74ad2b74b808ac4ba53bbd44bcbca0d0415d6 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 30 Mar 2020 10:11:17 +0300 Subject: [PATCH 10/25] Added: Ingame config options for window snap. --- ryzom/client/client_default.cfg | 3 +++ ryzom/client/src/main_loop_utilities.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ryzom/client/client_default.cfg b/ryzom/client/client_default.cfg index 7d134ad01..f18cd06a2 100644 --- a/ryzom/client/client_default.cfg +++ b/ryzom/client/client_default.cfg @@ -338,6 +338,9 @@ R2EDMaxMapScale = 8.0; WindowSnapInvert = 0; WindowSnapDistance = 10; +WindowSnapDistance_min = 0; +WindowSnapDistance_max = 50; +WindowSnapDistance_step = 1; ////////////////// // SOUND CONFIG // diff --git a/ryzom/client/src/main_loop_utilities.cpp b/ryzom/client/src/main_loop_utilities.cpp index 4243e15b0..4a4b2bc38 100644 --- a/ryzom/client/src/main_loop_utilities.cpp +++ b/ryzom/client/src/main_loop_utilities.cpp @@ -110,6 +110,9 @@ void updateFromClientCfg() if (ClientCfg.BilinearUI != LastClientCfg.BilinearUI) CViewRenderer::getInstance()->setBilinearFiltering(ClientCfg.BilinearUI); + CWidgetManager::getInstance()->setWindowSnapInvert(ClientCfg.WindowSnapInvert); + CWidgetManager::getInstance()->setWindowSnapDistance(ClientCfg.WindowSnapDistance); + //--------------------------------------------------- if (ClientCfg.WaitVBL != LastClientCfg.WaitVBL) { From e020c9f0d0e0049958e60d7a3a01550742be943f Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 31 Mar 2020 14:33:31 +0800 Subject: [PATCH 11/25] Avoid bad memory access in LOD texture failure case, ref ryzom/ryzomcore_graphics#22 --- nel/src/3d/lod_character_manager.cpp | 3 +++ nel/tools/3d/build_clodtex/lod_texture_builder.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nel/src/3d/lod_character_manager.cpp b/nel/src/3d/lod_character_manager.cpp index 92dee846a..f5d6a23c5 100644 --- a/nel/src/3d/lod_character_manager.cpp +++ b/nel/src/3d/lod_character_manager.cpp @@ -979,6 +979,9 @@ void CLodCharacterManager::addTextureCompute(CLodCharacterInstance &instance, // get lookup ptr. nlassert(lodTexture.Texture.size()==NL3D_CLOD_TEXT_SIZE); + if (lodTexture.Texture.size() < NL3D_CLOD_TEXT_SIZE) + return; + const CLodCharacterTexture::CTUVQ *lookUpPtr= &lodTexture.Texture[0]; // apply the lodTexture, taking only better quality (ie nearer 0) diff --git a/nel/tools/3d/build_clodtex/lod_texture_builder.cpp b/nel/tools/3d/build_clodtex/lod_texture_builder.cpp index d7ca00e9f..b0ff316df 100644 --- a/nel/tools/3d/build_clodtex/lod_texture_builder.cpp +++ b/nel/tools/3d/build_clodtex/lod_texture_builder.cpp @@ -135,6 +135,9 @@ bool CLodTextureBuilder::computeTexture(const CMeshMRM &meshMRM, NL3D::CLodCha const uint8 *srcPos= (const uint8*)vba.getVertexCoordPointer(); const uint8 *srcNormal= (const uint8*)vba.getNormalCoordPointer(); const uint8 *srcUV= (const uint8*)vba.getTexCoordPointer(); + nlassert(srcPos); + nlassert(srcNormal); + nlassert(srcUV); uint vertexSize = VB.getVertexSize(); // For the more precise lod uint lodId= meshMRM.getNbLod()-1; From 75777b34971fff17666a0d60e3c7ee71e73d57b3 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Apr 2020 10:09:47 +0800 Subject: [PATCH 12/25] Fix R2 input handling. Probably broken by GUI refactoring. Fix kaetemi/ryzomclassic#81 --- .../interface_v3/input_handler_manager.cpp | 103 +++++++++++++++--- .../src/interface_v3/input_handler_manager.h | 2 +- 2 files changed, 86 insertions(+), 19 deletions(-) diff --git a/ryzom/client/src/interface_v3/input_handler_manager.cpp b/ryzom/client/src/interface_v3/input_handler_manager.cpp index 9d1e9292d..67a1b2350 100644 --- a/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -271,16 +271,16 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) { - CViewPointer &rIP = *static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); + CViewPointer &rIP = *static_cast(CWidgetManager::getInstance()->getPointer()); NLGUI::CEventDescriptorMouse eventDesc; - sint32 x,y; - rIP.getPointerDispPos (x, y); - eventDesc.setX (x); - eventDesc.setY (y); + sint32 x, y; + rIP.getPointerDispPos(x, y); + eventDesc.setX(x); + eventDesc.setY(y); - bool handled= false; + bool handled = false; // button down ? static volatile bool doTest = false; @@ -291,7 +291,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) { if (_RecoverFocusLost) { - handled |= updateMousePos((CEventMouse&)event, eventDesc); // must update mouse pos here, + handled |= updateMousePos((CEventMouse&)event); // must update mouse pos here, // because when app window focus is gained by a mouse click, this is // the only place where we can retrieve mouse pos before a mouse move _RecoverFocusLost = false; @@ -299,10 +299,19 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) if (!handled) { if (R2::getEditor().isInitialized() - && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool()) - ) + && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool())) { - handled |= R2::getEditor().handleEvent(eventDesc); + const NLMISC::CEventMouseDown *mouseDownEvent = static_cast(&event); + if (mouseDownEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseDownEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } } } handled |= inputHandler.handleMouseButtonDownEvent( event ); @@ -321,7 +330,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) // mouse move? else if(event == EventMouseMoveId) { - handled |= updateMousePos((CEventMouse&)event, eventDesc); + handled |= updateMousePos((CEventMouse&)event); } else if (event == EventMouseWheelId) { @@ -330,19 +339,77 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) } // if Event not handled, post to Action Manager - if( !handled ) + if (!handled) { - bool handled = false; if (R2::getEditor().isInitialized() - && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool()) - ) + && (R2::isEditionCurrent() || R2::getEditor().getCurrentTool())) { - handled = R2::getEditor().handleEvent(eventDesc); + if (event == EventMouseDownId) + { + const NLMISC::CEventMouseDown *mouseDownEvent = static_cast(&event); + if (mouseDownEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseDownEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdown); + handled |= R2::getEditor().handleEvent(eventDesc); + } + } + else if (event == EventMouseUpId) + { + const NLMISC::CEventMouseUp *mouseUpEvent = static_cast(&event); + if (mouseUpEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftup); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseUpEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightup); + handled |= R2::getEditor().handleEvent(eventDesc); + } + } + else if (event == EventMouseDblClkId) + { + const NLMISC::CEventMouseDblClk *mouseDblClkEvent = static_cast(&event); + if (mouseDblClkEvent->Button & NLMISC::leftButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouseleftdblclk); + handled |= R2::getEditor().handleEvent(eventDesc); + } + if (mouseDblClkEvent->Button & NLMISC::rightButton) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mouserightdblclk); + handled |= R2::getEditor().handleEvent(eventDesc); + } + } + else + { + if (event == EventMouseWheelId) + { + const NLMISC::CEventMouseWheel *wheelEvent = static_cast(&event); + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousewheel); + eventDesc.setWheel(wheelEvent->Direction ? 1 : -1); + handled = R2::getEditor().handleEvent(eventDesc); + } + else if (event == EventMouseMoveId) + { + eventDesc.setEventTypeExtended(CEventDescriptorMouse::mousemove); + handled = R2::getEditor().handleEvent(eventDesc); + } + else + { + nlwarning("R2 unknown mouse event '%s'", event.toString().c_str()); + } + } } if (!handled) { // post to Action Manager - FilteredEventServer.postEvent( event.clone() ); + FilteredEventServer.postEvent(event.clone()); } } } @@ -355,7 +422,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) // *************************************************************************** -bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc) +bool CInputHandlerManager::updateMousePos(NLMISC::CEventMouse &event) { if (!IsMouseFreeLook()) return inputHandler.handleMouseMoveEvent( event ); diff --git a/ryzom/client/src/interface_v3/input_handler_manager.h b/ryzom/client/src/interface_v3/input_handler_manager.h index 7971ef9a8..4b078ee84 100644 --- a/ryzom/client/src/interface_v3/input_handler_manager.h +++ b/ryzom/client/src/interface_v3/input_handler_manager.h @@ -181,7 +181,7 @@ private: void parseKey(xmlNodePtr cur, std::vector &out); // return true if handled - bool updateMousePos(NLMISC::CEventMouse &event, NLGUI::CEventDescriptorMouse &eventDesc); + bool updateMousePos(NLMISC::CEventMouse &event); NLGUI::CInputHandler inputHandler; From bcac1e7955584165760da0ed8d62f8a076a2bbcb Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Apr 2020 12:46:21 +0800 Subject: [PATCH 13/25] Fix silently lost nlassert, ryzom/ryzomcore#596 --- nel/include/nel/misc/debug.h | 8 +++++++- nel/src/misc/co_task.cpp | 4 ++++ nel/src/misc/debug.cpp | 9 +++++++++ nel/src/misc/win_thread.cpp | 3 +++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/nel/include/nel/misc/debug.h b/nel/include/nel/misc/debug.h index a8c23eced..1d533c149 100644 --- a/nel/include/nel/misc/debug.h +++ b/nel/include/nel/misc/debug.h @@ -89,6 +89,9 @@ void createDebug (const char *logPath = NULL, bool logInFile = true, bool eraseL /// Do not call this, unless you know what you're trying to do (it kills debug)! void destroyDebug(); +/// Attach exception handler, for new threads and fibers +void attachExceptionHandler(); + // call this if you want to change the dir of the log.log file void changeLogDirectory(const std::string &dir); @@ -352,7 +355,7 @@ void setCrashAlreadyReported(bool state); * Same as nlassertex(false,exp); */ -// removed because we always check assert (even in release mode) #if defined (NL_OS_WINDOWS) && defined (NL_DEBUG) +#if defined(NL_DEBUG) /* Debug break is only useful in debug builds */ #if defined(NL_OS_WINDOWS) #define NLMISC_BREAKPOINT __debugbreak() #elif defined(NL_OS_UNIX) && defined(NL_COMP_GCC) @@ -360,6 +363,9 @@ void setCrashAlreadyReported(bool state); #else #define NLMISC_BREAKPOINT abort() #endif +#else +#define NLMISC_BREAKPOINT do { } while (0) +#endif // Internal, don't use it (make smaller assert code) extern bool _assert_stop(bool &ignoreNextTime, sint line, const char *file, const char *funcName, const char *exp); diff --git a/nel/src/misc/co_task.cpp b/nel/src/misc/co_task.cpp index 524cc69c6..4548fbe86 100644 --- a/nel/src/misc/co_task.cpp +++ b/nel/src/misc/co_task.cpp @@ -143,6 +143,9 @@ namespace NLMISC NL_CT_DEBUG("CoTask : task %p start func called", task); + // Attach exception handler + attachExceptionHandler(); + try { // run the task @@ -151,6 +154,7 @@ namespace NLMISC catch(...) { nlwarning("CCoTask::startFunc : the task has generated an unhandled exeption and will terminate"); + NLMISC_BREAKPOINT; } task->_Finished = true; diff --git a/nel/src/misc/debug.cpp b/nel/src/misc/debug.cpp index cc3203a14..1f7cf38db 100644 --- a/nel/src/misc/debug.cpp +++ b/nel/src/misc/debug.cpp @@ -1157,6 +1157,15 @@ void destroyDebug() } } +void attachExceptionHandler() +{ +#ifndef NL_COMP_MINGW +# ifdef NL_OS_WINDOWS + _set_se_translator(exceptionTranslator); +# endif // NL_OS_WINDOWS +#endif //!NL_COMP_MINGW +} + void createDebug (const char *logPath, bool logInFile, bool eraseLastLog) { // Do some basic compiler time check on type size diff --git a/nel/src/misc/win_thread.cpp b/nel/src/misc/win_thread.cpp index a75b2165f..0de191d55 100644 --- a/nel/src/misc/win_thread.cpp +++ b/nel/src/misc/win_thread.cpp @@ -67,6 +67,9 @@ static unsigned long __stdcall ProxyFunc (void *arg) // Set the thread pointer in TLS memory nlverify (TlsSetValue (TLSThreadPointer, (void*)parent) != 0); + // Attach exception handler + attachExceptionHandler(); + // Run the thread parent->Runnable->run(); From 83210ce17bff7a3fe80d585f4bdf968a036e21cc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Apr 2020 14:11:50 +0800 Subject: [PATCH 14/25] Fix stuck loading screen when quitting scenario, fix kaetemi/ryzomclassic#83 --- .../src/interface_v3/inventory_manager.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ryzom/client/src/interface_v3/inventory_manager.cpp b/ryzom/client/src/interface_v3/inventory_manager.cpp index 816f676e2..0bb20c844 100644 --- a/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -3648,13 +3648,23 @@ void CInventoryManager::onTradeChangeSession() // *************************************************************************** void CInventoryManager::updateItemInfoQueue() { + if (!ConnectionReadySent) // CONNECTION:READY not yet sent, so we cannot send requests yet! + { + // Caused by CNetworkConnection::reinit, and NLMISC::CCDBNodeBranch::resetData + // TODO: Item sheets are effectively being set to 0, any way to detect this in particular? + // Slots with sheet 0 won't have any info to request anyway! + // Remove this check in favour of the assert lower down when properly implemented. + nlwarning("Update item info queue (%i), but connection not ready", (int)_ItemInfoWaiters.size()); + return; + } + + // CONNECTION:READY not yet sent, so we cannot send requests yet! + nlassert(ConnectionReadySent || !_ItemInfoWaiters.size()); + // For All waiters, look if one need update. TItemInfoWaiters::iterator it; for(it= _ItemInfoWaiters.begin();it!=_ItemInfoWaiters.end();it++) { - /* \todo yoyo remove: temp patch to be sure that the client does not send messages before the - CONNECTION:READY is sent - */ nlassert(ConnectionReadySent); IItemInfoWaiter *waiter=*it; From 87cd9f19a4a4e76e5a57ec1d879a90e3cc2c8d25 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 1 Apr 2020 14:38:11 +0800 Subject: [PATCH 15/25] Remove duplicate assert --- ryzom/client/src/interface_v3/inventory_manager.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ryzom/client/src/interface_v3/inventory_manager.cpp b/ryzom/client/src/interface_v3/inventory_manager.cpp index 0bb20c844..f84e38234 100644 --- a/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -3665,8 +3665,6 @@ void CInventoryManager::updateItemInfoQueue() TItemInfoWaiters::iterator it; for(it= _ItemInfoWaiters.begin();it!=_ItemInfoWaiters.end();it++) { - nlassert(ConnectionReadySent); - IItemInfoWaiter *waiter=*it; uint itemSlotId= waiter->ItemSlotId; TItemInfoMap::iterator it= _ItemInfoMap.find(itemSlotId); From 1ab44cf123e0828ec294a8d2a696f547fe8b1e74 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 31 Mar 2020 17:37:48 +0300 Subject: [PATCH 16/25] Fixed: mp3 player keeps playing after clearing files from playlist --- ryzom/client/src/interface_v3/music_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index f4d8b7db9..717ea7e66 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -85,7 +85,7 @@ void CMusicPlayer::playSongs (const std::vector &songs) rebuildPlaylist(); // If pause, stop, else play will resume - if (_State == Paused) + if (_State == Paused || _Songs.empty()) _State = Stopped; } From 505283a17cb40e862746c6e04a1e3a66e89211bc Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 1 Apr 2020 17:23:09 +0300 Subject: [PATCH 17/25] Changed: Use worker thread to gather song title/duration. --- .../client/src/interface_v3/music_player.cpp | 244 +++++++++++++++--- ryzom/client/src/interface_v3/music_player.h | 17 +- 2 files changed, 226 insertions(+), 35 deletions(-) diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index 717ea7e66..10b4cd288 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -28,6 +28,9 @@ #include "interface_manager.h" #include "../client_cfg.h" +#include "nel/misc/thread.h" +#include "nel/misc/mutex.h" + using namespace std; using namespace NLMISC; using namespace NL3D; @@ -48,6 +51,88 @@ extern UDriver *Driver; #define MP3_SAVE_REPEAT "UI:SAVE:MP3_REPEAT" CMusicPlayer MusicPlayer; +static NLMISC::CUnfairMutex MusicPlayerMutex; + +// *************************************************************************** +class CMusicPlayerWorker : public NLMISC::IRunnable +{ +private: + bool _Running; + IThread *_Thread; + + std::vector _Files; + +public: + CMusicPlayerWorker(): _Running(false), _Thread(NULL) + { + } + + ~CMusicPlayerWorker() + { + _Running = false; + if (_Thread) + { + _Thread->terminate(); + delete _Thread; + _Thread = NULL; + } + } + + bool isRunning() const { return _Running; } + + void run() + { + _Running = true; + + uint i = 0; + while(_Running && SoundMngr && i < _Files.size()) + { + // get copy incase _Files changes + std::string filename(_Files[i]); + + std::string title; + float length; + + if (SoundMngr->getMixer()->getSongTitle(filename, title, length)) + { + MusicPlayer.updateSong(filename, title, length); + } + + ++i; + } + + _Running = false; + _Files.clear(); + } + + // called from GUI + void getSongsInfo(const std::vector &filenames) + { + if (_Thread) + { + stopThread(); + } + + _Files = filenames; + + _Thread = IThread::create(this); + nlassert(_Thread != NULL); + _Thread->start(); + } + + void stopThread() + { + _Running = false; + if (_Thread) + { + _Thread->wait(); + delete _Thread; + _Thread = NULL; + } + } +}; + +static CMusicPlayerWorker MusicPlayerWorker; // *************************************************************************** @@ -69,11 +154,14 @@ bool CMusicPlayer::isShuffleEnabled() const return (NLGUI::CDBManager::getInstance()->getDbProp(MP3_SAVE_SHUFFLE)->getValue32() == 1); } - // *************************************************************************** -void CMusicPlayer::playSongs (const std::vector &songs) +void CMusicPlayer::playSongs (const std::vector &filenames) { - _Songs = songs; + _Songs.clear(); + for (uint i=0; i _Songs.size()) @@ -87,6 +175,9 @@ void CMusicPlayer::playSongs (const std::vector &songs) // If pause, stop, else play will resume if (_State == Paused || _Songs.empty()) _State = Stopped; + + // get song title/duration using worker thread + MusicPlayerWorker.getSongsInfo(filenames); } // *************************************************************************** @@ -107,6 +198,88 @@ void CMusicPlayer::updatePlaylist(sint prevIndex) if (pIE) pIE->setActive(true); } +// *************************************************************************** +// called from worker thread +void CMusicPlayer::updateSong(const std::string filename, const std::string title, float length) +{ + CAutoMutex mutex(MusicPlayerMutex); + + _SongUpdateQueue.push_back(CSongs(filename, title, length)); +} + +// *************************************************************************** +// called from GUI +void CMusicPlayer::updateSongs() +{ + CAutoMutex mutex(MusicPlayerMutex); + if (!_SongUpdateQueue.empty()) + { + for(uint i = 0; i < _SongUpdateQueue.size(); ++i) + { + updateSong(_SongUpdateQueue[i]); + } + _SongUpdateQueue.clear(); + } +} + +// *************************************************************************** +void CMusicPlayer::updateSong(const CSongs &song) +{ + uint index = 0; + while(index < _Songs.size()) + { + if (_Songs[index].Filename == song.Filename) + { + _Songs[index].Title = song.Title; + _Songs[index].Length = song.Length; + break; + } + + ++index; + } + if (index == _Songs.size()) + { + nlwarning("Unknown song file '%s'", song.Filename.c_str()); + return; + } + + std::string rowId(toString("%s:s%d", MP3_PLAYER_PLAYLIST_LIST, index)); + CInterfaceGroup *pIG = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(rowId)); + if (!pIG) + { + nlwarning("Playlist row '%s' not found", rowId.c_str()); + return; + } + + CViewText *pVT; + pVT = dynamic_cast(pIG->getView(TEMPLATE_PLAYLIST_SONG_TITLE)); + if (pVT) + { + pVT->setHardText(song.Title); + } + else + { + nlwarning("title element '%s' not found", TEMPLATE_PLAYLIST_SONG_TITLE); + } + + pVT = dynamic_cast(pIG->getView(TEMPLATE_PLAYLIST_SONG_DURATION)); + if (pVT) + { + uint min = (sint32)(song.Length / 60) % 60; + uint sec = (sint32)(song.Length) % 60; + uint hour = song.Length / 3600; + std::string duration(toString("%02d:%02d", min, sec)); + if (hour > 0) + duration = toString("%02d:", hour) + duration; + + pVT->setHardText(duration); + } + else + { + nlwarning("duration element '%s' not found", TEMPLATE_PLAYLIST_SONG_DURATION); + } +} + // *************************************************************************** void CMusicPlayer::shuffleAndRebuildPlaylist() { @@ -131,12 +304,16 @@ void CMusicPlayer::rebuildPlaylist() _CurrentSongIndex = i; } - uint min = (sint32)(_Songs[i].Length / 60) % 60; - uint sec = (sint32)(_Songs[i].Length) % 60; - uint hour = _Songs[i].Length / 3600; - std::string duration(toString("%02d:%02d", min, sec)); - if (hour > 0) - duration = toString("%02d:", hour) + duration; + std::string duration("--:--"); + if (_Songs[i].Length > 0) + { + uint min = (sint32)(_Songs[i].Length / 60) % 60; + uint sec = (sint32)(_Songs[i].Length) % 60; + uint hour = _Songs[i].Length / 3600; + duration = toString("%02d:%02d", min, sec); + if (hour > 0) + duration = toString("%02d:", hour) + duration; + } vector< pair > vParams; vParams.push_back(pair("id", "s" + toString(i))); @@ -289,6 +466,12 @@ void CMusicPlayer::update () { if(!SoundMngr) return; + + if (MusicPlayerWorker.isRunning() || !_SongUpdateQueue.empty()) + { + updateSongs(); + } + if (_State == Playing) { CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:mp3_player:screen:text")); @@ -331,7 +514,7 @@ void CMusicPlayer::update () } // *************************************************************************** -static void addFromPlaylist(const std::string &playlist, std::vector &filenames) +static void addFromPlaylist(const std::string &playlist, const std::vector &extensions, std::vector &filenames) { static uint8 utf8Header[] = { 0xefu, 0xbbu, 0xbfu }; @@ -362,9 +545,19 @@ static void addFromPlaylist(const std::string &playlist, std::vector songs; - for (i=0; igetMixer()->getSongTitle(filenames[i], song.Title, song.Length); - if (song.Length > 0) - songs.push_back (song); - } + // Sort songs by filename + sort(filenames.begin(), filenames.end()); - MusicPlayer.playSongs(songs); + MusicPlayer.playSongs(filenames); } else if (Params == "update_playlist") { diff --git a/ryzom/client/src/interface_v3/music_player.h b/ryzom/client/src/interface_v3/music_player.h index 549fa169d..3569d6439 100644 --- a/ryzom/client/src/interface_v3/music_player.h +++ b/ryzom/client/src/interface_v3/music_player.h @@ -42,12 +42,16 @@ public: class CSongs { public: + CSongs(std::string file = std::string(), std::string title = std::string(), float length = 0.f) + : Filename(file), Title(title), Length(length) + { } + std::string Filename; std::string Title; float Length; }; - void playSongs (const std::vector &songs); + void playSongs (const std::vector &filenames); void play (sint index = -1); // Play the song at current position, if playing, restart. If paused, resume. void pause (); void stop (); @@ -68,12 +72,23 @@ public: // Update playlist active row void updatePlaylist(sint prevIndex = -1); + // Update single song title/duration on _Songs and on playlist + void updateSong(const CSongs &song); + + // Update _Songs and playlist from _SongUpdateQueue + void updateSongs(); + + // update song from worker thread + void updateSong(const std::string filename, const std::string title, float length); + private: // The playlist CSongs _CurrentSong; uint _CurrentSongIndex; // If (!_Songs.empty()) must always be <_Songs.size() std::vector _Songs; + // updated info from worker thread + std::vector _SongUpdateQueue; // State enum TState { Stopped, Playing, Paused } _State; From 2a2431b1d319ca2ea1ea195d2d7847109ba41318 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 2 Apr 2020 11:10:51 +0300 Subject: [PATCH 18/25] Changed: Automatically build playlist on play if needed --- .../client/src/interface_v3/music_player.cpp | 125 ++++++++++-------- ryzom/client/src/interface_v3/music_player.h | 3 + 2 files changed, 75 insertions(+), 53 deletions(-) diff --git a/ryzom/client/src/interface_v3/music_player.cpp b/ryzom/client/src/interface_v3/music_player.cpp index 10b4cd288..2f02352fb 100644 --- a/ryzom/client/src/interface_v3/music_player.cpp +++ b/ryzom/client/src/interface_v3/music_player.cpp @@ -353,6 +353,17 @@ void CMusicPlayer::play (sint index) if(!SoundMngr) return; + if (_Songs.empty()) + { + index = 0; + createPlaylistFromMusic(); + } + + if (_Songs.empty()) + { + _State = Stopped; + return; + } sint prevSongIndex = _CurrentSongIndex; @@ -465,7 +476,10 @@ void CMusicPlayer::next () void CMusicPlayer::update () { if(!SoundMngr) + { + _State = Stopped; return; + } if (MusicPlayerWorker.isRunning() || !_SongUpdateQueue.empty()) { @@ -564,6 +578,63 @@ static void addFromPlaylist(const std::string &playlist, const std::vector extensions; + SoundMngr->getMixer()->getMusicExtensions(extensions); + + // no format supported + if (extensions.empty()) + { + // in the very unlikely scenario + const ucstring message("Sound driver has no support for music."); + CInterfaceManager::getInstance()->displaySystemInfo(message, "SYS"); + nlinfo("%s", message.toUtf8().c_str()); + return; + } + std::string newPath = CPath::makePathAbsolute(CPath::standardizePath(ClientCfg.MediaPlayerDirectory), CPath::getCurrentPath(), true); + std::string extlist; + join(extensions, ", ", extlist); + extlist += ", m3u, m3u8"; + + std::string msg(CI18N::get("uiMk_system6").toUtf8()); + msg += ": " + newPath + " (" + extlist + ")"; + CInterfaceManager::getInstance()->displaySystemInfo(ucstring::makeFromUtf8(msg), "SYS"); + nlinfo("%s", msg.c_str()); + + // Recursive scan for files from media directory + vector filesToProcess; + CPath::getPathContent (newPath, true, false, true, filesToProcess); + + uint i; + std::vector filenames; + std::vector playlists; + + for (i = 0; i < filesToProcess.size(); ++i) + { + std::string ext = toLower(CFile::getExtension(filesToProcess[i])); + if (std::find(extensions.begin(), extensions.end(), ext) != extensions.end()) + { + filenames.push_back(filesToProcess[i]); + } + else if (ext == "m3u" || ext == "m3u8") + { + playlists.push_back(filesToProcess[i]); + } + } + + // Add songs from playlists + for (i = 0; i < playlists.size(); ++i) + { + addFromPlaylist(playlists[i], extensions, filenames); + } + + // Sort songs by filename + sort(filenames.begin(), filenames.end()); + + playSongs(filenames); +} + // *************************************************************************** class CMusicPlayerPlaySongs: public IActionHandler { @@ -581,59 +652,7 @@ public: if (Params == "play_songs") { - std::vector extensions; - SoundMngr->getMixer()->getMusicExtensions(extensions); - - // no format supported - if (extensions.empty()) - { - // in the very unlikely scenario - const ucstring message("Sound driver has no support for music."); - CInterfaceManager::getInstance()->displaySystemInfo(message, "SYS"); - nlinfo("%s", message.toUtf8().c_str()); - return; - } - std::string newPath = CPath::makePathAbsolute(CPath::standardizePath(ClientCfg.MediaPlayerDirectory), CPath::getCurrentPath(), true); - std::string extlist; - join(extensions, ", ", extlist); - extlist += ", m3u, m3u8"; - - std::string msg(CI18N::get("uiMk_system6").toUtf8()); - msg += ": " + newPath + " (" + extlist + ")"; - CInterfaceManager::getInstance()->displaySystemInfo(ucstring::makeFromUtf8(msg), "SYS"); - nlinfo("%s", msg.c_str()); - - // Recursive scan for files from media directory - vector filesToProcess; - CPath::getPathContent (newPath, true, false, true, filesToProcess); - - uint i; - std::vector filenames; - std::vector playlists; - - for (i = 0; i < filesToProcess.size(); ++i) - { - std::string ext = toLower(CFile::getExtension(filesToProcess[i])); - if (std::find(extensions.begin(), extensions.end(), ext) != extensions.end()) - { - filenames.push_back(filesToProcess[i]); - } - else if (ext == "m3u" || ext == "m3u8") - { - playlists.push_back(filesToProcess[i]); - } - } - - // Add songs from playlists - for (i = 0; i < playlists.size(); ++i) - { - addFromPlaylist(playlists[i], extensions, filenames); - } - - // Sort songs by filename - sort(filenames.begin(), filenames.end()); - - MusicPlayer.playSongs(filenames); + MusicPlayer.createPlaylistFromMusic(); } else if (Params == "update_playlist") { diff --git a/ryzom/client/src/interface_v3/music_player.h b/ryzom/client/src/interface_v3/music_player.h index 3569d6439..1932591e3 100644 --- a/ryzom/client/src/interface_v3/music_player.h +++ b/ryzom/client/src/interface_v3/music_player.h @@ -81,6 +81,9 @@ public: // update song from worker thread void updateSong(const std::string filename, const std::string title, float length); + // scan music folder and rebuild playlist + void createPlaylistFromMusic(); + private: // The playlist From 0f5dbc318c4bff55c9d25cd4f6c411bb43ac292e Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 3 Apr 2020 12:12:40 +0300 Subject: [PATCH 19/25] Fixed: Clear scene background if sky filter is used --- ryzom/client/src/main_loop.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ryzom/client/src/main_loop.cpp b/ryzom/client/src/main_loop.cpp index a3f6f3059..760a551c2 100644 --- a/ryzom/client/src/main_loop.cpp +++ b/ryzom/client/src/main_loop.cpp @@ -556,11 +556,11 @@ void clearBuffers() } // Sky is used to clear the frame buffer now, but if in line or point polygon mode, we should draw it - if (Driver->getPolygonMode() != UDriver::Filled) + if (Driver->getPolygonMode() != UDriver::Filled || !Filter3D[FilterSky]) { if (!Driver->isLost()) { - Driver->clearBuffers (CRGBA(127, 127, 127)); + Driver->clearBuffers (ClientCfg.BGColor); } } } From 900ec1a69ae4dd7dd721aaa6f5896c6141850818 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 9 Apr 2020 12:17:17 +0800 Subject: [PATCH 20/25] Play theme music during login. Fix music when returning to character selection. Fix teleport screen and music selection. --- nel/include/nel/sound/music_channel_fader.h | 2 +- nel/src/sound/music_channel_fader.cpp | 12 +- ryzom/client/src/client_cfg.cpp | 14 +- ryzom/client/src/client_cfg.h | 9 +- ryzom/client/src/connection.cpp | 139 +++++++++++--------- ryzom/client/src/far_tp.cpp | 24 ++-- ryzom/client/src/init.cpp | 85 +++++------- ryzom/client/src/init_main_loop.cpp | 21 +++ ryzom/client/src/login.cpp | 2 + ryzom/client/src/main_loop.cpp | 16 ++- ryzom/client/src/net_manager.cpp | 39 +++--- ryzom/client/src/user_entity.cpp | 11 +- 12 files changed, 214 insertions(+), 160 deletions(-) diff --git a/nel/include/nel/sound/music_channel_fader.h b/nel/include/nel/sound/music_channel_fader.h index 6bb5677f9..577d23949 100644 --- a/nel/include/nel/sound/music_channel_fader.h +++ b/nel/include/nel/sound/music_channel_fader.h @@ -108,7 +108,7 @@ public: bool play(const std::string &filepath, uint xFadeTime = 0, bool async = true, bool loop = true); /// Stop the music previously loaded and played (the Memory is also freed) - void stop(uint xFadeTime = 0); + bool stop(uint xFadeTime = 0); /// Pause the music previously loaded and played (the Memory is not freed) void pause(); diff --git a/nel/src/sound/music_channel_fader.cpp b/nel/src/sound/music_channel_fader.cpp index ea2cc6341..70ab890d2 100644 --- a/nel/src/sound/music_channel_fader.cpp +++ b/nel/src/sound/music_channel_fader.cpp @@ -147,7 +147,7 @@ void CMusicChannelFader::updateVolume() */ bool CMusicChannelFader::play(const std::string &filepath, uint xFadeTime, bool async, bool loop) { - stop(xFadeTime); + bool stopped = stop(xFadeTime); // Find the next best free music channel uint nextFader = _MaxMusicFader; @@ -164,7 +164,7 @@ bool CMusicChannelFader::play(const std::string &filepath, uint xFadeTime, bool // Play a song in it :) _CMusicFader &fader = _MusicFader[_ActiveMusicFader]; - if (xFadeTime) fader.fadeIn(xFadeTime); + if (xFadeTime && !stopped) fader.fadeIn(xFadeTime); // only fade in when fading out else fader.XFadeVolume = 1.0f; fader.Playing = true; updateVolume(); // make sure at ok volume to start :) @@ -173,12 +173,17 @@ bool CMusicChannelFader::play(const std::string &filepath, uint xFadeTime, bool } /// Stop the music previously loaded and played (the Memory is also freed) -void CMusicChannelFader::stop(uint xFadeTime) +bool CMusicChannelFader::stop(uint xFadeTime) { if (xFadeTime) { + bool stopped = true; for (uint i = 0; i < _MaxMusicFader; ++i) if (_MusicFader[i].Playing) + { _MusicFader[i].fadeOut(xFadeTime); + stopped = false; // fading + } + return stopped; } else { @@ -188,6 +193,7 @@ void CMusicChannelFader::stop(uint xFadeTime) _MusicFader[i].Fade = false; _MusicFader[i].Playing = false; } + return true; } } diff --git a/ryzom/client/src/client_cfg.cpp b/ryzom/client/src/client_cfg.cpp index 985f052db..7588f6b57 100644 --- a/ryzom/client/src/client_cfg.cpp +++ b/ryzom/client/src/client_cfg.cpp @@ -465,7 +465,12 @@ CClientConfig::CClientConfig() SoundOn = true; // Default is with sound. DriverSound = SoundDrvAuto; SoundForceSoftwareBuffer = true; - SoundOutGameMusic = "main menu loop.ogg"; + StartMusic = "main theme air.ogg"; // Use at game startup + LoadingMusic = "main menu loop.ogg"; // Use after leaving character selection, and when going back to character selection + KamiTeleportMusic = "kami teleport.ogg"; // Kami teleport + KaravanTeleportMusic = "karavan teleport.ogg"; // Karavan teleport + TeleportLoadingMusic = "loading music loop.ogg"; // Use after character select, and for generic teleportations + DeathMusic = "death.ogg"; // Player death SoundSFXVolume = 1.f; SoundGameMusicVolume = 1.f; SoundTPFade = 500; @@ -1247,7 +1252,12 @@ void CClientConfig::setValues() // SoundForceSoftwareBuffer READ_BOOL_FV(SoundForceSoftwareBuffer); // SoundOutGameMusic - READ_STRING_DEV(SoundOutGameMusic) + READ_STRING_DEV(StartMusic) + READ_STRING_DEV(LoadingMusic) + READ_STRING_DEV(KamiTeleportMusic) + READ_STRING_DEV(KaravanTeleportMusic) + READ_STRING_DEV(TeleportLoadingMusic) + READ_STRING_DEV(DeathMusic) // SoundSFXVolume READ_FLOAT_FV(SoundSFXVolume); // SoundGameMusicVolume diff --git a/ryzom/client/src/client_cfg.h b/ryzom/client/src/client_cfg.h index a5eff6883..716972c3a 100644 --- a/ryzom/client/src/client_cfg.h +++ b/ryzom/client/src/client_cfg.h @@ -348,8 +348,13 @@ struct CClientConfig /// SoundForceSoftwareBuffer bool SoundForceSoftwareBuffer; - /// The outgame music file - string SoundOutGameMusic; + /// Music files + string StartMusic; + string LoadingMusic; + string KamiTeleportMusic; + string KaravanTeleportMusic; + string TeleportLoadingMusic; + string DeathMusic; /// The Sound SFX Volume (0-1) (ie all but music) float SoundSFXVolume; diff --git a/ryzom/client/src/connection.cpp b/ryzom/client/src/connection.cpp index b53c571e6..9c9dce6da 100644 --- a/ryzom/client/src/connection.cpp +++ b/ryzom/client/src/connection.cpp @@ -273,6 +273,73 @@ void setOutGameFullScreen() CViewRenderer::getInstance()->setInterfaceScale(1.0f, 1024, 768); } +// ------------------------------------------------------------------------------------------------ +class CSoundGlobalMenu +{ +public: + CSoundGlobalMenu() + { + _MusicWantedAsync= false; + _NbFrameBeforeChange= NbFrameBeforeChangeMax; + } + void reset(); + void setMusic(const string &music, bool async); + void updateSound(); +private: + string _MusicPlayed; + string _MusicWanted; + bool _MusicWantedAsync; + sint _NbFrameBeforeChange; + enum {NbFrameBeforeChangeMax= 10}; +}; + +void CSoundGlobalMenu::reset() +{ + _MusicPlayed.clear(); + _MusicWanted.clear(); +} + +void CSoundGlobalMenu::updateSound() +{ + // **** update the music played + // The first music played is the music played at loading, before select char + if (_MusicPlayed.empty()) + _MusicPlayed = toLower(LoadingMusic.empty() ? ClientCfg.StartMusic : LoadingMusic); + if (_MusicWanted.empty()) + _MusicWanted = toLower(LoadingMusic.empty() ? ClientCfg.StartMusic : LoadingMusic); + + // because music is changed when the player select other race for instance, + // wait the 3D to load (stall some secs) + + // if the wanted music is the same as the one currently playing, just continue playing + if(_MusicPlayed!=_MusicWanted) + { + // wait nbFrameBeforeChangeMax before actually changing the music + _NbFrameBeforeChange--; + if(_NbFrameBeforeChange<=0) + { + _MusicPlayed= _MusicWanted; + // play the music + if (SoundMngr != NULL) + SoundMngr->playMusic(_MusicPlayed, 500, _MusicWantedAsync, true, true); + } + } + + + // **** update mngr + if (SoundMngr != NULL) + SoundMngr->update(); +} + +void CSoundGlobalMenu::setMusic(const string &music, bool async) +{ + _MusicWanted= toLower(music); + _MusicWantedAsync= async; + // reset the counter + _NbFrameBeforeChange= NbFrameBeforeChangeMax; +} +static CSoundGlobalMenu SoundGlobalMenu; + // New version of the menu after the server connection // @@ -405,6 +472,8 @@ bool connection (const string &cookie, const string &fsaddr) InterfaceState = GLOBAL_MENU; } + // No loading music here, this is right before character selection, using the existing music + // Create the loading texture. We can't do that before because we need to add search path first. beginLoading (LoadBackground); UseEscapeDuringLoading = USE_ESCAPE_DURING_LOADING; @@ -507,6 +576,7 @@ bool reconnection() ProgressBar.setFontFactor(1.0f); // Init out game + SoundGlobalMenu.reset(); pIM->initOutGame(); // Hide cursor for interface @@ -522,6 +592,9 @@ bool reconnection() FarTP.setOutgame(); + if (SoundMngr) + SoundMngr->setupFadeSound(1.0f, 1.0f); + // these two globals sequence GlobalMenu to display the character select dialog WaitServerAnswer = true; userChar = true; @@ -556,6 +629,8 @@ bool reconnection() // this also kicks the state machine to sendReady() so we stop spinning in farTPmainLoop FarTP.setIngame(); + // Not loading music here, this is before character selection, keep existing music + // Create the loading texture. We can't do that before because we need to add search path first. beginLoading (LoadBackground); UseEscapeDuringLoading = USE_ESCAPE_DURING_LOADING; @@ -731,66 +806,6 @@ std::string buildPlayerNameForSaveFile(const ucstring &playerNameIn) return ret; } -// ------------------------------------------------------------------------------------------------ -class CSoundGlobalMenu -{ -public: - CSoundGlobalMenu() - { - _MusicWantedAsync= false; - _NbFrameBeforeChange= NbFrameBeforeChangeMax; - } - void setMusic(const string &music, bool async); - void updateSound(); -private: - string _MusicPlayed; - string _MusicWanted; - bool _MusicWantedAsync; - sint _NbFrameBeforeChange; - enum {NbFrameBeforeChangeMax= 10}; -}; - -void CSoundGlobalMenu::updateSound() -{ - // **** update the music played - // The first music played is the music played at loading, before select char - if(_MusicPlayed.empty()) - _MusicPlayed= toLower(ClientCfg.SoundOutGameMusic); - if(_MusicWanted.empty()) - _MusicWanted= toLower(ClientCfg.SoundOutGameMusic); - - // because music is changed when the player select other race for instance, - // wait the 3D to load (stall some secs) - - // if the wanted music is the same as the one currently playing, just continue playing - if(_MusicPlayed!=_MusicWanted) - { - // wait nbFrameBeforeChangeMax before actually changing the music - _NbFrameBeforeChange--; - if(_NbFrameBeforeChange<=0) - { - _MusicPlayed= _MusicWanted; - // play the music - if (SoundMngr != NULL) - SoundMngr->playMusic(_MusicPlayed, 500, _MusicWantedAsync, true, true); - } - } - - - // **** update mngr - if (SoundMngr != NULL) - SoundMngr->update(); -} - -void CSoundGlobalMenu::setMusic(const string &music, bool async) -{ - _MusicWanted= toLower(music); - _MusicWantedAsync= async; - // reset the counter - _NbFrameBeforeChange= NbFrameBeforeChangeMax; -} -static CSoundGlobalMenu SoundGlobalMenu; - static bool LuaBGDSuccessFlag = true; // tmp, for debug @@ -2041,8 +2056,8 @@ public: fromString(getParam(Params, "async"), async); // if empty name, return to default mode - if(sName.empty()) - sName= ClientCfg.SoundOutGameMusic; + if (sName.empty()) + sName = ClientCfg.TeleportLoadingMusic; // change the music SoundGlobalMenu.setMusic(sName, async); diff --git a/ryzom/client/src/far_tp.cpp b/ryzom/client/src/far_tp.cpp index 0a594e540..80134f26b 100644 --- a/ryzom/client/src/far_tp.cpp +++ b/ryzom/client/src/far_tp.cpp @@ -1112,15 +1112,6 @@ void CFarTP::disconnectFromPreviousShard() beginLoading (StartBackground); UseEscapeDuringLoading = false; - // Play music and fade out the Game Sound - if (SoundMngr) - { - // Loading Music Loop.ogg - LoadingMusic = ClientCfg.SoundOutGameMusic; - SoundMngr->playEventMusic(LoadingMusic, CSoundManager::LoadingMusicXFade, true); - SoundMngr->fadeOutGameSound(ClientCfg.SoundTPFade); - } - // Change the tips selectTipsOfTheDay (rand()); @@ -1129,6 +1120,21 @@ void CFarTP::disconnectFromPreviousShard() ucstring nmsg("Loading..."); ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); ProgressBar.progress(0); + + // Play music and fade out the Game Sound + if (SoundMngr) + { + SoundMngr->fadeOutGameSound(ClientCfg.SoundTPFade); + + // Stop and enable music + SoundMngr->stopMusic(0); + SoundMngr->setupFadeSound(0.0f, 1.0f); + + // Loading Music Loop.ogg + LoadingMusic = ClientCfg.LoadingMusic; + // SoundMngr->playEventMusic(LoadingMusic, CSoundManager::LoadingMusicXFade, true); + SoundMngr->playMusic(LoadingMusic, 0, false, true, true); + } } // Disconnect from the FS diff --git a/ryzom/client/src/init.cpp b/ryzom/client/src/init.cpp index efc137ee6..5e7b03549 100644 --- a/ryzom/client/src/init.cpp +++ b/ryzom/client/src/init.cpp @@ -1410,6 +1410,42 @@ void prelogInit() StereoDisplay->setDriver(Driver); // VR_DRIVER } + { + H_AUTO(InitRZSound) + + // Init the sound manager + nmsg = "Initializing sound manager..."; + ProgressBar.newMessage(ClientCfg.buildLoadingString(nmsg)); + if (ClientCfg.SoundOn) + { + nlassert(!SoundMngr); + SoundMngr = new CSoundManager(&ProgressBar); + try + { + SoundMngr->init(&ProgressBar); + } + catch(const Exception &e) + { + nlwarning("init : Error when creating 'SoundMngr' : %s", e.what()); + delete SoundMngr; + SoundMngr = NULL; + } + + // Play Music just after the SoundMngr is inited + if (SoundMngr) + { + // init the SoundMngr with backuped volume + SoundMngr->setSFXVolume(ClientCfg.SoundSFXVolume); + SoundMngr->setGameMusicVolume(ClientCfg.SoundGameMusicVolume); + + // Play the login screen music + SoundMngr->playMusic(ClientCfg.StartMusic, 0, true, true, true); + } + } + + CPath::memoryCompress(); // Because sound calls addSearchPath + } + nlinfo ("PROFILE: %d seconds for prelogInit", (uint32)(ryzomGetLocalTime ()-initStart)/1000); FPU_CHECKER_ONCE @@ -1552,55 +1588,6 @@ void postlogInit() // set the primitive context CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; - { - H_AUTO(InitRZSound) - - // Init the sound manager - nmsg = "Initializing sound manager..."; - ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); - if(ClientCfg.SoundOn) - { - SoundMngr = new CSoundManager(&ProgressBar); - try - { - SoundMngr->init(&ProgressBar); - } - catch(const Exception &e) - { - nlwarning("init : Error when creating 'SoundMngr' : %s", e.what()); - delete SoundMngr; - SoundMngr = NULL; - } - - // Play Music just after the SoundMngr is inited - if(SoundMngr) - { - // init the SoundMngr with backuped volume - SoundMngr->setSFXVolume(ClientCfg.SoundSFXVolume); - SoundMngr->setGameMusicVolume(ClientCfg.SoundGameMusicVolume); - - // no fadein, and not async because don't work well because of loading in the main thread - // Force use GameMusic volume - const uint fadeInTime= 500; - SoundMngr->playMusic(ClientCfg.SoundOutGameMusic, fadeInTime, false, true, true); - // Because of blocking loading, force the fadeIn - TTime t0= ryzomGetLocalTime(); - TTime t1; - while((t1=ryzomGetLocalTime())updateAudioMixerOnly(); - } - } - } - - CPath::memoryCompress(); // Because sound call addSearchPath - - initLast = initCurrent; - initCurrent = ryzomGetLocalTime(); - //nlinfo ("PROFILE: %d seconds (%d total) for Initializing sound manager", (uint32)(initCurrent-initLast)/1000, (uint32)(initCurrent-initStart)/1000); - } - { H_AUTO(InitRZShIdI) diff --git a/ryzom/client/src/init_main_loop.cpp b/ryzom/client/src/init_main_loop.cpp index 2b391114c..deeda2149 100644 --- a/ryzom/client/src/init_main_loop.cpp +++ b/ryzom/client/src/init_main_loop.cpp @@ -473,6 +473,27 @@ void initMainLoop() FPU_CHECKER_ONCE + if (SoundMngr) + { + // Loading Music + LoadingMusic = ClientCfg.LoadingMusic; + + // SoundMngr->playEventMusic(LoadingMusic, CSoundManager::LoadingMusicXFade, true); + // no fadein, and not async because don't work well because of loading in the main thread + // Force use GameMusic volume + const uint fadeInTime = 500; + SoundMngr->playMusic(LoadingMusic, fadeInTime, false, true, true); + // Because of blocking loading, force the fadeIn + TTime t0 = ryzomGetLocalTime(); + TTime t1; + do + { + ProgressBar.progress(0); + SoundMngr->updateAudioMixerOnly(); + nlSleep(10); + } while ((t1 = ryzomGetLocalTime()) < t0 + fadeInTime); + } + // Get the interface manager CInterfaceManager *pIM = CInterfaceManager::getInstance(); diff --git a/ryzom/client/src/login.cpp b/ryzom/client/src/login.cpp index c9c1fdeaf..cb6117744 100644 --- a/ryzom/client/src/login.cpp +++ b/ryzom/client/src/login.cpp @@ -3279,6 +3279,7 @@ bool loginIntroSkip; void loginIntro() { // Display of nevrax logo is done at init time (see init.cpp) just before addSearchPath (second one) +#if 0 for (uint i = 0; i < 1; i++) // previously display nevrax then nvidia { if (i != 0) @@ -3316,6 +3317,7 @@ void loginIntro() NLGUI::CDBManager::getInstance()->flushObserverCalls(); } } +#endif beginLoading(StartBackground); ProgressBar.finish(); } diff --git a/ryzom/client/src/main_loop.cpp b/ryzom/client/src/main_loop.cpp index 760a551c2..172c4056b 100644 --- a/ryzom/client/src/main_loop.cpp +++ b/ryzom/client/src/main_loop.cpp @@ -2240,19 +2240,21 @@ bool mainLoop() { StartPlayTime = NLMISC::CTime::getLocalTime(); } + // Start background sound play now ! (nb: restarted if load just ended, or if sound re-enabled) if (SoundMngr) { H_AUTO_USE ( RZ_Client_Main_Loop_Sound ) - SoundMngr->playBackgroundSound(); - } - // Fade in Game Sound now (before endLoading) - if(SoundMngr) - { // fade out loading music - if(LoadingMusic==SoundMngr->getEventMusicPlayed()) + if (SoundMngr->getEventMusicPlayed() == LoadingMusic) + { SoundMngr->stopEventMusic(LoadingMusic, CSoundManager::LoadingMusicXFade); + } + + SoundMngr->playBackgroundSound(); + + // Fade in Game Sound now (before endLoading) // fade in game sound SoundMngr->fadeInGameSound(ClientCfg.SoundTPFade); } @@ -2516,7 +2518,7 @@ bool mainLoop() EditActions.enable(true); // For stoping the outgame music, start after 30 frames, and duration of 3 seconds -// CMusicFader outgameFader(60, 3); + outgameFader = CMusicFader(60, 3); // check for banned player if (testPermanentBanMarkers()) diff --git a/ryzom/client/src/net_manager.cpp b/ryzom/client/src/net_manager.cpp index 7ce27c4d5..642935869 100644 --- a/ryzom/client/src/net_manager.cpp +++ b/ryzom/client/src/net_manager.cpp @@ -1483,32 +1483,33 @@ void impulseTPCommon(NLMISC::CBitMemStream &impulse, bool hasSeason) void impulseTPCommon2(NLMISC::CBitMemStream &impulse, bool hasSeason) { // choose a default screen if not setuped - if( LoadingBackground!=ResurectKamiBackground && LoadingBackground!=ResurectKaravanBackground && - LoadingBackground!=TeleportKamiBackground && LoadingBackground!=TeleportKaravanBackground) - LoadingBackground= TeleportKaravanBackground; + if (LoadingBackground != ResurectKamiBackground && LoadingBackground != ResurectKaravanBackground + && LoadingBackground != TeleportKamiBackground && LoadingBackground != TeleportKaravanBackground) + LoadingBackground = ElevatorBackground; // if resurect but user not dead, choose default. NB: this is a bug, the tp impulse should tell // which background to choose. \todo yoyo: this is a temp fix - if( UserEntity && !UserEntity->isDead() && - (LoadingBackground==ResurectKamiBackground || LoadingBackground==ResurectKaravanBackground) ) - LoadingBackground= TeleportKaravanBackground; + if (UserEntity && !UserEntity->isDead() && (LoadingBackground == ResurectKamiBackground || LoadingBackground == ResurectKaravanBackground)) + LoadingBackground = ElevatorBackground; // Play music according to the background - if(SoundMngr) + if (SoundMngr) { LoadingMusic.clear(); - if(LoadingBackground==TeleportKamiBackground) - LoadingMusic= "Kami Teleport.ogg"; - else if(LoadingBackground==TeleportKaravanBackground) - LoadingMusic= "Karavan Teleport.ogg"; - // if resurection, continue to play death music - else if(LoadingBackground==ResurectKamiBackground || LoadingBackground==ResurectKaravanBackground) - { - // noop - } - // default: loading music - else + switch (LoadingBackground) { - LoadingMusic= "Loading Music Loop.ogg"; + case TeleportKamiBackground: + LoadingMusic = ClientCfg.KamiTeleportMusic; + break; + case TeleportKaravanBackground: + LoadingMusic = ClientCfg.KaravanTeleportMusic; + break; + case ResurectKamiBackground: + case ResurectKaravanBackground: + // TODO: Resurrect music + break; + default: + LoadingMusic = ClientCfg.TeleportLoadingMusic; + break; } // start to play diff --git a/ryzom/client/src/user_entity.cpp b/ryzom/client/src/user_entity.cpp index 18cd832be..5c14bf82e 100644 --- a/ryzom/client/src/user_entity.cpp +++ b/ryzom/client/src/user_entity.cpp @@ -4309,20 +4309,19 @@ void CUserEntity::updatePreCollision(const NLMISC::TTime &time, CEntityCL *targe // test each frame if the mode has changed if(SoundMngr) { - string deadMusic= "death.ogg"; // Play/stop music if comes from or goes to dead - bool isDead= _Mode==MBEHAV::DEATH || _Mode==MBEHAV::SWIM_DEATH; + bool isDead = _Mode == MBEHAV::DEATH || _Mode == MBEHAV::SWIM_DEATH; // must start music? - if( isDead && SoundMngr->getEventMusicPlayed()!=deadMusic ) + if (isDead && SoundMngr->getEventMusicPlayed() != ClientCfg.DeathMusic) { - SoundMngr->playEventMusic(deadMusic, 0, true); + SoundMngr->playEventMusic(ClientCfg.DeathMusic, 0, true); } // must end music? - if( !isDead && SoundMngr->getEventMusicPlayed()==deadMusic ) + if (!isDead && SoundMngr->getEventMusicPlayed() == ClientCfg.DeathMusic) { - SoundMngr->stopEventMusic(deadMusic, CSoundManager::LoadingMusicXFade); + SoundMngr->stopEventMusic(ClientCfg.DeathMusic, CSoundManager::LoadingMusicXFade); } } } From a82df91bba52642d7c221e6aa0fb031bb155cf18 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 9 Apr 2020 13:02:50 +0800 Subject: [PATCH 21/25] CPath::lookup is not thread-safe --- nel/include/nel/sound/stream_file_source.h | 2 ++ nel/src/sound/audio_decoder.cpp | 8 +------- nel/src/sound/stream_file_source.cpp | 10 +++++++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/nel/include/nel/sound/stream_file_source.h b/nel/include/nel/sound/stream_file_source.h index 4069a2f58..c8cf91cf5 100644 --- a/nel/include/nel/sound/stream_file_source.h +++ b/nel/include/nel/sound/stream_file_source.h @@ -96,6 +96,8 @@ private: IAudioDecoder *m_AudioDecoder; + std::string m_LookupPath; + bool m_Paused; bool m_DecodingEnded; diff --git a/nel/src/sound/audio_decoder.cpp b/nel/src/sound/audio_decoder.cpp index ac7745721..a282942c4 100644 --- a/nel/src/sound/audio_decoder.cpp +++ b/nel/src/sound/audio_decoder.cpp @@ -56,18 +56,12 @@ IAudioDecoder::~IAudioDecoder() IAudioDecoder *IAudioDecoder::createAudioDecoder(const std::string &filepath, bool async, bool loop) { - std::string lookup = CPath::lookup(filepath, false); - if (lookup.empty()) - { - nlwarning("Music file %s does not exist!", filepath.c_str()); - return NULL; - } std::string type = CFile::getExtension(filepath); CIFile *ifile = new CIFile(); ifile->setCacheFileOnOpen(!async); ifile->allowBNPCacheFileOnOpen(!async); - ifile->open(lookup); + ifile->open(filepath); IAudioDecoder *mb = createAudioDecoder(type, ifile, loop); diff --git a/nel/src/sound/stream_file_source.cpp b/nel/src/sound/stream_file_source.cpp index fbd720a89..50d9bda97 100644 --- a/nel/src/sound/stream_file_source.cpp +++ b/nel/src/sound/stream_file_source.cpp @@ -108,6 +108,13 @@ void CStreamFileSource::play() //{ // nlwarning("Already waiting for play"); //} + std::string filepath = getStreamFileSound()->getFilePath(); + m_LookupPath = NLMISC::CPath::lookup(filepath, false, false); + if (m_LookupPath.empty()) + { + nlwarning("Music file %s does not exist!", filepath.c_str()); + return; + } if (!getStreamFileSound()->getAsync()) { if (!prepareDecoder()) @@ -272,7 +279,8 @@ bool CStreamFileSource::prepareDecoder() if (!m_AudioDecoder) { // load the file - m_AudioDecoder = IAudioDecoder::createAudioDecoder(getStreamFileSound()->getFilePath(), getStreamFileSound()->getAsync(), getStreamFileSound()->getLooping()); + nlassert(!m_LookupPath.empty()); + m_AudioDecoder = IAudioDecoder::createAudioDecoder(m_LookupPath, getStreamFileSound()->getAsync(), getStreamFileSound()->getLooping()); if (!m_AudioDecoder) { nlwarning("Failed to create IAudioDecoder, likely invalid format"); From 1a037ad3eba45c3f3c4c6a32e6aba5e925fa5721 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 9 Apr 2020 16:10:53 +0800 Subject: [PATCH 22/25] Finer control over menu music --- ryzom/client/src/client_cfg.cpp | 10 ++++++---- ryzom/client/src/client_cfg.h | 1 + ryzom/client/src/connection.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ryzom/client/src/client_cfg.cpp b/ryzom/client/src/client_cfg.cpp index 7588f6b57..ec3535529 100644 --- a/ryzom/client/src/client_cfg.cpp +++ b/ryzom/client/src/client_cfg.cpp @@ -465,11 +465,12 @@ CClientConfig::CClientConfig() SoundOn = true; // Default is with sound. DriverSound = SoundDrvAuto; SoundForceSoftwareBuffer = true; - StartMusic = "main theme air.ogg"; // Use at game startup - LoadingMusic = "main menu loop.ogg"; // Use after leaving character selection, and when going back to character selection + StartMusic = "main theme air.ogg"; // Use at game startup (originally no music) + EmptySlotMusic = "loading music loop.ogg"; // Use in character selection for empty slots + LoadingMusic = "main menu loop.ogg"; // Main loading used after leaving character selection, and when going back to character selection KamiTeleportMusic = "kami teleport.ogg"; // Kami teleport KaravanTeleportMusic = "karavan teleport.ogg"; // Karavan teleport - TeleportLoadingMusic = "loading music loop.ogg"; // Use after character select, and for generic teleportations + TeleportLoadingMusic = "loading music loop.ogg"; // Use for generic teleportations DeathMusic = "death.ogg"; // Player death SoundSFXVolume = 1.f; SoundGameMusicVolume = 1.f; @@ -481,7 +482,7 @@ CClientConfig::CClientConfig() UserEntitySoundLevel = 0.5f; // Default volume for sound in 1st person UseEax = true; // Default to use EAX; UseADPCM = false; // Defualt to PCM sample, NO ADPCM - MaxTrack = 32; // DEfault to 32 track + MaxTrack = 32; // Default to 32 track ColorShout = CRGBA(150,0,0,255); // Default Shout color. ColorTalk = CRGBA(255,255,255,255); // Default Talk color. @@ -1253,6 +1254,7 @@ void CClientConfig::setValues() READ_BOOL_FV(SoundForceSoftwareBuffer); // SoundOutGameMusic READ_STRING_DEV(StartMusic) + READ_STRING_DEV(EmptySlotMusic) READ_STRING_DEV(LoadingMusic) READ_STRING_DEV(KamiTeleportMusic) READ_STRING_DEV(KaravanTeleportMusic) diff --git a/ryzom/client/src/client_cfg.h b/ryzom/client/src/client_cfg.h index 716972c3a..e35e9701f 100644 --- a/ryzom/client/src/client_cfg.h +++ b/ryzom/client/src/client_cfg.h @@ -350,6 +350,7 @@ struct CClientConfig /// Music files string StartMusic; + string EmptySlotMusic; string LoadingMusic; string KamiTeleportMusic; string KaravanTeleportMusic; diff --git a/ryzom/client/src/connection.cpp b/ryzom/client/src/connection.cpp index 9c9dce6da..47c45984d 100644 --- a/ryzom/client/src/connection.cpp +++ b/ryzom/client/src/connection.cpp @@ -2057,7 +2057,7 @@ public: // if empty name, return to default mode if (sName.empty()) - sName = ClientCfg.TeleportLoadingMusic; + sName = ClientCfg.EmptySlotMusic; // change the music SoundGlobalMenu.setMusic(sName, async); From 56ee772548237bfbca12a43acdface7a5679b788 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 9 Apr 2020 14:58:40 +0800 Subject: [PATCH 23/25] Reset active builtin shader when using user shader in D3D driver, fix ryzom/ryzomcore#603 --- .../3d/driver/direct3d/driver_direct3d.cpp | 8 ++++++- nel/src/3d/driver/direct3d/driver_direct3d.h | 9 ++++++++ .../direct3d/driver_direct3d_material.cpp | 21 ++++++++++++++----- .../direct3d/driver_direct3d_texture.cpp | 1 + nel/src/3d/fxaa.cpp | 1 + 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 1ab29c3a0..3a4f67aee 100644 --- a/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -3830,9 +3830,15 @@ void CDriverD3D::CLightState::apply(CDriverD3D *driver) void CDriverD3D::CRenderTargetState::apply(CDriverD3D *driver) { H_AUTO_D3D(CDriverD3D_CRenderTargetState); - driver->_DeviceInterface->SetRenderTarget (0, Target); + nlassert(TargetOwned); // Can only apply once! + driver->_DeviceInterface->SetRenderTarget(0, Target); driver->setupViewport(driver->_Viewport); driver->setupScissor(driver->_Scissor); + if (TargetOwned) + { + Target->Release(); + TargetOwned = false; + } } // *************************************************************************** diff --git a/nel/src/3d/driver/direct3d/driver_direct3d.h b/nel/src/3d/driver/direct3d/driver_direct3d.h index 636695670..c021f052d 100644 --- a/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -1546,11 +1546,13 @@ public: Texture = NULL; Level = 0; CubeFace = 0; + TargetOwned = false; } IDirect3DSurface9 *Target; ITexture *Texture; uint8 Level; uint8 CubeFace; + bool TargetOwned; virtual void apply(CDriverD3D *driver); }; @@ -2076,10 +2078,17 @@ public: NL_D3D_CACHE_TEST(CacheTest_RenderTarget, _RenderTarget.Target != target) #endif // NL_D3D_USE_RENDER_STATE_CACHE { + if (_RenderTarget.TargetOwned) + { + nlassert(_RenderTarget.Target); + _RenderTarget.Target->Release(); + } _RenderTarget.Target = target; _RenderTarget.Texture = texture; _RenderTarget.Level = level; _RenderTarget.CubeFace = cubeFace; + _RenderTarget.TargetOwned = target; + target->AddRef(); touchRenderVariable (&_RenderTarget); diff --git a/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp b/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp index f902e9fb0..2285688d4 100644 --- a/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -706,9 +706,13 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) // Set the texture states if (text || (stage == 0)) { - // Doesn't use a pixel shader ? Set the textures stages - if (pShader->PixelShader == NULL) + if (matShader == CMaterial::Program) { + // Do nothing for user pixel shader + } + else if (!pShader->PixelShader) + { + // Doesn't use a pixel shader ? Set the textures stages if (pShader->RGBPipe[stage]) { setTextureState (stage, D3DTSS_COLOROP, pShader->ColorOp[stage]); @@ -1145,7 +1149,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) } break; - case CMaterial::Cloud: + case CMaterial::Cloud: { H_AUTO_D3D(CDriverD3D_setupMaterial_setupCloudShader) activeShader (&_ShaderCloud); @@ -1167,7 +1171,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) return false; } break; - case CMaterial::Water: + case CMaterial::Water: { H_AUTO_D3D(CDriverD3D_setupMaterial_setupWaterShader) activeShader(mat.getTexture(3) ? &_ShaderWaterDiffuse : &_ShaderWaterNoDiffuse); @@ -1296,7 +1300,14 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) } } } - // CMaterial::Water + break; // CMaterial::Water + case CMaterial::Program: + { + H_AUTO_D3D(CDriverD3D_setupMaterial_setupProgramshader) + // No material shader + activeShader(NULL); + } + break; } // New material setuped diff --git a/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp b/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp index f45663f1b..15dcb7768 100644 --- a/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -1084,6 +1084,7 @@ void CDriverD3D::swapTextureHandle(ITexture &tex0, ITexture &tex1) swap(t0->Height, t1->Height); swap(t0->SrcCompressed, t1->SrcCompressed); swap(t0->IsCube, t1->IsCube); + swap(t0->RenderTarget, t1->RenderTarget); swap(t0->Levels, t1->Levels); swap(t0->FirstMipMap, t1->FirstMipMap); swap(t0->TextureMemory, t1->TextureMemory); diff --git a/nel/src/3d/fxaa.cpp b/nel/src/3d/fxaa.cpp index 255f0234d..6478abf8e 100644 --- a/nel/src/3d/fxaa.cpp +++ b/nel/src/3d/fxaa.cpp @@ -246,6 +246,7 @@ void CFXAA::applyEffect() // create render target CTextureUser *otherRenderTarget = m_Driver->getRenderTargetManager().getRenderTarget(width, height, mode2D); + nlassert(otherRenderTarget); // swap render target CTextureUser texNull; From a4aafa410af476e4c263d1ea2b355ec77b3d93a3 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 9 Apr 2020 15:28:10 +0800 Subject: [PATCH 24/25] Fix initial value --- nel/include/nel/web/http_client_curl.h | 2 +- nel/src/web/http_client_curl.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nel/include/nel/web/http_client_curl.h b/nel/include/nel/web/http_client_curl.h index 77cf335ca..e130cd768 100644 --- a/nel/include/nel/web/http_client_curl.h +++ b/nel/include/nel/web/http_client_curl.h @@ -34,7 +34,7 @@ class CCurlHttpClient public: /// Constructor - CCurlHttpClient() {} + CCurlHttpClient() : _CurlStruct(NULL) {} /// Connect to an http server (string by val is intended). If you specify a whole URL, an attempt will be made to determine the server. bool connect(const std::string &server); diff --git a/nel/src/web/http_client_curl.cpp b/nel/src/web/http_client_curl.cpp index 1ec244cd2..253588972 100644 --- a/nel/src/web/http_client_curl.cpp +++ b/nel/src/web/http_client_curl.cpp @@ -192,6 +192,7 @@ bool CCurlHttpClient::receive(string &res, bool verbose) void CCurlHttpClient::disconnect() { curl_easy_cleanup(_Curl); + _Curl = NULL; curl_global_cleanup(); } From d293b3ef02bf7924d7a679f6ef2f7d7672e10c51 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 9 Apr 2020 16:57:00 +0800 Subject: [PATCH 25/25] Fix value --- nel/src/web/http_client_curl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nel/src/web/http_client_curl.cpp b/nel/src/web/http_client_curl.cpp index 253588972..e61baa89f 100644 --- a/nel/src/web/http_client_curl.cpp +++ b/nel/src/web/http_client_curl.cpp @@ -192,7 +192,7 @@ bool CCurlHttpClient::receive(string &res, bool verbose) void CCurlHttpClient::disconnect() { curl_easy_cleanup(_Curl); - _Curl = NULL; + _CurlStruct = NULL; curl_global_cleanup(); }