From 8a32c566c2790bbbab2fcf01d3d524c39d4957cf Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 18 Mar 2025 23:31:23 -0400 Subject: [PATCH 01/24] Pull in fmtlib as a dependency --- .gitmodules | 3 +++ deps/fmtlib | 1 + proj/xc12/BoE.xcodeproj/project.pbxproj | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 160000 deps/fmtlib diff --git a/.gitmodules b/.gitmodules index 656289c2b..b8cbba76a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,3 +11,6 @@ [submodule "deps/fix-rpaths"] path = deps/fix-rpaths url = https://gist.github.com/NQNStudios/7145bcf6621891f5176c8caa165d6b93 +[submodule "deps/fmtlib"] + path = deps/fmtlib + url = http://github.com/fmtlib/fmt diff --git a/deps/fmtlib b/deps/fmtlib new file mode 160000 index 000000000..814f51eab --- /dev/null +++ b/deps/fmtlib @@ -0,0 +1 @@ +Subproject commit 814f51eab67a9bf0a7c3f9354fad75b610660719 diff --git a/proj/xc12/BoE.xcodeproj/project.pbxproj b/proj/xc12/BoE.xcodeproj/project.pbxproj index 3642036e6..c8a6baba7 100755 --- a/proj/xc12/BoE.xcodeproj/project.pbxproj +++ b/proj/xc12/BoE.xcodeproj/project.pbxproj @@ -161,6 +161,8 @@ 917823821B2F33F5007F3444 /* FLAC.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = 9178237C1B2F33E9007F3444 /* FLAC.framework */; }; 91870F84190C90980081C150 /* scenedit.xib in Resources */ = {isa = PBXBuildFile; fileRef = 914CA49F190C4E9200B6ADD1 /* scenedit.xib */; }; 919145FC18E3AB1B005CF3A4 /* boe.appleevents.mm in Sources */ = {isa = PBXBuildFile; fileRef = 919145FB18E3A32F005CF3A4 /* boe.appleevents.mm */; }; + 9191E3B12D8AFD5800AF6D01 /* os.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9191E3AE2D8AFD5800AF6D01 /* os.cc */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; + 9191E3B32D8AFD5800AF6D01 /* format.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9191E3B02D8AFD5800AF6D01 /* format.cc */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; 9192C12018F2745C0088A580 /* game.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9192C11E18F271920088A580 /* game.xib */; }; 919B13A21BBCDF14009905A4 /* monst_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A11BBCDE18009905A4 /* monst_legacy.cpp */; }; 919B13A41BBD8854009905A4 /* item_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A31BBD8849009905A4 /* item_legacy.cpp */; }; @@ -791,6 +793,8 @@ 919145FF18E63B70005CF3A4 /* winutil.mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = winutil.mac.mm; sourceTree = ""; }; 9191460018E63D8E005CF3A4 /* scrollbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scrollbar.cpp; sourceTree = ""; }; 9191460118E6591F005CF3A4 /* boe.menus.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = boe.menus.hpp; sourceTree = ""; }; + 9191E3AE2D8AFD5800AF6D01 /* os.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = os.cc; sourceTree = ""; }; + 9191E3B02D8AFD5800AF6D01 /* format.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = format.cc; sourceTree = ""; }; 9192C11E18F271920088A580 /* game.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = game.xib; path = ../rsrc/menus/game.xib; sourceTree = ""; }; 919B13A11BBCDE18009905A4 /* monst_legacy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = monst_legacy.cpp; sourceTree = ""; }; 919B13A31BBD8849009905A4 /* item_legacy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item_legacy.cpp; sourceTree = ""; }; @@ -1400,6 +1404,7 @@ 91F06E8F1A2EBEE70038E902 /* special_parse.hpp */, 919F2E72287E4E0500F47750 /* tagfile.hpp */, 91BFA3D91902ADD5001686E4 /* tarball.hpp */, + 9191E3A82D8AFCF000AF6D01 /* fmtlib */, 91BFA3DC19033E00001686E4 /* gzstream */, 912DFE8718E24B0B00B00D75 /* resmgr */, 910BBA190FB8C43E001E34EA /* xml-parser */, @@ -1444,6 +1449,16 @@ path = ../../src; sourceTree = ""; }; + 9191E3A82D8AFCF000AF6D01 /* fmtlib */ = { + isa = PBXGroup; + children = ( + 9191E3B02D8AFD5800AF6D01 /* format.cc */, + 9191E3AE2D8AFD5800AF6D01 /* os.cc */, + ); + name = fmtlib; + path = ../../deps/fmtlib/src; + sourceTree = ""; + }; 91B3EECD0F969B7000BF5B67 /* ScenEd */ = { isa = PBXGroup; children = ( @@ -2211,6 +2226,8 @@ 91EC1F0523DDFF9D00271891 /* res_font.cpp in Sources */, 91EC1F0623DDFF9D00271891 /* res_image.cpp in Sources */, 91EC1F0723DDFF9D00271891 /* res_sound.cpp in Sources */, + 9191E3B32D8AFD5800AF6D01 /* format.cc in Sources */, + 9191E3B12D8AFD5800AF6D01 /* os.cc in Sources */, 91EC1F0823DDFF9D00271891 /* res_strings.cpp in Sources */, 91F3205023E65EA3009650AF /* framerate_limiter.cpp in Sources */, 91FE0E3823F084B70084CA6B /* drawable_manager.cpp in Sources */, @@ -2461,6 +2478,7 @@ "$(PROJECT_DIR)/../../src/fileio/xml-parser", "$(PROJECT_DIR)/../../src/tools", "$(PROJECT_DIR)/../../deps/Catch2/include/external", + "$(PROJECT_DIR)/../../deps/fmtlib/include", ); LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -2577,6 +2595,7 @@ "$(PROJECT_DIR)/../../src/tools", "$(PROJECT_DIR)/../../deps/Catch2/include/external", "/usr/local/opt/boost@1.85/include", + "$(PROJECT_DIR)/../../deps/fmtlib/include", ); LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( From 37c2b0114bd0caa117f89c231b3601f3c743eeae Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 3 Aug 2025 09:14:40 -0500 Subject: [PATCH 02/24] Add fmtlib to scons --- SConstruct | 8 +++++++- src/game/SConscript | 2 ++ src/pcedit/SConscript | 2 ++ src/scenedit/SConscript | 2 ++ test/SConscript | 4 +++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 19a9fce5f..bc222ad4b 100644 --- a/SConstruct +++ b/SConstruct @@ -84,7 +84,7 @@ print('C++ compiler:', cxx) env.VariantDir('#build/obj', 'src') env.VariantDir('#build/obj/test', 'test') -env.VariantDir('#build/obj/test/deps', 'deps') +env.VariantDir('#build/obj/deps', 'deps') if not env['release']: if platform in ['posix', 'darwin']: @@ -411,6 +411,12 @@ if not env.GetOption('clean'): env.Append(CPPPATH=[path.join(os.getcwd(), 'deps/cppcodec')]) + # Make sure fmtlib is cloned + if not path.exists('deps/fmtlib/fmt/format.h'): + subprocess.call(["git", "submodule", "update", "--init", "deps/fmtlib"]) + + env.Append(CPPPATH=[path.join(os.getcwd(), 'deps/fmtlib/include')]) + # On Linux, build TGUI from the subtree if necessary if platform == 'posix': def check_tgui(conf, second_attempt=False): diff --git a/src/game/SConscript b/src/game/SConscript index 3b2e14e58..dc3c8b9aa 100644 --- a/src/game/SConscript +++ b/src/game/SConscript @@ -24,6 +24,8 @@ game_sources = Split(""" ../pcedit/pc.editors.cpp ../fileio/fileio_party.cpp ../view_dialogs.cpp + ../deps/fmtlib/src/format.cc + ../deps/fmtlib/src/os.cc """) if str(platform) == "darwin": diff --git a/src/pcedit/SConscript b/src/pcedit/SConscript index 38afdb9bd..d5af21dcb 100644 --- a/src/pcedit/SConscript +++ b/src/pcedit/SConscript @@ -8,6 +8,8 @@ pced_sources = Split(""" pc.graphics.cpp pc.main.cpp ../fileio/fileio_party.cpp + ../deps/fmtlib/src/format.cc + ../deps/fmtlib/src/os.cc """) if str(platform) == "darwin": diff --git a/src/scenedit/SConscript b/src/scenedit/SConscript index aa1dcfdf4..8a767bec5 100644 --- a/src/scenedit/SConscript +++ b/src/scenedit/SConscript @@ -16,6 +16,8 @@ scened_sources = Split(""" ../view_dialogs.cpp ../fileio/fileio_party.cpp ../damage.cpp + ../deps/fmtlib/src/format.cc + ../deps/fmtlib/src/os.cc """) if str(platform) == "darwin": diff --git a/test/SConscript b/test/SConscript index 04767ee5a..bdb56ceb8 100644 --- a/test/SConscript +++ b/test/SConscript @@ -5,10 +5,12 @@ Import("env platform party_classes common_sources") arch_short = '64' if (env['bits'] == '64') else '86' # Add path to scons -env.Append(CPPPATH=['./deps/Catch2/single_include/catch2']) +env.Append(CPPPATH=['../deps/Catch2/single_include/catch2']) test_sources = Glob("""*.cpp""") + Split(""" #build/obj/scenedit/scen.fileio.cpp + ../deps/fmtlib/src/format.cc + ../deps/fmtlib/src/os.cc """) debug_symbols = None From 48664677a4ed041571c7d4989a78b907e2585117 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Aug 2025 10:52:24 -0400 Subject: [PATCH 03/24] Add fmtlib to MSBuild --- proj/vs2013/Common/Common.vcxproj | 6 ++++-- proj/vs2013/Common/Common.vcxproj.filters | 2 ++ proj/vs2013/Game/Blades of Exile.vcxproj | 6 +++--- proj/vs2013/OBoE Tests/OBoE Tests.vcxproj | 8 ++++---- proj/vs2013/PcEdit/Char Editor.vcxproj | 6 +++--- proj/vs2013/ScenEdit/Scen Editor.vcxproj | 6 +++--- proj/vs2017/Blades of Exile.vcxproj | 10 +++++----- proj/vs2017/Character Editor/Character Editor.vcxproj | 10 +++++----- proj/vs2017/Common/Common.vcxproj | 10 ++++++---- proj/vs2017/Common/Common.vcxproj.filters | 2 ++ proj/vs2017/Scenario Editor/Scenario Editor.vcxproj | 10 +++++----- proj/vs2017/Tests/Tests.vcxproj | 10 +++++----- 12 files changed, 47 insertions(+), 39 deletions(-) diff --git a/proj/vs2013/Common/Common.vcxproj b/proj/vs2013/Common/Common.vcxproj index 2307fbff6..17e7ef01e 100644 --- a/proj/vs2013/Common/Common.vcxproj +++ b/proj/vs2013/Common/Common.vcxproj @@ -283,6 +283,8 @@ + + @@ -428,7 +430,7 @@ Level3 Disabled MSBUILD_GITREV;WIN32;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions);_DEBUG - $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src false /FS %(AdditionalOptions) 4800;4290;4244;4996;4018 @@ -457,7 +459,7 @@ true true MSBUILD_GITREV;WIN32;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions);NDEBUG - $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src 4800;4290;4244;4996;4018 diff --git a/proj/vs2013/Common/Common.vcxproj.filters b/proj/vs2013/Common/Common.vcxproj.filters index c435cdb1b..b2ab60bae 100644 --- a/proj/vs2013/Common/Common.vcxproj.filters +++ b/proj/vs2013/Common/Common.vcxproj.filters @@ -831,6 +831,8 @@ Scenario + + diff --git a/proj/vs2013/Game/Blades of Exile.vcxproj b/proj/vs2013/Game/Blades of Exile.vcxproj index ade01991f..724e4e802 100644 --- a/proj/vs2013/Game/Blades of Exile.vcxproj +++ b/proj/vs2013/Game/Blades of Exile.vcxproj @@ -56,7 +56,7 @@ MSBUILD_GITREV;WIN32;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions);_DEBUG - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4800;4290;4244;4996;4018 $(SolutionDir)..\..\src\global.hpp @@ -78,7 +78,7 @@ true true MSBUILD_GITREV;WIN32;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions);NDEBUG - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4800;4290;4244;4996;4018 @@ -167,4 +167,4 @@ - \ No newline at end of file + diff --git a/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj b/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj index 3d9d7d5bb..ead8eebfd 100644 --- a/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj +++ b/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj @@ -47,7 +47,7 @@ Level3 Disabled $(SolutionDir)..\..\src\global.hpp - $(SolutionDir)..\..\deps\Catch2\include;$(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\Catch2\include;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) 4800;4290;4244;4996;4018 @@ -63,7 +63,7 @@ MaxSpeed true true - $(SolutionDir)..\..\deps\Catch2\include;$(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\Catch2\include;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) 4800;4290;4244;4996;4018 @@ -81,7 +81,7 @@ Level3 Disabled $(SolutionDir)..\..\src\global.hpp - $(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) 4800;4290;4244;4996;4018 @@ -97,7 +97,7 @@ MaxSpeed true true - $(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) 4800;4290;4244;4996;4018 diff --git a/proj/vs2013/PcEdit/Char Editor.vcxproj b/proj/vs2013/PcEdit/Char Editor.vcxproj index 326998d65..2e0432212 100644 --- a/proj/vs2013/PcEdit/Char Editor.vcxproj +++ b/proj/vs2013/PcEdit/Char Editor.vcxproj @@ -58,7 +58,7 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4800;4290;4244;4996;4018 @@ -82,7 +82,7 @@ true true WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4800;4290;4244;4996;4018 @@ -135,4 +135,4 @@ - \ No newline at end of file + diff --git a/proj/vs2013/ScenEdit/Scen Editor.vcxproj b/proj/vs2013/ScenEdit/Scen Editor.vcxproj index 0c485a18f..edbd60039 100644 --- a/proj/vs2013/ScenEdit/Scen Editor.vcxproj +++ b/proj/vs2013/ScenEdit/Scen Editor.vcxproj @@ -58,7 +58,7 @@ Level3 Disabled WIN32;_DEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4800;4290;4244;4996;4018 @@ -82,7 +82,7 @@ true true WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4800;4290;4244;4996;4018 @@ -148,4 +148,4 @@ - \ No newline at end of file + diff --git a/proj/vs2017/Blades of Exile.vcxproj b/proj/vs2017/Blades of Exile.vcxproj index e6ae5f501..5a8a50e05 100644 --- a/proj/vs2017/Blades of Exile.vcxproj +++ b/proj/vs2017/Blades of Exile.vcxproj @@ -81,7 +81,7 @@ Level3 EditAndContinue Disabled - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp @@ -99,7 +99,7 @@ MultiThreadedDLL Level3 ProgramDatabase - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp @@ -115,7 +115,7 @@ $(SolutionDir)..\..\src\global.hpp - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp Level3 MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions) @@ -134,7 +134,7 @@ $(SolutionDir)..\..\src\global.hpp - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp false Level3 @@ -218,4 +218,4 @@ - \ No newline at end of file + diff --git a/proj/vs2017/Character Editor/Character Editor.vcxproj b/proj/vs2017/Character Editor/Character Editor.vcxproj index 8a576c4ca..bd8b6afa0 100644 --- a/proj/vs2017/Character Editor/Character Editor.vcxproj +++ b/proj/vs2017/Character Editor/Character Editor.vcxproj @@ -82,7 +82,7 @@ Level3 Disabled true - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp @@ -98,7 +98,7 @@ MultiThreadedDebugDLL Level3 Disabled - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp true @@ -118,7 +118,7 @@ true true true - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp @@ -139,7 +139,7 @@ MaxSpeed true true - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp true @@ -184,4 +184,4 @@ - \ No newline at end of file + diff --git a/proj/vs2017/Common/Common.vcxproj b/proj/vs2017/Common/Common.vcxproj index d2c0b4f87..6df9881a6 100644 --- a/proj/vs2017/Common/Common.vcxproj +++ b/proj/vs2017/Common/Common.vcxproj @@ -91,7 +91,7 @@ MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX - $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src MachineX86 @@ -106,7 +106,7 @@ true MultiThreadedDebugDLL MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX - $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp @@ -129,7 +129,7 @@ MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX - $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src MachineX86 @@ -149,7 +149,7 @@ true MultiThreadedDLL MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX - $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp @@ -439,6 +439,8 @@ + + diff --git a/proj/vs2017/Common/Common.vcxproj.filters b/proj/vs2017/Common/Common.vcxproj.filters index 30cb6bea4..cec5bfb77 100644 --- a/proj/vs2017/Common/Common.vcxproj.filters +++ b/proj/vs2017/Common/Common.vcxproj.filters @@ -824,6 +824,8 @@ Scenario + + diff --git a/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj b/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj index 08809b003..50fb0cd3c 100644 --- a/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj +++ b/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj @@ -81,7 +81,7 @@ Disabled true $(SolutionDir)..\..\src\global.hpp - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4996 @@ -98,7 +98,7 @@ Level3 Disabled $(SolutionDir)..\..\src\global.hpp - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp true @@ -119,7 +119,7 @@ true true $(SolutionDir)..\..\src\global.hpp - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4996 @@ -140,7 +140,7 @@ MaxSpeed true true - $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus + $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp true @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/proj/vs2017/Tests/Tests.vcxproj b/proj/vs2017/Tests/Tests.vcxproj index 1387c442b..01b92e677 100644 --- a/proj/vs2017/Tests/Tests.vcxproj +++ b/proj/vs2017/Tests/Tests.vcxproj @@ -97,7 +97,7 @@ MultiThreadedDebugDLL Level3 Disabled - $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src true stdafx.h $(IntDir)$(TargetName).pch @@ -117,7 +117,7 @@ MultiThreadedDebugDLL Level3 Disabled - $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src true @@ -139,7 +139,7 @@ MaxSpeed true true - $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src true stdafx.h $(IntDir)$(TargetName).pch @@ -164,7 +164,7 @@ MaxSpeed true true - $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src %(PreprocessorDefinitions) true @@ -227,4 +227,4 @@ - \ No newline at end of file + From 77355a7e13790bd60896c4303da0f20ab1bc1457 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 2 Aug 2025 15:55:13 -0400 Subject: [PATCH 04/24] Convert some buffer messages to use fmtlib. --- src/game/boe.actions.cpp | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 77368b150..8bb52761f 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "boe.global.hpp" #include "tools/replay.hpp" @@ -833,7 +834,7 @@ void handle_talk(location destination, bool& did_something, bool& need_redraw, b if(small_talk > 1000 && small_talk < 1000 + univ.scenario.spec_strs.size()) str = univ.scenario.spec_strs[small_talk - 1000]; // TODO: Come up with a set of pre-cooked responses. - add_string_to_buf("Talk: " + str, 4); + add_string_to_buf(fmt::format("Talk: {}", str), 4); } else if(univ.town.monst[i].is_alive()) { start_talk_mode(i,univ.town.monst[i].personality,univ.town.monst[i].number,univ.town.monst[i].facial_pic); did_something = false; @@ -1006,7 +1007,7 @@ void handle_switch_pc(short which_pc, bool& need_redraw, bool& need_reprint) { cPlayer& pc = univ.party[which_pc]; if(!prime_time() && overall_mode != MODE_SHOPPING && overall_mode != MODE_TALKING && overall_mode != MODE_ITEM_TARGET) - add_string_to_buf("Set active: " + FINISH_FIRST); + add_string_to_buf(fmt::format("Set active: {}", FINISH_FIRST)); else if(is_combat()) { if(univ.debug_mode && pc.ap <= 0){ pc.ap = 4; @@ -1031,7 +1032,7 @@ void handle_switch_pc(short which_pc, bool& need_redraw, bool& need_reprint) { store_cur_pc = -1; set_stat_window_for_pc(which_pc); - add_string_to_buf("Now " + std::string(overall_mode == MODE_SHOPPING ? "shopping" : "active") + ": " + pc.name); + add_string_to_buf(fmt::format(overall_mode == MODE_SHOPPING ? "Now shopping: {}" : "Now active: {}", pc.name)); adjust_spell_menus(); need_redraw = true; } @@ -1045,14 +1046,14 @@ void handle_switch_pc_items(short which_pc, bool& need_redraw) { cPlayer& pc = univ.party[which_pc]; if(!prime_time() && overall_mode != MODE_TALKING && overall_mode != MODE_SHOPPING) - add_string_to_buf("Set active: " + FINISH_FIRST); + add_string_to_buf(fmt::format("Set active: {}", FINISH_FIRST)); else { if(!is_combat()) { if(pc.main_status != eMainStatus::ALIVE && (overall_mode != MODE_SHOPPING || active_shop.getType() != eShopType::ALLOW_DEAD)) add_string_to_buf("Set active: PC must be here & active."); else { univ.cur_pc = which_pc; - add_string_to_buf("Now active: " + pc.name); + add_string_to_buf(fmt::format("Now active: {}", pc.name)); adjust_spell_menus(); need_redraw = true; } @@ -1083,7 +1084,7 @@ void handle_equip_item(short item_hit, bool& need_redraw) { } else if(stat_screen_mode > MODE_SHOP) { // TODO: For some reason, the game didn't do anything at all in this case. // I'm not sure why; maybe it intended to forward to the sell button? - } else add_string_to_buf("Equip: " + FINISH_FIRST); + } else add_string_to_buf(fmt::format("Equip: {}", FINISH_FIRST)); } void handle_use_item(short item_hit, bool& did_something, bool& need_redraw) { @@ -1092,7 +1093,7 @@ void handle_use_item(short item_hit, bool& did_something, bool& need_redraw) { } if(!prime_time()) { - add_string_to_buf("Use item: " + FINISH_FIRST); + add_string_to_buf(fmt::format("Use item: {}", FINISH_FIRST)); return; } use_item(stat_window, item_hit); @@ -1108,7 +1109,7 @@ void handle_give_item(short item_hit, bool& did_something, bool& need_redraw) { } if(!prime_time()) { - add_string_to_buf("Give item: " + FINISH_FIRST); + add_string_to_buf(fmt::format("Give item: {}", FINISH_FIRST)); return; } give_thing(stat_window, item_hit); @@ -1126,7 +1127,7 @@ void handle_drop_item(short item_hit, bool& need_redraw) { add_string_to_buf("Drop item: Cancelled"); overall_mode = is_town() ? MODE_TOWN : MODE_COMBAT; } else if(!prime_time()) - add_string_to_buf("Drop item: " + FINISH_FIRST); + add_string_to_buf(fmt::format("Drop item: {}", FINISH_FIRST)); else if(is_out()) drop_item(stat_window,item_hit,univ.party.out_loc); else { @@ -1226,7 +1227,7 @@ void handle_alchemy(bool& need_redraw, bool& need_reprint) { } else if(is_combat()) add_string_to_buf("Alchemy: Not in combat."); else if(!is_town()) add_string_to_buf("Alchemy: Only in town."); - else add_string_to_buf("Alchemy: " + FINISH_FIRST); + else add_string_to_buf(fmt::format("Alchemy: {}", FINISH_FIRST)); } static void handle_town_wait(bool& need_redraw, bool& need_reprint) { @@ -1297,7 +1298,7 @@ void handle_wait(bool& did_something, bool& need_redraw, bool& need_reprint) { handle_stand_ready(need_redraw, need_reprint); advance_time(did_something, need_redraw, need_reprint); } else { - add_string_to_buf("Wait: " + FINISH_FIRST); + add_string_to_buf(fmt::format("Wait: {}", FINISH_FIRST)); print_buf(); } } @@ -1506,7 +1507,7 @@ void handle_trade_places(int which_pc, bool& need_reprint) { record_action("handle_trade_places", boost::lexical_cast(which_pc)); } if(!prime_time()) - add_string_to_buf("Trade places: " + FINISH_FIRST, 2); + add_string_to_buf(fmt::format("Trade places: {}", FINISH_FIRST), 2); else if(is_combat()) add_string_to_buf("Trade places: Can't do this in combat."); else { @@ -1994,7 +1995,7 @@ void handle_menu_spell(eSpell spell_picked) { eSkill spell_type = (*spell_picked).type; if(!prime_time()) { - ASB("Cast: " + FINISH_FIRST); + ASB(fmt::format("Cast: {}", FINISH_FIRST)); print_buf(); return; } @@ -2162,11 +2163,11 @@ void debug_give_item() { bool given = univ.current_pc().give_item(univ.scenario.scen_items[i], GIVE_DO_PRINT | GIVE_ALLOW_OVERLOAD) == eBuyStatus::OK; if(!given){ - ASB("Debug: can't give to " + univ.current_pc().name); + ASB(fmt::format("Debug: can't give to {}", univ.current_pc().name)); given = univ.party.give_item(univ.scenario.scen_items[i], GIVE_DO_PRINT | GIVE_ALLOW_OVERLOAD); } if(!given) - ASB("Debug: can't give anyone " + univ.scenario.scen_items[i].full_name); + ASB(fmt::format("Debug: can't give anyone {}", univ.scenario.scen_items[i].full_name)); univ.scenario.scen_items[i].ident = was_ident; print_buf(); @@ -2186,9 +2187,9 @@ void debug_overburden() { // Give the PC very heavy objects that do nothing: while(pc.give_item(item, GIVE_ALLOW_OVERLOAD) == eBuyStatus::OK){} if(pc.has_space()){ - ASB("Debug: failed to fill " + pc.name + "'s inventory."); + ASB(fmt::format("Debug: failed to fill {}'s inventory.", pc.name)); }else{ - ASB("Debug: filled " + pc.name + "'s inventory."); + ASB(fmt::format("Debug: filled {}'s inventory.", pc.name)); } print_buf(); stat_window = eItemWinMode(univ.cur_pc); @@ -3009,7 +3010,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){ else if(is_out()) ASB("Use: not outdoors"); else - ASB("Use: " + FINISH_FIRST); + ASB(fmt::format("Use: {}", FINISH_FIRST)); break; case 'b': // Bash door @@ -3020,7 +3021,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){ else if(is_out()) ASB("Bash Door: not outdoors"); else - ASB("Bash Door: " + FINISH_FIRST); + ASB(fmt::format("Bash Door: {}", FINISH_FIRST)); break; case 'L': // Pick lock @@ -3031,7 +3032,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){ else if(is_out()) ASB("Pick Lock: not outdoors"); else - ASB("Pick Lock: " + FINISH_FIRST); + ASB(fmt::format("Pick Lock: {}", FINISH_FIRST)); break; case 'A': // Alchemy @@ -3605,7 +3606,7 @@ void handle_drop_pc() { record_action("handle_drop_pc", ""); } if(!prime_time()) { - ASB("Delete PC: " + FINISH_FIRST); + ASB(fmt::format("Delete PC: {}", FINISH_FIRST)); print_buf(); }else if(is_combat()){ add_string_to_buf("Delete PC: Not in combat."); @@ -3874,7 +3875,7 @@ static void run_waterfalls(short mode){ // mode 0 - town, 1 - outdoors if(lost >= ter.flag3) { lost = ter.flag3; add_string_to_buf(" (Many supplies lost.)"); - } else add_string_to_buf(" (" + std::to_string(lost) + " supplies lost.)"); + } else add_string_to_buf(fmt::format(" ({} supplies lost.)", lost)); univ.party.food -= lost; } put_pc_screen(); @@ -4074,7 +4075,7 @@ bool outd_move_party(location destination,bool forced) { univ.party.i_w_c.x = (univ.party.out_loc.x > 47) ? 1 : 0; univ.party.i_w_c.y = (univ.party.out_loc.y > 47) ? 1 : 0; univ.party.loc_in_sec = global_to_local(univ.party.out_loc); - add_string_to_buf("Moved: " + dir_str); + add_string_to_buf(fmt::format("Moved: {}", dir_str)); move_sound(univ.out[real_dest.x][real_dest.y],num_out_moves); num_out_moves++; @@ -4096,7 +4097,7 @@ bool outd_move_party(location destination,bool forced) { return true; } else { - add_string_to_buf("Blocked: " + dir_str); + add_string_to_buf(fmt::format("Blocked: {}", dir_str)); return false; } } @@ -4203,7 +4204,7 @@ bool town_move_party(location destination,short forced) { } univ.party.town_loc = destination; - add_string_to_buf("Moved: " + dir_str); + add_string_to_buf(fmt::format("Moved: {}", dir_str)); // place_treasure(destination,5,3); move_sound(univ.town->terrain(destination.x,destination.y),(short) univ.party.age); @@ -4359,7 +4360,7 @@ void preview_every_dialog_xml() { std::string confirm = dlog.show(); if(confirm == "yes"){ std::for_each(dialog_paths.begin(), dialog_paths.end(), [](fs::path path) { - LOG("Previewing dialog: " + path.stem().string()); + LOG(fmt::format("Previewing dialog: {}", path.stem().string())); preview_dialog_xml(path); }); } From d71229c51ceddc8cf9ab53da01ae2a1d0f77d55a Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 2 Aug 2025 21:51:45 -0400 Subject: [PATCH 05/24] Convert more buffer messages to fmtlib --- src/game/boe.combat.cpp | 76 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/game/boe.combat.cpp b/src/game/boe.combat.cpp index d93a044d1..8371fd155 100644 --- a/src/game/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -1,5 +1,6 @@ #include +#include #include "boe.global.hpp" @@ -459,67 +460,67 @@ static void apply_weapon_status(eStatus status, int how_much, int dmg, iLiving& switch(status) { case eStatus::MAIN: break; // Not a valid status case eStatus::INVISIBLE: - add_string_to_buf(" " + weap_type + " leaks an odd-coloured aura."); + add_string_to_buf(fmt::format(" {} leaks an odd-coloured aura.", weap_type)); which_m.apply_status(eStatus::INVISIBLE, how_much / -2); break; case eStatus::MAGIC_RESISTANCE: - add_string_to_buf(" " + weap_type + " leaks an odd-coloured aura."); + add_string_to_buf(fmt::format(" {} leaks an odd-coloured aura.", weap_type)); which_m.apply_status(eStatus::MAGIC_RESISTANCE, how_much / -2); break; case eStatus::INVULNERABLE: - add_string_to_buf(" " + weap_type + " leaks an odd-coloured aura."); + add_string_to_buf(fmt::format(" {} leaks an odd-coloured aura.", weap_type)); which_m.apply_status(eStatus::INVULNERABLE, how_much / -2); break; case eStatus::POISONED_WEAPON: - add_string_to_buf(" " + weap_type + " leaks an odd-coloured aura."); + add_string_to_buf(fmt::format(" {} leaks an odd-coloured aura.", weap_type)); which_m.apply_status(eStatus::POISONED_WEAPON, how_much / -2); break; case eStatus::POISON: - add_string_to_buf(" " + weap_type + " drips venom."); + add_string_to_buf(fmt::format(" {} drips venom.", weap_type)); which_m.poison(how_much / 2); break; case eStatus::ACID: - add_string_to_buf(" " + weap_type + " drips acid."); + add_string_to_buf(fmt::format(" {} drips acid.", weap_type)); which_m.acid(how_much / 2); break; case eStatus::BLESS_CURSE: - add_string_to_buf(" " + weap_type + " leaks a dark aura."); + add_string_to_buf(fmt::format(" {} leaks a dark aura.", weap_type)); which_m.curse(how_much / 2); break; case eStatus::HASTE_SLOW: - add_string_to_buf(" " + weap_type + " leaks a smoky aura."); + add_string_to_buf(fmt::format(" {} leaks a smoky aura.", weap_type)); which_m.slow(how_much / 2); break; case eStatus::WEBS: - add_string_to_buf(" " + weap_type + " drips goo."); + add_string_to_buf(fmt::format(" {} drips goo.", weap_type)); which_m.web(how_much / 2); break; case eStatus::DISEASE: - add_string_to_buf(" " + weap_type + " drips bile."); + add_string_to_buf(fmt::format(" {} drips bile.", weap_type)); which_m.disease(how_much / 2); break; case eStatus::DUMB: - add_string_to_buf(" " + weap_type + " leaks a misty aura."); + add_string_to_buf(fmt::format(" {} leaks a misty aura.", weap_type)); which_m.dumbfound(how_much / 2); break; case eStatus::ASLEEP: - add_string_to_buf(" " + weap_type + " emits coruscating lights."); + add_string_to_buf(fmt::format(" {} emits coruscating lights.", weap_type)); which_m.sleep(eStatus::ASLEEP, how_much / 2, 20 + dmg); break; case eStatus::PARALYZED: - add_string_to_buf(" " + weap_type + " emits a purple flash."); + add_string_to_buf(fmt::format(" {} emits a purple flash.", weap_type)); which_m.sleep(eStatus::PARALYZED, how_much / 2, 20 + dmg); break; case eStatus::CHARM: - add_string_to_buf(" " + weap_type + " leaks a bright aura."); + add_string_to_buf(fmt::format(" {} leaks a bright aura.", weap_type)); which_m.sleep(eStatus::CHARM, 0, 20 + dmg - how_much / 2); break; case eStatus::FORCECAGE: - add_string_to_buf(" " + weap_type + " emits a green flash."); + add_string_to_buf(fmt::format(" {} emits a green flash.", weap_type)); which_m.sleep(eStatus::FORCECAGE, how_much, dmg - how_much / 2); break; case eStatus::MARTYRS_SHIELD: - add_string_to_buf(" " + weap_type + " leaks an odd-coloured aura."); + add_string_to_buf(fmt::format(" {} leaks an odd-coloured aura.", weap_type)); which_m.apply_status(eStatus::MARTYRS_SHIELD, how_much / -2); break; } @@ -708,8 +709,7 @@ void pc_attack_weapon(short who_att,iLiving& target,short hit_adj,short dam_adj, } else { draw_terrain(2); - create_line = " " + attacker.name + " misses."; - add_string_to_buf(create_line); + add_string_to_buf(fmt::format(" {} misses.", attacker.name)); if(weap.weap_type == eSkill::POLE_WEAPONS) play_sound(19); else play_sound(2); @@ -1183,7 +1183,7 @@ void do_combat_cast(location target) { } break; default: - add_string_to_buf(" Error: Summoning spell " + (*spell_being_cast).name() + " not implemented for combat mode.", 4); + add_string_to_buf(fmt::format(" Error: Summoning spell {} not implemented for combat mode.", (*spell_being_cast).name()), 4); break; } break; @@ -1398,7 +1398,7 @@ void do_combat_cast(location target) { store_sound = 24; break; default: - add_string_to_buf(" Error: Spell " + (*spell_being_cast).name() + " not implemented for combat mode.", 4); + add_string_to_buf(fmt::format(" Error: Spell not implemented for combat mode. {}", (*spell_being_cast).name()), 4); break; } if(store_m_type >= 0) { @@ -3577,7 +3577,7 @@ bool monst_cast_mage(cCreature *caster,short targ) { do_shockwave(caster->cur_loc); break; default: - add_string_to_buf(" Error: Mage spell " + (*spell).name() + " not implemented for monsters.", 4); + add_string_to_buf(fmt::format(" Error: Mage spell {} not implemented for monsters.", (*spell).name()), 4); break; } } @@ -3836,7 +3836,7 @@ bool monst_cast_priest(cCreature *caster,short targ) { case eSpell::HEAL_MAJOR: r1 = get_ran(5,1,6) + 3; break; case eSpell::HEAL_ALL: r1 = 50; break; default: - add_string_to_buf(" Error: Healing spell " + (*spell).name() + " not implemented for monsters.", 4); + add_string_to_buf(fmt::format(" Error: Healing spell {} not implemented for monsters.", (*spell).name()), 4); break; } caster->heal(r1); @@ -3886,7 +3886,7 @@ bool monst_cast_priest(cCreature *caster,short targ) { // doesn't describe fire or combustion, only force. break; default: - add_string_to_buf(" Error: Priest spell " + (*spell).name() + " not implemented for monsters.", 4); + add_string_to_buf(fmt::format(" Error: Priest spell {} not implemented for monsters.", (*spell).name()), 4); break; } @@ -4472,7 +4472,7 @@ void handle_disease() { adjust_spell_menus(); break; case 9: case 10: - add_string_to_buf(" " + pc.name + " unaffected."); + add_string_to_buf(fmt::format(" {} unaffected.", pc.name)); break; } r1 = get_ran(1,0,7); @@ -4670,32 +4670,32 @@ void combat_immed_mage_cast(short current_pc, eSpell spell_num, bool freebie) { if(!freebie) caster.cur_sp -= (*spell_num).cost; play_sound(4); - std::string c_line = " " + target_pc.name; + std::string c_line; switch(spell_num) { case eSpell::ENVENOM: - c_line += " receives venom."; + c_line += " {} receives venom."; poison_weapon(target,3 + bonus,true); store_m_type = 11; break; case eSpell::STRENGTH: - c_line += " stronger."; + c_line += " {} stronger."; target_pc.curse(-3); store_m_type = 8; break; case eSpell::RESIST_MAGIC: - c_line += " resistant."; + c_line += " {} resistant."; target_pc.status[eStatus::MAGIC_RESISTANCE] += 5 + bonus; store_m_type = 15; break; default: target_pc.slow((spell_num == eSpell::HASTE_MINOR) ? -2 : -max(2,level / 2 + bonus)); - c_line += " hasted."; + c_line += " {} hasted."; store_m_type = 8; break; } - add_string_to_buf(c_line); + add_string_to_buf(fmt::format(c_line, target_pc.name)); add_missile(target_pc.combat_pos,store_m_type,0,0,0); } break; @@ -4739,7 +4739,7 @@ void combat_immed_mage_cast(short current_pc, eSpell spell_num, bool freebie) { case eSpell::PARALYSIS_MASS: add_string_to_buf(" Enemy paralyzed:"); break; case eSpell::SLEEP_MASS: add_string_to_buf(" Enemy drowsy:"); break; default: - add_string_to_buf(" Error: Mage group spell " + (*spell_num).name() + " not implemented for combat mode.", 4); + add_string_to_buf(fmt::format(" Error: Mage group spell {} not implemented for combat mode.", (*spell_num).name()), 4); break; } for(short i = 0; i < univ.town.monst.size(); i++) { @@ -4784,7 +4784,7 @@ void combat_immed_mage_cast(short current_pc, eSpell spell_num, bool freebie) { place_spell_pattern(PAT_OPENSQ, caster.combat_pos, eDamageType::FIRE, 6, current_pc); break; default: - add_string_to_buf(" Error: Mage spell " + (*spell_num).name() + " not implemented for combat mode.", 4); + add_string_to_buf(fmt::format(" Error: Mage spell {} not implemented for combat mode.", (*spell_num).name()), 4); break; } if(num_opp < 10) @@ -4882,7 +4882,7 @@ void combat_immed_priest_cast(short current_pc, eSpell spell_num, bool freebie) case eSpell::AVATAR: if(!freebie) caster.cur_sp -= (*spell_num).cost; - add_string_to_buf(" " + caster.name + " is an avatar!"); + add_string_to_buf(fmt::format(" {} is an avatar!", caster.name)); caster.avatar(); break; @@ -4914,7 +4914,7 @@ void combat_immed_priest_cast(short current_pc, eSpell spell_num, bool freebie) store_m_type = 0; break; default: - add_string_to_buf(" Error: Priest group spell " + (*spell_num).name() + " not implemented for combat mode.", 4); + add_string_to_buf(fmt::format(" Error: Priest group spell {} not implemented for combat mode.", (*spell_num).name()), 4); break; } num_opp++; @@ -4949,7 +4949,7 @@ void combat_immed_priest_cast(short current_pc, eSpell spell_num, bool freebie) } break; default: - add_string_to_buf(" Error: Priest spell " + (*spell_num).name() + " not implemented for combat mode.", 4); + add_string_to_buf(fmt::format(" Error: Priest spell {} not implemented for combat mode.", (*spell_num).name()), 4); break; } if(num_opp < 10) @@ -4997,7 +4997,7 @@ void start_spell_targeting(eSpell num, bool freebie, int spell_range, eSpellPat default: pat = PAT_SINGLE; if((*num).refer != REFER_TARGET) - add_string_to_buf(" Error: Entered targeting for non-targeted spell " + (*num).name(), 4); + add_string_to_buf(fmt::format(" Error: Entered targeting for non-targeted spell {}", (*num).name()), 4); break; } @@ -5067,7 +5067,7 @@ void start_fancy_spell_targeting(eSpell num, bool freebie, int spell_range, eSpe default: if((*num).refer == REFER_FANCY) std::cout << " Warning: Spell " << (*num).name() << " didn't assign target shape and count." << std::endl; - else add_string_to_buf(" Error: Entered fancy targeting for non-fancy-targeted spell " + (*num).name(), 4); + else add_string_to_buf(fmt::format(" Error: Entered fancy targeting for non-fancy-targeted spell {}", (*num).name()), 4); pat = PAT_SINGLE; break; } @@ -5141,7 +5141,7 @@ void process_force_cage(location loc, short i, short adjust) { short bonus = 5 + who.skill(eSkill::MAGE_LORE) + adjust; if(get_ran(1,1,100) < who.skill(eSkill::MAGE_SPELLS)*10 + who.skill(eSkill::PRIEST_SPELLS)*4 + bonus) { play_sound(60); - add_string_to_buf(" " + who.name + " breaks force cage."); + add_string_to_buf(fmt::format(" {} breaks force cage.", who.name)); break_force_cage(loc); } } From 9ee81fa59cd36493c7995417434833b4b9eef9e8 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 2 Aug 2025 22:50:46 -0400 Subject: [PATCH 06/24] Rework spell notes and several other common messages. * Spell notes are now an enum instead of a magic integer. * The functions are now defined in iLiving instead of cCreature, meaning they can be called on PCs. * They now use fmtlib to interpolate the name. * A creature attacking themself now prints "Name attacks themself" instead of "Name attacks Name". --- src/game/boe.combat.cpp | 46 +++---- src/game/boe.monster.cpp | 12 +- src/game/boe.party.cpp | 2 +- src/game/boe.specials.cpp | 28 ++-- src/universe/creature.cpp | 281 ++++---------------------------------- src/universe/creature.hpp | 7 +- src/universe/living.cpp | 222 ++++++++++++++++++++++++++++++ src/universe/living.hpp | 23 ++++ src/universe/party.cpp | 4 + src/universe/party.hpp | 1 + src/universe/pc.cpp | 6 +- src/universe/pc.hpp | 1 + 12 files changed, 327 insertions(+), 306 deletions(-) diff --git a/src/game/boe.combat.cpp b/src/game/boe.combat.cpp index 8371fd155..3d291ab0f 100644 --- a/src/game/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -2156,7 +2156,7 @@ void do_monster_turn() { if(cur_monst->summon_time == 1) { cur_monst->active = eCreatureStatus::DEAD; cur_monst->ap = 0; - cur_monst->spell_note(17); + cur_monst->spell_note(eSpellNote::DISAPPEARS); } move_to_zero(cur_monst->summon_time); } @@ -2529,7 +2529,7 @@ void do_monster_turn() { if(what_summon) r1 = get_ran(1, abil.summon.min, abil.summon.max); else r1 = 0; if(r1 && summon_monster(what_summon, cur_monst->cur_loc,abil.summon.len,cur_monst->attitude,cur_monst->is_friendly())) { - cur_monst->spell_note(33); + cur_monst->spell_note(eSpellNote::SUMMONS); play_sound(61); bool failed = false; while(--r1 && !failed) { @@ -2578,7 +2578,7 @@ void do_monster_turn() { } if(cur_monst->status[eStatus::ASLEEP] == 1) - cur_monst->spell_note(29); + cur_monst->spell_note(eSpellNote::AWAKE); move_to_zero(cur_monst->status[eStatus::ASLEEP]); move_to_zero(cur_monst->status[eStatus::PARALYZED]); move_to_zero(cur_monst->status[eStatus::INVISIBLE]); @@ -2660,7 +2660,7 @@ void monster_attack(short who_att,iLiving* target) { for(const auto& att : attacker->a) if(att.dice != 0) { - attacker->print_attacks(target); + attacker->print_attacks(*target); break; } @@ -2903,44 +2903,44 @@ void monst_fire_missile(short m_num,short bless,std::pair a if(pc_target != nullptr) add_string_to_buf(" Shoots at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(12); + m_target->spell_note(eSpellNote::SHOOTS); break; case eMonstMissile::SPEAR: if(pc_target != nullptr) add_string_to_buf(" Throws spear at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(13); + m_target->spell_note(eSpellNote::THROWS_SPEAR); break; case eMonstMissile::RAZORDISK: if(pc_target != nullptr) add_string_to_buf(" Throws razordisk at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(15); + m_target->spell_note(eSpellNote::THROWS_RAZORDISK); break; case eMonstMissile::SPINE: if(pc_target != nullptr) add_string_to_buf(" Fires spines at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(32); + m_target->spell_note(eSpellNote::SPINES); break; case eMonstMissile::DART: if(pc_target != nullptr) add_string_to_buf(" Throws dart at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(53); + m_target->spell_note(eSpellNote::THROWS_DART); break; case eMonstMissile::ROCK: case eMonstMissile::BOULDER: if(pc_target != nullptr) add_string_to_buf(" Throws rock at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(14); + m_target->spell_note(eSpellNote::THROWS_ROCK); break; case eMonstMissile::KNIFE: if(pc_target != nullptr) add_string_to_buf(" Throws knife at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(54); + m_target->spell_note(eSpellNote::THROWS_KNIFE); break; } if(abil.second.missile.type == eMonstMissile::ARROW || abil.second.missile.type == eMonstMissile::RAPID_ARROW || abil.second.missile.type == eMonstMissile::BOLT) @@ -2972,14 +2972,14 @@ void monst_fire_missile(short m_num,short bless,std::pair a // TODO: Should we pass in the monster's actual race here? damage_pc(*pc_target,r2,eDamageType::WEAPON,eRace::UNKNOWN,13); } else if(m_target != nullptr) { - m_target->spell_note(16); + m_target->spell_note(eSpellNote::HITS); damage_monst(*m_target,7,r2,eDamageType::WEAPON,13); } } else { if(pc_target != nullptr) add_string_to_buf(" Misses " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(18); + m_target->spell_note(eSpellNote::MISSES); } if(pc_target != nullptr) { if(cInvenSlot spec_item = pc_target->has_abil_equip(eItemAbil::HIT_CALL_SPECIAL)) { @@ -3005,13 +3005,13 @@ void monst_fire_missile(short m_num,short bless,std::pair a if(pc_target != nullptr) add_string_to_buf(" Throws web at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(58); + m_target->spell_note(eSpellNote::THROWS_WEB); run_a_missile(source, targ_space, 8, 0, 14, 0, 0, 100); web_space(targ_space.x, targ_space.y); } else if(abil.first == eMonstAbil::RAY_HEAT) { if(pc_target != nullptr) add_string_to_buf(" Hits " + pc_target->name + " with heat ray!"); else if(m_target != nullptr) - m_target->spell_note(55); + m_target->spell_note(eSpellNote::FIRES_RAY); run_a_missile(source, targ_space, 13, 0, 51, 0, 0, 100); uAbility proxy = {true}; proxy.gen.strength = abil.second.special.extra3; @@ -3063,21 +3063,21 @@ void monst_fire_missile(short m_num,short bless,std::pair a if(pc_target != nullptr) add_string_to_buf(" Fires ray at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(55); + m_target->spell_note(eSpellNote::FIRES_RAY); break; case eMonstGen::GAZE: snd = 43; if(pc_target != nullptr) add_string_to_buf(" Gazes at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(56); + m_target->spell_note(eSpellNote::GAZES2); break; case eMonstGen::BREATH: snd = 44; if(pc_target != nullptr) add_string_to_buf(" Breathes on " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(57); + m_target->spell_note(eSpellNote::BREATHES_ON); break; case eMonstGen::SPIT: path_type = 1; @@ -3085,7 +3085,7 @@ void monst_fire_missile(short m_num,short bless,std::pair a if(pc_target != nullptr) add_string_to_buf(" Spits at " + pc_target->name + '.'); else if(m_target != nullptr) - m_target->spell_note(59); + m_target->spell_note(eSpellNote::SPITS); break; } if(abil.second.gen.pic < 0) play_sound(snd); @@ -3188,7 +3188,7 @@ void monst_basic_abil(short m_num, std::pair abil, iLiving* add_string_to_buf(" Drains " + pc_target->name + '.'); pc_target->cur_sp = percent(pc_target->cur_sp, abil.second.gen.strength); } else { - m_target->spell_note(11); + m_target->spell_note(eSpellNote::DRAINS); // TODO: If mp < 4 it used to set monster's skill to 1. Should that be restored? m_target->mp = percent(m_target->mp, abil.second.gen.strength); } @@ -3246,7 +3246,7 @@ bool monst_breathe(cCreature *caster,location targ_space,uAbility abil) { run_a_missile(l,targ_space,abil.gen.pic,0,44,0,0,100); else play_sound(44); - caster->breathe_note(); + caster->spell_note(eSpellNote::BREATHES); short level = get_ran(abil.gen.strength,1,8); if(!is_combat()) level = level / 3; @@ -3873,7 +3873,7 @@ bool monst_cast_priest(cCreature *caster,short targ) { break; case eSpell::AVATAR: play_sound(24); - caster->spell_note(26); + caster->spell_note(eSpellNote::AVATAR); caster->avatar(); break; case eSpell::DIVINE_THUD: @@ -5121,7 +5121,7 @@ void process_force_cage(location loc, short i, short adjust) { if(!which_m.is_friendly() && get_ran(1,1,100) < which_m.mu * 10 + which_m.cl * 4 + 5 + adjust) { // TODO: This sound is not right play_sound(60); - which_m.spell_note(50); + which_m.spell_note(eSpellNote::BREAKS_FORCECAGE); break_force_cage(loc); } } else if(i < 0) { diff --git a/src/game/boe.monster.cpp b/src/game/boe.monster.cpp index 52320bd4a..4d9b160ff 100644 --- a/src/game/boe.monster.cpp +++ b/src/game/boe.monster.cpp @@ -850,7 +850,7 @@ void monst_inflict_fields(short which_monst) { break; } if(univ.town.is_web(where_check.x,where_check.y) && which_m->m_type != eRace::BUG) { - which_m->spell_note(19); + which_m->spell_note(eSpellNote::WEBBED); r1 = get_ran(1,2,3); which_m->web(r1); univ.town.set_web(where_check.x,where_check.y,false); @@ -967,7 +967,7 @@ static bool monst_check_one_special_terrain(location where_check,short mode,shor // Monster breaks the barrier // TODO: Are these barrier sounds right? play_sound(60); - which_m->spell_note(49); + which_m->spell_note(eSpellNote::BREAKS_BARRIER); univ.town.set_fire_barr(where_check.x,where_check.y,false); } else { @@ -982,7 +982,7 @@ static bool monst_check_one_special_terrain(location where_check,short mode,shor && (!univ.town->strong_barriers)) { // Monster breaks the barrier play_sound(60); - which_m->spell_note(49); + which_m->spell_note(eSpellNote::BREAKS_BARRIER); univ.town.set_force_barr(where_check.x,where_check.y,false); } else can_enter = false; @@ -1094,11 +1094,11 @@ void record_monst(cCreature* which_m, bool forced) { // TODO: Are these two sounds right? else if(r1 > cCreature::charm_odds[which_m->level / 2] || which_m->abil[eMonstAbil::SPLITS].active || which_m->m_type == eRace::IMPORTANT) { - which_m->spell_note(10); + which_m->spell_note(eSpellNote::RESISTS); play_sound(68); } else { - which_m->spell_note(24); + which_m->spell_note(eSpellNote::RECORDED); r1 = get_ran(1,0,univ.party.imprisoned_monst.size() - 1); if(univ.party.imprisoned_monst[r1] == 0) univ.party.imprisoned_monst[r1] = which_m->number; @@ -1183,7 +1183,7 @@ bool summon_monster(mon_num_t which,location where,short duration,eAttitude give univ.town.monst[spot].summon_time = duration; univ.town.monst[spot].party_summoned = by_party; - univ.town.monst[spot].spell_note(21); + univ.town.monst[spot].spell_note(eSpellNote::SUMMONED); return true; } diff --git a/src/game/boe.party.cpp b/src/game/boe.party.cpp index 95262d51b..fee2e61b7 100644 --- a/src/game/boe.party.cpp +++ b/src/game/boe.party.cpp @@ -1520,7 +1520,7 @@ void do_mindduel(short pc_num,cCreature *monst) { balance--; if(monst->mp == 0) { monst->status[eStatus::DUMB] += 2; - monst->spell_note(22); + monst->spell_note(eSpellNote::DUMBFOUNDED); if(monst->status[eStatus::DUMB] > 7) { kill_monst(*monst,pc_num); } diff --git a/src/game/boe.specials.cpp b/src/game/boe.specials.cpp index 97036a6ed..87ee53861 100644 --- a/src/game/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -1512,7 +1512,7 @@ short damage_monst(cCreature& victim, short who_hit, short how_much, eDamageType if(how_much <= 0) { if(is_combat()) - victim.spell_note(7); + victim.spell_note(eSpellNote::UNDAMAGED); if(how_much <= 0 && (dam_type == eDamageType::WEAPON || dam_type == eDamageType::UNDEAD || dam_type == eDamageType::DEMON)) { draw_terrain(2); play_sound(2); @@ -1536,7 +1536,7 @@ short damage_monst(cCreature& victim, short who_hit, short how_much, eDamageType if((which_spot = place_monster(victim.number,where_put)) < univ.town.monst.size()) { static_cast(univ.town.monst[which_spot]) = victim; univ.town.monst[which_spot].health = victim.health; - victim.spell_note(27); + victim.spell_note(eSpellNote::SPLITS); } } if(who_hit < 7) @@ -1555,7 +1555,7 @@ short damage_monst(cCreature& victim, short who_hit, short how_much, eDamageType } if(victim.health < 0) { - victim.killed_msg(); + victim.spell_note(eSpellNote::DIES); kill_monst(victim,who_hit); } else { @@ -1580,7 +1580,7 @@ short damage_monst(cCreature& victim, short who_hit, short how_much, eDamageType } void petrify_monst(cCreature& which_m,int strength) { - which_m.spell_note(9); + which_m.spell_note(eSpellNote::GAZES); short r1 = get_ran(1,0,20); r1 += which_m.level / 4; r1 += which_m.status[eStatus::BLESS_CURSE]; @@ -1588,9 +1588,9 @@ void petrify_monst(cCreature& which_m,int strength) { // TODO: This should probably do something similar to charm_monst with the magic resistance if(r1 > 14 || which_m.resist[eDamageType::MAGIC] == 0) - which_m.spell_note(10); + which_m.spell_note(eSpellNote::RESISTS); else { - which_m.spell_note(8); + which_m.spell_note(eSpellNote::STONED); kill_monst(which_m,7,eMainStatus::STONE); } } @@ -2863,8 +2863,8 @@ void affect_spec(const runtime_state& ctx) { else pc.heal(-spec.ex1a); if(cCreature* who = dynamic_cast(&pc)) { if(spec.ex1b == 0) - who->spell_note(41); - else who->spell_note(42); + who->spell_note(eSpellNote::HEALED); + else who->spell_note(eSpellNote::DRAINED_HP); } break; case eSpecType::AFFECT_SP: @@ -2873,8 +2873,8 @@ void affect_spec(const runtime_state& ctx) { else pc.drain_sp(spec.ex1a, spec.ex1c); if(cCreature* who = dynamic_cast(&pc)) { if(spec.ex1b == 0) - who->spell_note(43); - else who->spell_note(44); + who->spell_note(eSpellNote::SP_RECHARGED); + else who->spell_note(eSpellNote::DRAINED_SP); } break; case eSpecType::AFFECT_XP: @@ -2944,18 +2944,18 @@ void affect_spec(const runtime_state& ctx) { if(who.is_alive() && spec.ex1b > 0) { switch(spec.ex1a) { case 0: - who.spell_note(46); + who.spell_note(eSpellNote::DIES); kill_monst(who,7,eMainStatus::DEAD); break; case 1: - who.spell_note(51); + who.spell_note(eSpellNote::OBLITERATED); kill_monst(who,7,eMainStatus::DUST); break; case 2: if(spec.ex1c > 0) petrify_monst(who,spec.ex1c); else { - who.spell_note(8); + who.spell_note(eSpellNote::STONED); kill_monst(who,7,eMainStatus::STONE); } break; @@ -2967,7 +2967,7 @@ void affect_spec(const runtime_state& ctx) { // Bring back to life else if(who.active == eCreatureStatus::DEAD && spec.ex1b == 0) { who.active = eCreatureStatus::IDLE; - who.spell_note(45); + who.spell_note(eSpellNote::REVIVED); } } break; diff --git a/src/universe/creature.cpp b/src/universe/creature.cpp index 948e009d5..49764a6b6 100644 --- a/src/universe/creature.cpp +++ b/src/universe/creature.cpp @@ -132,9 +132,9 @@ void cCreature::poison(int how_much) { } apply_status(eStatus::POISON, how_much); if(how_much >= 0) - spell_note((how_much == 0) ? 10 : 4); + spell_note((how_much == 0) ? eSpellNote::RESISTS : eSpellNote::POISONED); else - spell_note(34); + spell_note(eSpellNote::CURED); } @@ -142,18 +142,18 @@ void cCreature::acid(int how_much) { how_much = magic_adjust(how_much); apply_status(eStatus::ACID, how_much); if(how_much >= 0) - spell_note(31); + spell_note(eSpellNote::ACID); else - spell_note(48); + spell_note(eSpellNote::CLEANS_ACID); } void cCreature::slow(int how_much) { how_much = magic_adjust(how_much); apply_status(eStatus::HASTE_SLOW, -how_much); if(how_much >= 0) - spell_note((how_much == 0) ? 10 : 2); + spell_note((how_much == 0) ? eSpellNote::RESISTS : eSpellNote::SLOWED); else - spell_note(35); + spell_note(eSpellNote::HASTED); } @@ -161,9 +161,9 @@ void cCreature::curse(int how_much) { how_much = magic_adjust(how_much); apply_status(eStatus::BLESS_CURSE, -how_much); if(how_much >= 0) - spell_note((how_much == 0) ? 10 : 5); + spell_note((how_much == 0) ? eSpellNote::RESISTS : eSpellNote::CURSED); else - spell_note(36); + spell_note(eSpellNote::BLESSED); } @@ -171,9 +171,9 @@ void cCreature::web(int how_much) { how_much = magic_adjust(how_much); apply_status(eStatus::WEBS, how_much); if(how_much >= 0) - spell_note((how_much == 0) ? 10 : 19); + spell_note((how_much == 0) ? eSpellNote::RESISTS : eSpellNote::WEBBED); else - spell_note(37); + spell_note(eSpellNote::CLEANS_WEBS); } @@ -181,9 +181,9 @@ void cCreature::scare(int how_much) { how_much = magic_adjust(how_much); morale -= how_much; if(how_much >= 0) - spell_note((how_much == 0) ? 10 : 1); + spell_note((how_much == 0) ? eSpellNote::RESISTS : eSpellNote::SCARED); else - spell_note(47); + spell_note(eSpellNote::RALLIES); } @@ -191,9 +191,9 @@ void cCreature::disease(int how_much) { how_much = magic_adjust(how_much); apply_status(eStatus::DISEASE, how_much); if(how_much >= 0) - spell_note((how_much == 0) ? 10 : 25); + spell_note((how_much == 0) ? eSpellNote::RESISTS : eSpellNote::DISEASED); else - spell_note(38); + spell_note(eSpellNote::FEEL_BETTER); } @@ -201,9 +201,9 @@ void cCreature::dumbfound(int how_much) { how_much = magic_adjust(how_much); apply_status(eStatus::DUMB, how_much); if(how_much >= 0) - spell_note((how_much == 0) ? 10 : 22); + spell_note((how_much == 0) ? eSpellNote::RESISTS : eSpellNote::DUMBFOUNDED); else - spell_note(39); + spell_note(eSpellNote::MIND_CLEAR); } @@ -237,24 +237,24 @@ void cCreature::sleep(eStatus which_status,int amount,int penalty) { if(r1 > charm_odds[level / 2]) { //one_sound(68); - spell_note(10); + spell_note(eSpellNote::RESISTS); } else { if(which_status == eStatus::CHARM) { if(amount <= 0 || amount > 3) amount = 2; attitude = eAttitude(amount); - spell_note(23); + spell_note(eSpellNote::CHARMED); } else if(which_status == eStatus::FORCECAGE) { status[eStatus::FORCECAGE] = amount; - spell_note(52); + spell_note(eSpellNote::TRAPPED); } else { status[which_status] = amount; if(which_status == eStatus::ASLEEP && (amount >= 0)) - spell_note(28); + spell_note(eSpellNote::ASLEEP); if(which_status == eStatus::PARALYZED && (amount >= 0)) - spell_note(30); + spell_note(eSpellNote::PARALYZED); if(amount < 0) - spell_note(40); + spell_note(eSpellNote::ALERT); } //one_sound(53); } @@ -283,6 +283,10 @@ location cCreature::get_loc() const { return cur_loc; } +std::string cCreature::get_name() const { + return m_name; +} + bool cCreature::is_shielded() const { if(status[eStatus::MARTYRS_SHIELD] > 0) return true; @@ -385,236 +389,3 @@ void cCreature::readFrom(const cTagFile_Page& page) { page["DIRECTION"] >> direction; active = alert ? eCreatureStatus::ALERTED : eCreatureStatus::IDLE; } - -void cCreature::print_attacks(iLiving* target) const { - if(!print_result) return; - std::string msg = m_name; - msg += " attacks "; - if(cPlayer* who = dynamic_cast(target)) - msg += who->name; - else if(cCreature* monst = dynamic_cast(target)) - msg += monst->m_name; - else msg += "you"; - print_result(msg); -} - -void cCreature::spell_note(int which_mess) const { - if(!print_result) return; - std::string msg = m_name; - switch(which_mess) { - case 1: - msg = " " + msg + " scared."; - break; - - case 2: - msg = " " + msg + " slowed."; - break; - - case 3: - msg = " " + msg + " weakened."; - break; - - case 4: - msg = " " + msg + " poisoned."; - break; - - case 5: - msg = " " + msg + " cursed."; - break; - - case 6: - msg = " " + msg + " ravaged."; - break; - - case 7: - msg = " " + msg + " undamaged."; - break; - - case 8: - msg = " " + msg + " is stoned."; - break; - case 9: - msg = " Gazes at " + msg + '.'; - break; - case 10: - msg = " " + msg + " resists."; - break; - case 11: - msg = " Drains " + msg + '.'; - break; - case 12: - msg = " Shoots at " + msg + '.'; - break; - case 13: - msg = " Throws spear at " + msg + '.'; - break; - case 14: - msg = " Throws rock at " + msg + '.'; - break; - case 15: - msg = " Throws razordisk at " + msg + '.'; - break; - case 16: - msg = " Hits " + msg + '.'; - break; - case 17: - msg = " " + msg + " disappears."; - break; - case 18: - msg = " Misses " + msg + '.'; - break; - case 19: - msg = " " + msg + " is webbed."; - break; - case 20: - msg = " " + msg + " chokes."; - break; - case 21: - msg = " " + msg + " summoned."; - break; - case 22: - msg = " " + msg + " is dumbfounded."; - break; - case 23: - msg = " " + msg + " is charmed."; - break; - case 24: - msg = " " + msg + " is recorded."; - break; - case 25: - msg = " " + msg + " is diseased."; - break; - case 26: - msg = " " + msg + " is an avatar!"; - break; - case 27: - msg = " " + msg + " splits!"; - break; - case 28: - msg = " " + msg + " falls asleep."; - break; - case 29: - msg = " " + msg + " wakes up."; - break; - case 30: - msg = " " + msg + " paralyzed."; - break; - case 31: - msg = " " + msg + " covered with acid."; - break; - case 32: - msg = " Fires spines at " + msg + '.'; - break; - case 33: - msg = " " + msg + " summons aid."; - break; - case 34: - msg = " " + msg + " is cured."; - break; - case 35: - msg = " " + msg + " is hasted."; - break; - case 36: - msg = " " + msg + " is blessed."; - break; - case 37: - msg = " " + msg + " cleans webs."; - break; - case 38: - msg = " " + msg + " feels better."; - break; - case 39: - msg = " " + msg + " mind cleared."; - break; - case 40: - msg = " " + msg + " feels alert."; - break; - case 41: - msg = " " + msg + " is healed."; - break; - case 42: - msg = " " + msg + " drained of health."; - break; - case 43: - msg = " " + msg + " magic recharged."; - break; - case 44: - msg = " " + msg + " drained of magic."; - break; - case 45: - msg = " " + msg + " returns to life!"; - break; - case 46: - msg = " " + msg + " dies."; - break; - case 47: - msg = " " + msg + " rallies its courage."; - break; - case 48: - msg = " " + msg + " cleans off acid."; - break; - case 49: - msg = " " + msg + " breaks barrier."; - break; - case 50: - msg = " " + msg + " breaks force cage."; - break; - case 51: - msg = " " + msg + " is obliterated!"; - break; - case 52: - msg = " " + msg + " is trapped!"; - break; - case 53: - msg = " Throws dart at " + msg + '.'; - break; - case 54: - msg = " Throws knife at " + msg + '.'; - break; - case 55: - msg = " Fires ray at " + msg + '.'; - break; - case 56: - msg = " Gazes at " + msg + '.'; - break; - case 57: - msg = " Breathes on " + msg + '.'; - break; - case 58: - msg = " Throws web at " + msg + '.'; - break; - case 59: - msg = " Spits at " + msg + '.'; - break; - default: - msg += ": Unknown action " + std::to_string(which_mess); - } - - if(which_mess > 0) - print_result((char *) msg.c_str()); -} - -void cCreature::cast_spell_note(eSpell spell) const { - if(!print_result) return; - print_result(m_name + " casts:"); - print_result(" " + (*spell).name()); -} - -void cCreature::breathe_note() const { - if(!print_result) return; - print_result(m_name + " breathes."); -} - -void cCreature::damaged_msg(int how_much,int how_much_spec) const { - if(!print_result) return; - std::ostringstream sout; - sout << " " << m_name << " takes " << how_much; - if(how_much_spec > 0) - sout << '+' << how_much_spec; - print_result(sout.str()); -} - -void cCreature::killed_msg() const { - if(!print_result) return; - print_result(" " + m_name + " dies."); -} diff --git a/src/universe/creature.hpp b/src/universe/creature.hpp index 3ec37cc7a..187ff6278 100644 --- a/src/universe/creature.hpp +++ b/src/universe/creature.hpp @@ -61,15 +61,10 @@ class cCreature : public cMonster, public cTownperson, public iLiving { bool is_shielded() const override; int get_shared_dmg(int base_dmg) const override; location get_loc() const override; + std::string get_name() const override; int magic_adjust(int base); - void spell_note(int which) const; - void cast_spell_note(eSpell spell) const; - void print_attacks(iLiving* target) const; - void breathe_note() const; - void damaged_msg(int how_much, int extra) const; - void killed_msg() const; bool on_space(location loc) const; void import_legacy(legacy::creature_data_type old); diff --git a/src/universe/living.cpp b/src/universe/living.cpp index b6377f630..ab3d1e9ff 100644 --- a/src/universe/living.cpp +++ b/src/universe/living.cpp @@ -10,6 +10,7 @@ #include #include +#include #include "mathutil.hpp" void iLiving::apply_status(eStatus which, int how_much) { @@ -63,3 +64,224 @@ iLiving::iLiving(const iLiving& other) {} void(* iLiving::print_result)(std::string) = nullptr; + +void iLiving::spell_note(eSpellNote which_mess) const { + if(!print_result) return; + std::string msg; + switch(which_mess) { + case eSpellNote::SCARED: + msg = " {} scared."; + break; + + case eSpellNote::SLOWED: + msg = " {} slowed."; + break; + + case eSpellNote::WEAKENED: + msg = " {} weakened."; + break; + + case eSpellNote::POISONED: + msg = " {} poisoned."; + break; + + case eSpellNote::CURSED: + msg = " {} cursed."; + break; + + case eSpellNote::RAVAGED: + msg = " {} ravaged."; + break; + + case eSpellNote::UNDAMAGED: + msg = " {} undamaged."; + break; + + case eSpellNote::STONED: + msg = " {} is stoned."; + break; + case eSpellNote::GAZES: + msg = " Gazes at {}."; + break; + case eSpellNote::RESISTS: + msg = " {} resists."; + break; + case eSpellNote::DRAINS: + msg = " Drains {}."; + break; + case eSpellNote::SHOOTS: + msg = " Shoots at {}."; + break; + case eSpellNote::THROWS_SPEAR: + msg = " Throws spear at {}."; + break; + case eSpellNote::THROWS_ROCK: + msg = " Throws rock at {}."; + break; + case eSpellNote::THROWS_RAZORDISK: + msg = " Throws razordisk at {}."; + break; + case eSpellNote::HITS: + msg = " Hits {}."; + break; + case eSpellNote::DISAPPEARS: + msg = " {} disappears."; + break; + case eSpellNote::MISSES: + msg = " Misses {}."; + break; + case eSpellNote::WEBBED: + msg = " {} is webbed."; + break; + case eSpellNote::CHOKES: + msg = " {} chokes."; + break; + case eSpellNote::SUMMONED: + msg = " {} summoned."; + break; + case eSpellNote::DUMBFOUNDED: + msg = " {} is dumbfounded."; + break; + case eSpellNote::CHARMED: + msg = " {} is charmed."; + break; + case eSpellNote::RECORDED: + msg = " {} is recorded."; + break; + case eSpellNote::DISEASED: + msg = " {} is diseased."; + break; + case eSpellNote::AVATAR: + msg = " {} is an avatar!"; + break; + case eSpellNote::SPLITS: + msg = " {} splits!"; + break; + case eSpellNote::ASLEEP: + msg = " {} falls asleep."; + break; + case eSpellNote::AWAKE: + msg = " {} wakes up."; + break; + case eSpellNote::PARALYZED: + msg = " {} paralyzed."; + break; + case eSpellNote::ACID: + msg = " {} covered with acid."; + break; + case eSpellNote::SPINES: + msg = " Fires spines at {}."; + break; + case eSpellNote::SUMMONS: + msg = " {} summons aid."; + break; + case eSpellNote::CURED: + msg = " {} is cured."; + break; + case eSpellNote::HASTED: + msg = " {} is hasted."; + break; + case eSpellNote::BLESSED: + msg = " {} is blessed."; + break; + case eSpellNote::CLEANS_WEBS: + msg = " {} cleans webs."; + break; + case eSpellNote::FEEL_BETTER: + msg = " {} feels better."; + break; + case eSpellNote::MIND_CLEAR: + msg = " {} mind cleared."; + break; + case eSpellNote::ALERT: + msg = " {} feels alert."; + break; + case eSpellNote::HEALED: + msg = " {} is healed."; + break; + case eSpellNote::DRAINED_HP: + msg = " {} drained of health."; + break; + case eSpellNote::SP_RECHARGED: + msg = " {} magic recharged."; + break; + case eSpellNote::DRAINED_SP: + msg = " {} drained of magic."; + break; + case eSpellNote::REVIVED: + msg = " {} returns to life!"; + break; + case eSpellNote::DIES: + msg = " {} dies."; + break; + case eSpellNote::RALLIES: + msg = " {} rallies its courage."; + break; + case eSpellNote::CLEANS_ACID: + msg = " {} cleans off acid."; + break; + case eSpellNote::BREAKS_BARRIER: + msg = " {} breaks barrier."; + break; + case eSpellNote::BREAKS_FORCECAGE: + msg = " {} breaks force cage."; + break; + case eSpellNote::OBLITERATED: + msg = " {} is obliterated!"; + break; + case eSpellNote::TRAPPED: + msg = " {} is trapped!"; + break; + case eSpellNote::THROWS_DART: + msg = " Throws dart at {}."; + break; + case eSpellNote::THROWS_KNIFE: + msg = " Throws knife at {}."; + break; + case eSpellNote::FIRES_RAY: + msg = " Fires ray at {}."; + break; + case eSpellNote::GAZES2: + msg = " Gazes at {}."; + break; + case eSpellNote::BREATHES_ON: + msg = " Breathes on {}."; + break; + case eSpellNote::THROWS_WEB: + msg = " Throws web at {}."; + break; + case eSpellNote::SPITS: + msg = " Spits at {}."; + break; + case eSpellNote::BREATHES: + msg = " {} breaths."; + break; + default: + msg += "{}: Unknown action " + std::to_string(int(which_mess)); + } + + if(which_mess != eSpellNote::NONE) + print_result(fmt::format(msg, get_name())); +} + +void iLiving::print_attacks(const iLiving& target) const { + if(!print_result) return; + std::string target_name; + if(&target == this) { + target_name = "themself"; + } else target_name = target.get_name(); + print_result(fmt::format("{} attacks {}", get_name(), target_name)); +} + +void iLiving::cast_spell_note(eSpell spell) const { + if(!print_result) return; + print_result(fmt::format("{} casts:", get_name())); + print_result(fmt::format(" {}", (*spell).name())); +} + +void iLiving::damaged_msg(int how_much,int how_much_spec) const { + if(!print_result) return; + if(how_much_spec > 0) + print_result(fmt::format(" {} takes {}+{}", get_name(), how_much, how_much_spec)); + else print_result(fmt::format(" {} takes {}", get_name(), how_much)); +} diff --git a/src/universe/living.hpp b/src/universe/living.hpp index 49bedf44f..426b10898 100644 --- a/src/universe/living.hpp +++ b/src/universe/living.hpp @@ -14,6 +14,23 @@ #include "location.hpp" #include "damage.hpp" +#include "spell.hpp" + +enum class eSpellNote { + NONE = 0, + SCARED = 1, SLOWED = 2, WEAKENED = 3, POISONED = 4, CURSED = 5, + RAVAGED = 6, UNDAMAGED = 7, STONED = 8, GAZES = 9, RESISTS = 10, + DRAINS = 11, SHOOTS = 12, THROWS_SPEAR = 13, THROWS_ROCK = 14, THROWS_RAZORDISK = 15, + HITS = 16, DISAPPEARS = 17, MISSES = 18, WEBBED = 19, CHOKES = 20, + SUMMONED = 21, DUMBFOUNDED = 22, CHARMED = 23, RECORDED = 24, DISEASED = 25, + AVATAR = 26, SPLITS = 27, ASLEEP = 28, AWAKE = 29, PARALYZED = 30, + ACID = 31, SPINES = 32, SUMMONS = 33, CURED = 34, HASTED = 35, + BLESSED = 36, CLEANS_WEBS = 37, FEEL_BETTER = 38, MIND_CLEAR = 39, ALERT = 40, + HEALED = 41, DRAINED_HP = 42, SP_RECHARGED = 43, DRAINED_SP = 44, REVIVED = 45, + DIES = 46, RALLIES = 47, CLEANS_ACID = 48, BREAKS_BARRIER = 49, BREAKS_FORCECAGE = 50, + OBLITERATED = 51, TRAPPED = 52, THROWS_DART = 53, THROWS_KNIFE = 54, FIRES_RAY = 55, + GAZES2 = 56, BREATHES_ON = 57, THROWS_WEB = 58, SPITS = 59, BREATHES = 60, +}; class iLiving { public: @@ -53,6 +70,12 @@ class iLiving { virtual int get_magic() const = 0; virtual int get_level() const = 0; virtual location get_loc() const = 0; + virtual std::string get_name() const = 0; + + void spell_note(eSpellNote note) const; + void cast_spell_note(eSpell spell) const; + void print_attacks(const iLiving& target) const; + void damaged_msg(int how_much, int extra) const; iLiving(); iLiving(const iLiving& other); diff --git a/src/universe/party.cpp b/src/universe/party.cpp index ba85429b5..030ec8566 100644 --- a/src/universe/party.cpp +++ b/src/universe/party.cpp @@ -575,6 +575,10 @@ location cParty::get_loc() const { return town_loc; } +std::string cParty::get_name() const { + return "you"; +} + int cParty::calc_day() const { return (age / 3700) + 1; } diff --git a/src/universe/party.hpp b/src/universe/party.hpp index 3478369bb..8cae1036e 100644 --- a/src/universe/party.hpp +++ b/src/universe/party.hpp @@ -163,6 +163,7 @@ class cParty : public iLiving { bool is_shielded() const override; int get_shared_dmg(int base_dmg) const override; location get_loc() const override; + std::string get_name() const override; void apply_status(eStatus which, int how_much) override; void heal(int how_much) override; diff --git a/src/universe/pc.cpp b/src/universe/pc.cpp index 3bd86faa7..c490c81ba 100644 --- a/src/universe/pc.cpp +++ b/src/universe/pc.cpp @@ -398,6 +398,10 @@ location cPlayer::get_loc() const { return combat_pos; } +std::string cPlayer::get_name() const { + return name; +} + int cPlayer::get_health() const { return cur_health; } @@ -1388,4 +1392,4 @@ void cPlayer::readFrom(const cTagFile& file, bool preview) { items[i].readFrom(page); } } -} \ No newline at end of file +} diff --git a/src/universe/pc.hpp b/src/universe/pc.hpp index 241383534..53ef6336f 100644 --- a/src/universe/pc.hpp +++ b/src/universe/pc.hpp @@ -132,6 +132,7 @@ class cPlayer : public iLiving { int get_magic() const override; int get_level() const override; location get_loc() const override; + std::string get_name() const override; void finish_create(); void void_sanctuary() override; From 3c805740490e79abd4a8deb45fa5234f0eedc3cd Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 2 Aug 2025 22:59:32 -0400 Subject: [PATCH 07/24] Avoid message duplication with the new spell_note function. --- src/game/boe.combat.cpp | 75 +++++++++-------------------------------- src/universe/living.cpp | 3 ++ src/universe/living.hpp | 1 + 3 files changed, 20 insertions(+), 59 deletions(-) diff --git a/src/game/boe.combat.cpp b/src/game/boe.combat.cpp index 3d291ab0f..d554c79f8 100644 --- a/src/game/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -2900,47 +2900,26 @@ void monst_fire_missile(short m_num,short bless,std::pair a case eMonstMissile::BOLT: case eMonstMissile::RAPID_ARROW: snd = 12; - if(pc_target != nullptr) - add_string_to_buf(" Shoots at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::SHOOTS); + target->spell_note(eSpellNote::SHOOTS); break; case eMonstMissile::SPEAR: - if(pc_target != nullptr) - add_string_to_buf(" Throws spear at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::THROWS_SPEAR); + target->spell_note(eSpellNote::THROWS_SPEAR); break; case eMonstMissile::RAZORDISK: - if(pc_target != nullptr) - add_string_to_buf(" Throws razordisk at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::THROWS_RAZORDISK); + target->spell_note(eSpellNote::THROWS_RAZORDISK); break; case eMonstMissile::SPINE: - if(pc_target != nullptr) - add_string_to_buf(" Fires spines at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::SPINES); + target->spell_note(eSpellNote::SPINES); break; case eMonstMissile::DART: - if(pc_target != nullptr) - add_string_to_buf(" Throws dart at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::THROWS_DART); + target->spell_note(eSpellNote::THROWS_DART); break; case eMonstMissile::ROCK: case eMonstMissile::BOULDER: - if(pc_target != nullptr) - add_string_to_buf(" Throws rock at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::THROWS_ROCK); + target->spell_note(eSpellNote::THROWS_ROCK); break; case eMonstMissile::KNIFE: - if(pc_target != nullptr) - add_string_to_buf(" Throws knife at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::THROWS_KNIFE); + target->spell_note(eSpellNote::THROWS_KNIFE); break; } if(abil.second.missile.type == eMonstMissile::ARROW || abil.second.missile.type == eMonstMissile::RAPID_ARROW || abil.second.missile.type == eMonstMissile::BOLT) @@ -2967,19 +2946,15 @@ void monst_fire_missile(short m_num,short bless,std::pair a size_t i_monst = univ.get_target_i(*target); if(r1 <= hit_chance[abil.second.missile.skill]) { r2 = get_ran(abil.second.missile.dice,1,abil.second.missile.sides) + min(10,bless); + target->spell_note(eSpellNote::HITS); if(pc_target != nullptr) { - add_string_to_buf(" Hits " + pc_target->name + '.'); // TODO: Should we pass in the monster's actual race here? damage_pc(*pc_target,r2,eDamageType::WEAPON,eRace::UNKNOWN,13); } else if(m_target != nullptr) { - m_target->spell_note(eSpellNote::HITS); damage_monst(*m_target,7,r2,eDamageType::WEAPON,13); } } else { - if(pc_target != nullptr) - add_string_to_buf(" Misses " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::MISSES); + target->spell_note(eSpellNote::MISSES); } if(pc_target != nullptr) { if(cInvenSlot spec_item = pc_target->has_abil_equip(eItemAbil::HIT_CALL_SPECIAL)) { @@ -3002,16 +2977,11 @@ void monst_fire_missile(short m_num,short bless,std::pair a univ.town.monst[m_num].ap += abil.second.get_ap_cost(abil.first); } } else if(abil.first == eMonstAbil::MISSILE_WEB) { - if(pc_target != nullptr) - add_string_to_buf(" Throws web at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::THROWS_WEB); + target->spell_note(eSpellNote::THROWS_WEB); run_a_missile(source, targ_space, 8, 0, 14, 0, 0, 100); web_space(targ_space.x, targ_space.y); } else if(abil.first == eMonstAbil::RAY_HEAT) { - if(pc_target != nullptr) add_string_to_buf(" Hits " + pc_target->name + " with heat ray!"); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::FIRES_RAY); + target->spell_note(eSpellNote::HEAT_RAY); run_a_missile(source, targ_space, 13, 0, 51, 0, 0, 100); uAbility proxy = {true}; proxy.gen.strength = abil.second.special.extra3; @@ -3060,32 +3030,20 @@ void monst_fire_missile(short m_num,short bless,std::pair a case eMonstGen::TOUCH: return; // never reached case eMonstGen::RAY: snd = 51; - if(pc_target != nullptr) - add_string_to_buf(" Fires ray at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::FIRES_RAY); + target->spell_note(eSpellNote::FIRES_RAY); break; case eMonstGen::GAZE: snd = 43; - if(pc_target != nullptr) - add_string_to_buf(" Gazes at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::GAZES2); + target->spell_note(eSpellNote::GAZES2); break; case eMonstGen::BREATH: snd = 44; - if(pc_target != nullptr) - add_string_to_buf(" Breathes on " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::BREATHES_ON); + target->spell_note(eSpellNote::BREATHES_ON); break; case eMonstGen::SPIT: path_type = 1; snd = 64; - if(pc_target != nullptr) - add_string_to_buf(" Spits at " + pc_target->name + '.'); - else if(m_target != nullptr) - m_target->spell_note(eSpellNote::SPITS); + target->spell_note(eSpellNote::SPITS); break; } if(abil.second.gen.pic < 0) play_sound(snd); @@ -3184,11 +3142,10 @@ void monst_basic_abil(short m_num, std::pair abil, iLiving* petrify_monst(*m_target, i); break; case eMonstAbil::DRAIN_SP: + target->spell_note(eSpellNote::DRAINS); if(pc_target != nullptr) { - add_string_to_buf(" Drains " + pc_target->name + '.'); pc_target->cur_sp = percent(pc_target->cur_sp, abil.second.gen.strength); } else { - m_target->spell_note(eSpellNote::DRAINS); // TODO: If mp < 4 it used to set monster's skill to 1. Should that be restored? m_target->mp = percent(m_target->mp, abil.second.gen.strength); } diff --git a/src/universe/living.cpp b/src/universe/living.cpp index ab3d1e9ff..efa346dc2 100644 --- a/src/universe/living.cpp +++ b/src/universe/living.cpp @@ -256,6 +256,9 @@ void iLiving::spell_note(eSpellNote which_mess) const { case eSpellNote::BREATHES: msg = " {} breaths."; break; + case eSpellNote::HEAT_RAY: + msg = " Hits {} with heat ray!"; + break; default: msg += "{}: Unknown action " + std::to_string(int(which_mess)); } diff --git a/src/universe/living.hpp b/src/universe/living.hpp index 426b10898..5ba85c5b4 100644 --- a/src/universe/living.hpp +++ b/src/universe/living.hpp @@ -30,6 +30,7 @@ enum class eSpellNote { DIES = 46, RALLIES = 47, CLEANS_ACID = 48, BREAKS_BARRIER = 49, BREAKS_FORCECAGE = 50, OBLITERATED = 51, TRAPPED = 52, THROWS_DART = 53, THROWS_KNIFE = 54, FIRES_RAY = 55, GAZES2 = 56, BREATHES_ON = 57, THROWS_WEB = 58, SPITS = 59, BREATHES = 60, + HEAT_RAY = 61, }; class iLiving { From 5463b46bea6e0122f53bef320ce534dd2fccd5f5 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 2 Aug 2025 23:03:47 -0400 Subject: [PATCH 08/24] Avoid duplicate messages with the new damaged_msg function --- src/game/boe.combat.cpp | 20 +++----------------- src/universe/living.cpp | 1 + 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/game/boe.combat.cpp b/src/game/boe.combat.cpp index d554c79f8..94c2f2f0b 100644 --- a/src/game/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -657,16 +657,7 @@ void pc_attack_weapon(short who_att,iLiving& target,short hit_adj,short dam_adj, if(bonus_dam) inflicted_bonus_damage = damage_target(target, bonus_dam, dmg_tp, 0, false, who_att, race); - if(inflicted_weapon_damage || inflicted_special_damage || inflicted_bonus_damage){ - if(cCreature* monst = dynamic_cast(&target)) { - monst->damaged_msg(inflicted_weapon_damage, inflicted_special_damage + inflicted_bonus_damage); - } else if(cPlayer* who = dynamic_cast(&target)) { - std::string msg = " " + who->name + " takes " + std::to_string(inflicted_weapon_damage); - if(inflicted_special_damage + inflicted_bonus_damage) - msg += '+' + std::to_string(inflicted_special_damage + inflicted_bonus_damage); - add_string_to_buf(msg + '.'); - } - } + target.damaged_msg(inflicted_weapon_damage, inflicted_special_damage + inflicted_bonus_damage); if(do_poison) { // poison if(attacker.status[eStatus::POISONED_WEAPON] > 0) { @@ -1667,19 +1658,14 @@ void fire_missile(location target) { inflicted_weapon_damage = damage_monst(*monst, univ.cur_pc, r2, eDamageType::WEAPON,13,false); if(spec_dam > 0) inflicted_special_damage = damage_monst(*monst, univ.cur_pc, spec_dam, dmg_tp, 0,false); - if(inflicted_weapon_damage || inflicted_special_damage) - monst->damaged_msg(inflicted_weapon_damage, inflicted_special_damage); + monst->damaged_msg(inflicted_weapon_damage, inflicted_special_damage); } else if(cPlayer* who = dynamic_cast(victim)) { // TODO: Should the race really be included here? Maybe it's meant for melee attacks only. eRace race = missile_firer.race; inflicted_weapon_damage = damage_pc(*who, r2, eDamageType::WEAPON, race, 0, false); if(spec_dam > 0) inflicted_special_damage = damage_pc(*who, spec_dam, dmg_tp, race, 0, false); - if(inflicted_weapon_damage || inflicted_special_damage) { - std::string msg = " " + who->name + " takes " + std::to_string(inflicted_weapon_damage); - if(spec_dam) msg += '+' + std::to_string(inflicted_special_damage); - add_string_to_buf(msg + '.'); - } + who->damaged_msg(inflicted_weapon_damage, inflicted_special_damage); } // poison if(missile_firer.status[eStatus::POISONED_WEAPON] > 0 && missile_firer.weap_poisoned.slot == ammo_inv_slot) { diff --git a/src/universe/living.cpp b/src/universe/living.cpp index efa346dc2..e5ca9a4ce 100644 --- a/src/universe/living.cpp +++ b/src/universe/living.cpp @@ -284,6 +284,7 @@ void iLiving::cast_spell_note(eSpell spell) const { void iLiving::damaged_msg(int how_much,int how_much_spec) const { if(!print_result) return; + if(how_much == 0 && how_much_spec == 0) return; if(how_much_spec > 0) print_result(fmt::format(" {} takes {}+{}", get_name(), how_much, how_much_spec)); else print_result(fmt::format(" {} takes {}", get_name(), how_much)); From e6c78dd944578292a237534718ec624ccffa9cef Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 2 Aug 2025 23:20:32 -0400 Subject: [PATCH 09/24] Use fmtlib for job bank and scenario picker descriptions. --- src/game/boe.dlgutil.cpp | 42 +++++++++++++++++++++++++-------------- src/scenario/scenario.hpp | 3 +++ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/game/boe.dlgutil.cpp b/src/game/boe.dlgutil.cpp index 67368eceb..c99ba0722 100644 --- a/src/game/boe.dlgutil.cpp +++ b/src/game/boe.dlgutil.cpp @@ -4,6 +4,9 @@ #include #include #include +#include +#include +#include #include "boe.global.hpp" @@ -772,15 +775,15 @@ static void fill_job_bank(cDialog& me, job_bank_t& bank, std::string) { std::string id = std::to_string(i + 1); if(bank.jobs[i] >= 0 && bank.jobs[i] < univ.scenario.quests.size()) { cQuest& quest = univ.scenario.quests[bank.jobs[i]]; - std::string description = quest.descr; + std::vector lines{quest.descr}; if(quest.deadline > 0) { if(quest.deadline_is_relative) - description += " Must be completed in " + std::to_string(quest.deadline) + " days."; - else description += " Must be completed by day " + std::to_string(quest.deadline) + "."; + lines.push_back(fmt::format("Must be completed in {} days.", quest.deadline)); + else lines.push_back(fmt::format("Must be completed by day {}.", quest.deadline)); } - description += " Pay is " + std::to_string(quest.gold) + " gold."; + lines.push_back(fmt::format("Pay is {} gold.", quest.gold)); me["take" + id].show(); - me["job" + id].setText(description); + me["job" + id].setText(fmt::format("{}", fmt::join(lines, " "))); } else { me["take" + id].hide(); me["job" + id].setText(""); @@ -1736,6 +1739,13 @@ void tip_of_day() { } +static const auto scen_descr_tmpl = FMT_COMPILE("" + "{name} v{version_major}.{version_minor}.{version_patch} - |" + " Difficulty: {difficulty}, Rating: {rating} |" + "{teaser1}|" + "{teaser2}" +); + class cChooseScenario { cDialog me{*ResMgr::dialogs.get("pick-scenario")}; std::vector scen_headers; @@ -1755,16 +1765,18 @@ class cChooseScenario { if(scen_headers.size() > (page * 3 + i)) { me["pic" + n].show(); dynamic_cast(me["pic" + n]).setPict(scen_headers[page * 3 + i].intro_pic); - clear_sstr(sout); - sout << scen_headers[page * 3 + i].name; - sout << " v" << int(scen_headers[page * 3 + i].ver[0]); - sout << '.' << int(scen_headers[page * 3 + i].ver[1]); - sout << '.' << int(scen_headers[page * 3 + i].ver[2]); - sout << " - | Difficulty: " << difficulty[scen_headers[page * 3 + i].difficulty]; - sout << ", Rating: " << scen_headers[page * 3 + i].rating; - sout << " |" << scen_headers[page * 3 + i].teaser1; - sout << " |" << scen_headers[page * 3 + i].teaser2; - me["desc" + n].setText(sout.str()); + auto& header = scen_headers[page * 3 + i]; + std::string description = fmt::format(scen_descr_tmpl, + fmt::arg("name", header.name), + fmt::arg("version_major", header.ver[0]), + fmt::arg("version_minor", header.ver[1]), + fmt::arg("version_patch", header.ver[2]), + fmt::arg("difficuly", difficulty[header.difficulty]), + fmt::arg("rating", header.rating), + fmt::arg("teaser1", header.teaser1), + fmt::arg("teaser2", header.teaser2) + ); + me["desc" + n].setText(description); me["start" + n].show(); } else { me["pic" + n].hide(); diff --git a/src/scenario/scenario.hpp b/src/scenario/scenario.hpp index b61ca6ef7..d52585b2f 100644 --- a/src/scenario/scenario.hpp +++ b/src/scenario/scenario.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "monster.hpp" // For reasons unknown, putting terrain above monster breaks the tests build in MSVC 2013 #include "terrain.hpp" @@ -39,6 +40,8 @@ struct scenario_header_flags { enum eContentRating {G, PG, R, NC17}; +template<> struct fmt::formatter : ostream_formatter {}; + // Used for finding town entrances in the outdoors struct town_entrance_t { location out_sec; From 79701204789b1ea3386cbd183006fb36bbbd428d Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Aug 2025 10:53:45 -0400 Subject: [PATCH 10/24] VSCode likes adding every possible standard C++ header to the file association list. I generally just roll with it, so here's the current list. --- proj/vscode/oboe.code-workspace | 85 ++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/proj/vscode/oboe.code-workspace b/proj/vscode/oboe.code-workspace index be39ebdda..9d41a7336 100644 --- a/proj/vscode/oboe.code-workspace +++ b/proj/vscode/oboe.code-workspace @@ -104,6 +104,89 @@ "pattern": "rsrc/scenarios/*/dialogs/*.xml", "systemId": "${workspaceFolder}/rsrc/schemas/dialog.xsd" } - ] + ], + "files.associations": { + "__bit_reference": "cpp", + "__config": "cpp", + "__debug": "cpp", + "__errc": "cpp", + "__functional_base": "cpp", + "__hash_table": "cpp", + "__locale": "cpp", + "__mutex_base": "cpp", + "__node_handle": "cpp", + "__nullptr": "cpp", + "__split_buffer": "cpp", + "__string": "cpp", + "__threading_support": "cpp", + "__tree": "cpp", + "__tuple": "cpp", + "algorithm": "cpp", + "any": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "cfenv": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "exception": "cpp", + "fstream": "cpp", + "functional": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "ios": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "iterator": "cpp", + "limits": "cpp", + "list": "cpp", + "locale": "cpp", + "map": "cpp", + "memory": "cpp", + "mutex": "cpp", + "new": "cpp", + "numeric": "cpp", + "optional": "cpp", + "ostream": "cpp", + "queue": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "set": "cpp", + "sstream": "cpp", + "stack": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "string_view": "cpp", + "string": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "utility": "cpp", + "variant": "cpp", + "vector": "cpp" + } } } \ No newline at end of file From 7ea2a628d88b113b4ce420f6d92ad3dd4a063030 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Aug 2025 11:18:51 -0400 Subject: [PATCH 11/24] Use fmtlib to construct the teaser1 string --- src/game/boe.fileio.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/boe.fileio.cpp b/src/game/boe.fileio.cpp index 4e0e9d28b..a53c900de 100644 --- a/src/game/boe.fileio.cpp +++ b/src/game/boe.fileio.cpp @@ -23,6 +23,7 @@ #include "replay.hpp" #include #include +#include #define DONE_BUTTON_ITEM 1 @@ -468,12 +469,12 @@ bool load_scenario_header(fs::path file,scen_header_type& scen_head){ // V2 meta display: By {Author}, Contact: {Contact}|{Teaser!} else{ if(!temp_scenario.contact_info[0].empty()){ - scen_head.teaser1 = "By " + temp_scenario.contact_info[0]; + scen_head.teaser1 = fmt::format("By {}", temp_scenario.contact_info[0]); } if(!temp_scenario.contact_info[1].empty()){ if(!scen_head.teaser1.empty()) scen_head.teaser1 += ", "; - scen_head.teaser1 += "Contact: " + temp_scenario.contact_info[1]; + scen_head.teaser1 += fmt::format("Contact: {}", temp_scenario.contact_info[1]); } if(scen_head.teaser1.empty()) scen_head.teaser1 = temp_scenario.teaser_text[0]; @@ -544,4 +545,4 @@ void try_auto_save(std::string reason) { ASB("Autosave: Save not completed"); } print_buf(); -} \ No newline at end of file +} From 21bf088dd1413c36c2286e18a3c6858e9aab3e23 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Aug 2025 11:23:59 -0400 Subject: [PATCH 12/24] Use fmtlib for startup screen stats. --- src/game/boe.graphics.cpp | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/game/boe.graphics.cpp b/src/game/boe.graphics.cpp index 7d76df26b..d960a7bbd 100644 --- a/src/game/boe.graphics.cpp +++ b/src/game/boe.graphics.cpp @@ -39,6 +39,7 @@ #include "tools/prefs.hpp" #include "replay.hpp" #include +#include #ifndef MSBUILD_GITREV @@ -375,36 +376,35 @@ void draw_startup_stats() { } style.pointSize = 12; pc_rect.offset(12,16); - std::string status = "Level " + std::to_string(univ.party[i].level); + std::string status = "Level {} {}", raceName; switch(univ.party[i].main_status) { case eMainStatus::ALIVE: switch(univ.party[i].race) { - case eRace::HUMAN: status += " Human"; break; - case eRace::NEPHIL: status += " Nephilim"; break; - case eRace::SLITH: status += " Slithzerikai"; break; - case eRace::VAHNATAI: status += " Vahnatai"; break; - case eRace::REPTILE: status += " Reptile"; break; - case eRace::BEAST: status += " Beast"; break; - case eRace::IMPORTANT: status += " V.I.P."; break; - case eRace::MAGE: status += " Human Mage"; break; - case eRace::PRIEST: status += " Human Priest"; break; - case eRace::HUMANOID: status += " Humanoid"; break; - case eRace::DEMON: status += " Demon"; break; - case eRace::UNDEAD: status += " Undead"; break; - case eRace::GIANT: status += " Giant"; break; - case eRace::SLIME: status += " Slime"; break; - case eRace::STONE: status += " Golem"; break; - case eRace::BUG: status += " Bug"; break; - case eRace::DRAGON: status += " Dragon"; break; - case eRace::MAGICAL: status += " Magical Creature"; break; - case eRace::PLANT: status += " Plant"; break; - case eRace::BIRD: status += " Bird"; break; - default: status += " *ERROR INVALID RACE*"; break; + case eRace::HUMAN: raceName += "Human"; break; + case eRace::NEPHIL: raceName += "Nephilim"; break; + case eRace::SLITH: raceName += "Slithzerikai"; break; + case eRace::VAHNATAI: raceName += "Vahnatai"; break; + case eRace::REPTILE: raceName += "Reptile"; break; + case eRace::BEAST: raceName += "Beast"; break; + case eRace::IMPORTANT: raceName += "V.I.P."; break; + case eRace::MAGE: raceName += "Human Mage"; break; + case eRace::PRIEST: raceName += "Human Priest"; break; + case eRace::HUMANOID: raceName += "Humanoid"; break; + case eRace::DEMON: raceName += "Demon"; break; + case eRace::UNDEAD: raceName += "Undead"; break; + case eRace::GIANT: raceName += "Giant"; break; + case eRace::SLIME: raceName += "Slime"; break; + case eRace::STONE: raceName += "Golem"; break; + case eRace::BUG: raceName += "Bug"; break; + case eRace::DRAGON: raceName += "Dragon"; break; + case eRace::MAGICAL: raceName += "Magical Creature"; break; + case eRace::PLANT: raceName += "Plant"; break; + case eRace::BIRD: raceName += "Bird"; break; + default: status += "*ERROR INVALID RACE*"; break; } - win_draw_string(mainPtr(),pc_rect,status,eTextMode::WRAP,style); + win_draw_string(mainPtr(),pc_rect,fmt::format(status, univ.party[i].level, raceName),eTextMode::WRAP,style); pc_rect.offset(0,13); - status = "Health " + std::to_string(univ.party[i].max_health); - status += ", Spell pts. " + std::to_string(univ.party[i].max_sp); + status = fmt::format("Health {}, Spell pts. {}", univ.party[i].max_health, univ.party[i].max_sp); break; case eMainStatus::DEAD: status = "Dead"; From d14e6d9dd68c165b467a17f95b0746cf71bedb4f Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Aug 2025 11:32:35 -0400 Subject: [PATCH 13/24] Use /utf-8 for Windows cl builds --- SConstruct | 2 +- proj/vs2013/Common/Common.vcxproj | 3 ++- proj/vs2013/Game/Blades of Exile.vcxproj | 2 ++ proj/vs2013/OBoE Tests/OBoE Tests.vcxproj | 4 ++++ proj/vs2013/PcEdit/Char Editor.vcxproj | 2 ++ proj/vs2013/ScenEdit/Scen Editor.vcxproj | 2 ++ proj/vs2017/Blades of Exile.vcxproj | 4 ++++ proj/vs2017/Character Editor/Character Editor.vcxproj | 4 ++++ proj/vs2017/Common/Common.vcxproj | 4 ++++ proj/vs2017/Scenario Editor/Scenario Editor.vcxproj | 4 ++++ proj/vs2017/Tests/Tests.vcxproj | 4 ++++ 11 files changed, 33 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index bc222ad4b..855faaed5 100644 --- a/SConstruct +++ b/SConstruct @@ -236,7 +236,7 @@ elif platform == "win32": include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes env.Append( LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{arch_short}'], - CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'], + CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp','/utf-8'], CPPPATH=include_paths, LIBPATH=[path.join(vcpkg_installed, 'lib')] + vcpkg_other_libs + vcpkg_other_bins, LIBS=Split(""" diff --git a/proj/vs2013/Common/Common.vcxproj b/proj/vs2013/Common/Common.vcxproj index 17e7ef01e..0737b0376 100644 --- a/proj/vs2013/Common/Common.vcxproj +++ b/proj/vs2013/Common/Common.vcxproj @@ -432,7 +432,7 @@ MSBUILD_GITREV;WIN32;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions);_DEBUG $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src false - /FS %(AdditionalOptions) + /FS %(AdditionalOptions) /utf-8 4800;4290;4244;4996;4018 @@ -462,6 +462,7 @@ $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src + /utf-8 4800;4290;4244;4996;4018 $(SolutionDir)..\..\src\global.hpp diff --git a/proj/vs2013/Game/Blades of Exile.vcxproj b/proj/vs2013/Game/Blades of Exile.vcxproj index 724e4e802..6780d1937 100644 --- a/proj/vs2013/Game/Blades of Exile.vcxproj +++ b/proj/vs2013/Game/Blades of Exile.vcxproj @@ -56,6 +56,7 @@ MSBUILD_GITREV;WIN32;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions);_DEBUG + /utf-8 $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4800;4290;4244;4996;4018 $(SolutionDir)..\..\src\global.hpp @@ -77,6 +78,7 @@ MaxSpeed true true + /utf-8 MSBUILD_GITREV;WIN32;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions);NDEBUG $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus diff --git a/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj b/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj index ead8eebfd..e663378fb 100644 --- a/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj +++ b/proj/vs2013/OBoE Tests/OBoE Tests.vcxproj @@ -46,6 +46,7 @@ Level3 Disabled + /utf-8 $(SolutionDir)..\..\src\global.hpp $(SolutionDir)..\..\deps\Catch2\include;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) @@ -63,6 +64,7 @@ MaxSpeed true true + /utf-8 $(SolutionDir)..\..\deps\Catch2\include;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) @@ -97,6 +99,7 @@ MaxSpeed true true + /utf-8 $(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp WIN32;NDEBUG;_WINDOWS;TIXML_USE_TICPP;%(PreprocessorDefinitions) @@ -107,6 +110,7 @@ true true true + /utf-8 opengl32.lib;sfml-system.lib;sfml-window.lib;sfml-graphics.lib;sfml-audio.lib;libboost_filesystem-vc120-mt-*.lib;libboost_system-vc120-mt-*.lib;libboost_thread-vc120-mt-*.lib;zlib.lib;%(AdditionalDependencies) diff --git a/proj/vs2013/PcEdit/Char Editor.vcxproj b/proj/vs2013/PcEdit/Char Editor.vcxproj index 2e0432212..af26fb84b 100644 --- a/proj/vs2013/PcEdit/Char Editor.vcxproj +++ b/proj/vs2013/PcEdit/Char Editor.vcxproj @@ -63,6 +63,7 @@ $(SolutionDir)..\..\src\global.hpp + /utf-8 Windows @@ -87,6 +88,7 @@ 4800;4290;4244;4996;4018 $(SolutionDir)..\..\src\global.hpp + /utf-8 Windows diff --git a/proj/vs2013/ScenEdit/Scen Editor.vcxproj b/proj/vs2013/ScenEdit/Scen Editor.vcxproj index edbd60039..43196e244 100644 --- a/proj/vs2013/ScenEdit/Scen Editor.vcxproj +++ b/proj/vs2013/ScenEdit/Scen Editor.vcxproj @@ -63,6 +63,7 @@ $(SolutionDir)..\..\src\global.hpp + /utf-8 Windows @@ -87,6 +88,7 @@ 4800;4290;4244;4996;4018 $(SolutionDir)..\..\src\global.hpp + /utf-8 Windows diff --git a/proj/vs2017/Blades of Exile.vcxproj b/proj/vs2017/Blades of Exile.vcxproj index 5a8a50e05..a76ac68d0 100644 --- a/proj/vs2017/Blades of Exile.vcxproj +++ b/proj/vs2017/Blades of Exile.vcxproj @@ -83,6 +83,7 @@ Disabled $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp + /utf-8 @@ -101,6 +102,7 @@ ProgramDatabase $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp + /utf-8 MachineX86 @@ -117,6 +119,7 @@ $(SolutionDir)..\..\src\global.hpp $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp + /utf-8 Level3 MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions) false @@ -136,6 +139,7 @@ $(SolutionDir)..\..\src\global.hpp $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp + /utf-8 false Level3 MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions) diff --git a/proj/vs2017/Character Editor/Character Editor.vcxproj b/proj/vs2017/Character Editor/Character Editor.vcxproj index bd8b6afa0..fc0f2e53e 100644 --- a/proj/vs2017/Character Editor/Character Editor.vcxproj +++ b/proj/vs2017/Character Editor/Character Editor.vcxproj @@ -82,6 +82,7 @@ Level3 Disabled true + /utf-8 $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp @@ -98,6 +99,7 @@ MultiThreadedDebugDLL Level3 Disabled + /utf-8 $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp true @@ -118,6 +120,7 @@ true true true + /utf-8 $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp @@ -139,6 +142,7 @@ MaxSpeed true true + /utf-8 $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp true diff --git a/proj/vs2017/Common/Common.vcxproj b/proj/vs2017/Common/Common.vcxproj index 6df9881a6..1e490b342 100644 --- a/proj/vs2017/Common/Common.vcxproj +++ b/proj/vs2017/Common/Common.vcxproj @@ -89,6 +89,7 @@ MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX + /utf-8 $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src @@ -106,6 +107,7 @@ true MultiThreadedDebugDLL MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX + /utf-8 $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp @@ -127,6 +129,7 @@ MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX + /utf-8 $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src @@ -149,6 +152,7 @@ true MultiThreadedDLL MSBUILD_GITREV;WIN32;_WINDOWS;BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE;TIXML_USE_TICPP;%(PreprocessorDefinitions);NOMINMAX + /utf-8 $(SolutionDir)..\..\deps\cppcodec;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src $(SolutionDir)..\..\src\global.hpp diff --git a/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj b/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj index 50fb0cd3c..e12562c76 100644 --- a/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj +++ b/proj/vs2017/Scenario Editor/Scenario Editor.vcxproj @@ -80,6 +80,7 @@ Level3 Disabled true + /utf-8 $(SolutionDir)..\..\src\global.hpp $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4996 @@ -97,6 +98,7 @@ MultiThreadedDebugDLL Level3 Disabled + /utf-8 $(SolutionDir)..\..\src\global.hpp $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp @@ -118,6 +120,7 @@ true true true + /utf-8 $(SolutionDir)..\..\src\global.hpp $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus 4996 @@ -140,6 +143,7 @@ MaxSpeed true true + /utf-8 $(SolutionDir)..\..\deps\Catch2\include\external;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src;$(SolutionDir)..\..\rsrc\menus $(SolutionDir)..\..\src\global.hpp true diff --git a/proj/vs2017/Tests/Tests.vcxproj b/proj/vs2017/Tests/Tests.vcxproj index 01b92e677..2d6ac77d9 100644 --- a/proj/vs2017/Tests/Tests.vcxproj +++ b/proj/vs2017/Tests/Tests.vcxproj @@ -97,6 +97,7 @@ MultiThreadedDebugDLL Level3 Disabled + /utf-8 $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src true stdafx.h @@ -117,6 +118,7 @@ MultiThreadedDebugDLL Level3 Disabled + /utf-8 $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src true @@ -139,6 +141,7 @@ MaxSpeed true true + /utf-8 $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src true stdafx.h @@ -164,6 +167,7 @@ MaxSpeed true true + /utf-8 $(SolutionDir)..\..\deps\Catch2\single_include\catch2;$(SolutionDir)..\..\deps\fmtlib\include;$(SolutionDir)..\..\src\fileio\gzstream;$(SolutionDir)..\..\src\fileio\xml-parser;$(SolutionDir)..\..\src\fileio\resmgr;$(SolutionDir)..\..\src\dialogxml\widgets;$(SolutionDir)..\..\src\dialogxml\dialogs;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\tools;$(SolutionDir)..\..\src\scenario;$(SolutionDir)..\..\src\universe;$(SolutionDir)..\..\src\fileio;$(SolutionDir)..\..\src\dialogxml;$(SolutionDir)..\..\src\gfx;$(SolutionDir)..\..\src %(PreprocessorDefinitions) true From a182f80ac28b82157e885ba657e2db6770b51af2 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Aug 2025 11:46:47 -0400 Subject: [PATCH 14/24] Use fmtlib for journal and quest info --- src/game/boe.infodlg.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/boe.infodlg.cpp b/src/game/boe.infodlg.cpp index 059bd0cdd..e88971f1b 100644 --- a/src/game/boe.infodlg.cpp +++ b/src/game/boe.infodlg.cpp @@ -30,6 +30,7 @@ #include "tools/cursors.hpp" #include "utility.hpp" #include "replay.hpp" +#include short mage_spell_pos = 0,priest_spell_pos = 0,skill_pos = 0; @@ -636,7 +637,7 @@ static void fill_journal(cDialog& me) { std::string n = boost::lexical_cast(i + 1); if((long)univ.party.journal.size() > i + (store_page_on * 3)) { me["str" + n].setText(univ.party.journal[i].the_str); - me["day" + n].setText("Day: " + std::to_string(univ.party.journal[i].day)); + me["day" + n].setText(fmt::format("Day: {}", univ.party.journal[i].day)); } else{ me["str" + n].setText(""); @@ -684,12 +685,12 @@ void put_quest_info(short which_i) { quest_dlg["name"].setText(quest.name); quest_dlg["descr"].setText(quest.descr); int start = univ.party.active_quests[which_i].start; - quest_dlg["start"].setText("Day " + std::to_string(start)); + quest_dlg["start"].setText(fmt::format("Day {}", start)); if(quest.deadline > 0) - quest_dlg["chop"].setText("Day " + std::to_string(quest.deadline + int(quest.deadline_is_relative) * start)); + quest_dlg["chop"].setText(fmt::format("Day {}", quest.deadline + int(quest.deadline_is_relative) * start)); else quest_dlg["chop"].setText("None"); if(quest.gold > 0) - quest_dlg["pay"].setText(std::to_string(quest.gold) + " gold"); + quest_dlg["pay"].setText(fmt::format("{} gold", quest.gold)); else quest_dlg["pay"].setText("Unknown"); quest_dlg["done"].attachClickHandler(std::bind(&cDialog::toast, &quest_dlg, false)); quest_dlg.run(); From e2c390ee1ca4ff4994ce6748d5c60638b1db5e62 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Aug 2025 11:57:25 -0400 Subject: [PATCH 15/24] More uses of fmtlib. This file has some other things that could probably use fmtlib, but they're a bit tangled up and I don't feel like untangling them right now. --- src/game/boe.items.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/game/boe.items.cpp b/src/game/boe.items.cpp index 4e9cc41c5..6e59dfe43 100644 --- a/src/game/boe.items.cpp +++ b/src/game/boe.items.cpp @@ -30,6 +30,7 @@ #include "tools/cursors.hpp" #include "fileio/resmgr/res_dialog.hpp" #include "gfx/render_shapes.hpp" +#include extern short which_combat_type; extern eGameMode overall_mode; @@ -415,7 +416,7 @@ static void put_item_graphics(cDialog& me, size_t& first_item_shown, short& curr pic.setPict(item.graphic_num - 1000, PIC_CUSTOM_ITEM); else pic.setPict(item.graphic_num, PIC_ITEM); me[detail].setText(item.interesting_string()); - me[weight].setText("Weight: " + std::to_string(item.item_weight())); + me[weight].setText(fmt::format("Weight: {}", item.item_weight())); me[key].setText(key_stash); } else { // erase the spot me[pict].hide(); @@ -427,10 +428,8 @@ static void put_item_graphics(cDialog& me, size_t& first_item_shown, short& curr } if(current_getting_pc < 6) { - std::ostringstream sout; - sout << univ.party[current_getting_pc].name << " is carrying "; - sout << univ.party[current_getting_pc].cur_weight() << " out of " << univ.party[current_getting_pc].max_weight() << '.'; - me["prompt"].setText(sout.str()); + auto& who = univ.party[current_getting_pc]; + me["prompt"].setText(fmt::format("{} is carrying {} out of {}.", who.name, who.cur_weight(), who.max_weight())); } for(short i = 0; i < 6; i++) @@ -651,7 +650,7 @@ short get_num_of_items(short max_num) { numPanel["extra-led"].hide(); numPanel.attachClickHandlers(get_num_of_items_event_filter, {"okay", "cancel"}); - numPanel["prompt"].setText("How many? (0-" + std::to_string(max_num) + ") "); + numPanel["prompt"].setText(fmt::format("How many? ({}-{})", 0, max_num)); numPanel["number"].setTextToNum(max_num); numPanel.run(); @@ -974,7 +973,7 @@ short select_pc(eSelectPC mode, std::string title, eSkill highlight_highest, boo const cItem& picks = *pick_slot; std::string pick_name = picks.name; if(picks.ident) pick_name = picks.full_name; - extra_info = pick_name + " x " + std::to_string(picks.charges); + extra_info = fmt::format("{} x{}", pick_name, picks.charges); } }break; // Suppress a compiler warning: From 46bf17eb7485f42c73995ebdbb402a39cc606ea9 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 9 Aug 2025 20:06:46 -0400 Subject: [PATCH 16/24] Use fmtlib for some command-line errors --- src/game/boe.main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 9eb4aa3f8..2a5142992 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -134,7 +135,7 @@ struct cParseEntrance { boost::optional& opt; cParseEntrance(boost::optional& opt) : opt(opt) {} ParserResult operator()(std::string v) const { - ParserResult error = ParserResult::logicError( "Invalid entrance: '" + v + "'. Try N, S, E, or W."); + ParserResult error = ParserResult::logicError(fmt::format("Invalid entrance: '{}'. Try N, S, E, or W.", v)); if(v.size() == 1){ switch(v.at(0)){ case 'N': case 'n': case '0': @@ -166,7 +167,7 @@ struct cParseLocation { opt = boost::lexical_cast(v); return ParserResult::ok( ParseResultType::Matched ); }catch(boost::bad_lexical_cast){ - return ParserResult::logicError( "Invalid location: '" + v + "'. Try 'x,y' format."); + return ParserResult::logicError(fmt::format("Invalid location: '{}'. Try 'x,y' format.", v)); } } }; @@ -1052,8 +1053,8 @@ static void replay_feature_flags() { std::string version = next_version->GetText(); // The game build needs to support the feature version that the replay had if(!has_feature_flag(flag, version)){ - std::string error = "This replay requires a feature that is not supported in your version of Blades of Exile: " + flag + " should support '" + version + "'"; - throw error; + static const std::string error = "This replay requires a feature that is not supported in your version of Blades of Exile: {} should support '{}'"; + throw fmt::format(error, flag, version); } supported_versions.push_back(version); next_version = next_version->NextSiblingElement(false); From 27ea328078eaac71a1b0dc3564b724b62c10760d Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 9 Aug 2025 20:09:13 -0400 Subject: [PATCH 17/24] Use fmtlib for Capture Soul message --- src/game/boe.monster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/boe.monster.cpp b/src/game/boe.monster.cpp index 4d9b160ff..5db2d17b2 100644 --- a/src/game/boe.monster.cpp +++ b/src/game/boe.monster.cpp @@ -1,5 +1,6 @@ #include +#include #include "boe.global.hpp" @@ -1107,7 +1108,7 @@ void record_monst(cCreature* which_m, bool forced) { univ.party.imprisoned_monst[r1] = which_m->number; } ASB("Capture Soul: Success!"); - add_string_to_buf(" Caught in slot " + std::to_string(r1 + 1) + "."); + add_string_to_buf(fmt::format(" Caught in slot {}.", r1 + 1)); play_sound(53); } } From 2200cb2bd11ae446cdd63c3711873622f569d92b Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 9 Aug 2025 20:12:08 -0400 Subject: [PATCH 18/24] Use fmtlib for spell info in shops --- src/game/boe.newgraph.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/boe.newgraph.cpp b/src/game/boe.newgraph.cpp index b978b3a02..f192cf752 100644 --- a/src/game/boe.newgraph.cpp +++ b/src/game/boe.newgraph.cpp @@ -34,6 +34,7 @@ #include "tools/enum_map.hpp" #include "replay.hpp" #include +#include short monsters_faces[190] = { 0,1,2,3,4,5,6,7,8,9, @@ -824,11 +825,11 @@ void draw_shop_graphics(bool item_pressed, bool item_help_pressed, rectangle cli } break; case eShopItemType::MAGE_SPELL: spell = cSpell::fromNum(eSkill::MAGE_SPELLS, base_item.item_level); - cur_info_str = "Level: " + std::to_string((*spell).level) + " SP: " + std::to_string((*spell).cost); + cur_info_str = fmt::format("Level: {} SP: {}", (*spell).level, (*spell).cost); break; case eShopItemType::PRIEST_SPELL: spell = cSpell::fromNum(eSkill::PRIEST_SPELLS, base_item.item_level); - cur_info_str = "Level: " + std::to_string((*spell).level) + " SP: " + std::to_string((*spell).cost); + cur_info_str = fmt::format("Level: {} SP: {}", (*spell).level, (*spell).cost); break; case eShopItemType::SKILL: cur_info_str = "Increase skill by 1"; @@ -1101,4 +1102,4 @@ void handle_target_mode(eGameMode target_mode, int range, eSpell spell) { draw_terrain(); } } -} \ No newline at end of file +} From 452f8bede5168e67155d728120242236942cb176 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 9 Aug 2025 20:28:37 -0400 Subject: [PATCH 19/24] More use of fmtlib --- src/game/boe.party.cpp | 33 ++++++++++++++++----------------- src/universe/living.cpp | 9 +++++++++ src/universe/living.hpp | 2 +- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/game/boe.party.cpp b/src/game/boe.party.cpp index fee2e61b7..7c4bf839e 100644 --- a/src/game/boe.party.cpp +++ b/src/game/boe.party.cpp @@ -5,6 +5,7 @@ #include #include +#include #include "universe/universe.hpp" @@ -178,7 +179,7 @@ void put_party_in_scen(std::string scen_name, bool force, bool allow_unpacked) { // Make sure the game build supports all the scenario's features for(auto pair : univ.scenario.feature_flags){ if(!has_feature_flag(pair.first, pair.second)){ - showError("This scenario requires a feature that is not supported in your version of Blades of Exile: " + pair.first + " should support '" + pair.second + "'"); + showError(fmt::format("This scenario requires a feature that is not supported in your version of Blades of Exile: {} should support '{}'", pair.first, pair.second)); return; } } @@ -349,7 +350,7 @@ void award_xp(short pc_num,short amt,bool force) { play_sound(7); univ.party[pc_num].level++; std::string level = std::to_string(univ.party[pc_num].level); - add_string_to_buf(" " + univ.party[pc_num].name + " is level " + level + "!"); + add_string_to_buf(fmt::format(" {} is level {}!", univ.party[pc_num].name,level)); univ.party[pc_num].skill_pts += (univ.party[pc_num].level < 20) ? 5 : 4; add_hp = (univ.party[pc_num].level < 26) ? get_ran(1,2,6) + skill_bonus[univ.party[pc_num].skills[eSkill::STRENGTH]] : max (skill_bonus[univ.party[pc_num].skills[eSkill::STRENGTH]],0); @@ -369,7 +370,7 @@ void award_xp(short pc_num,short amt,bool force) { void drain_pc(cPlayer& which_pc,short how_much) { if(which_pc.main_status == eMainStatus::ALIVE) { which_pc.experience = max(which_pc.experience - how_much,0); - add_string_to_buf(" " + which_pc.name + " drained."); + which_pc.spell_note(eSpellNote::DRAINED_XP); } } @@ -840,11 +841,11 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) { } if(spell_num == eSpell::RESIST_MAGIC && target < 6) { univ.party[target].status[eStatus::MAGIC_RESISTANCE] += 2 + adj + get_ran(2,1,2); - add_string_to_buf(" " + univ.party[target].name + " protected."); + univ.party[target].spell_note(eSpellNote::PROTECTED); } break; default: - add_string_to_buf(" Error: Mage spell " + (*spell_num).name() + " not implemented for town mode.", 4); + add_string_to_buf(fmt::format(" Error: Mage spell {} not implemented for town mode.", (*spell_num).name()), 4); break; } } @@ -901,7 +902,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { r1 = max(0,store); if(spell_num == eSpell::MANNA_MINOR) r1 = r1 / 3; - add_string_to_buf(" You gain " + std::to_string(r1) + " food. "); + add_string_to_buf(fmt::format(" You gain {} food.", r1)); give_food(r1,true); break; @@ -1080,7 +1081,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { univ.party[target].status[eStatus::WEBS] = 0; break; default: - add_string_to_buf(" Error: Healing spell " + (*spell_num).name() + " not implemented for town mode.", 4); + add_string_to_buf(fmt::format(" Error: Healing spell {} not implemented for town mode.", (*spell_num).name()), 4); break; } add_string_to_buf(sout.str()); @@ -1207,7 +1208,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { univ.party[pc_num].cur_sp -= (*spell_num).cost; if(spell_num != eSpell::REVIVE_ALL) { r1 = get_ran((spell_num == eSpell::HEAL_ALL ? 6 : 3) + adj, 1, 4); - add_string_to_buf(" Party healed " + std::to_string(r1) + "."); + add_string_to_buf(fmt::format(" Party healed {}.", r1)); univ.party.heal(r1); play_sound(52); } else { @@ -1236,7 +1237,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { case eSpell::CLEANSE_MAJOR: add_string_to_buf(" Party cleansed.");break; case eSpell::HYPERACTIVITY: add_string_to_buf(" Party is now really, REALLY awake.");break; default: - add_string_to_buf(" Error: Priest group spell " + (*spell_num).name() + " not implemented for town mode.", 4); + add_string_to_buf(fmt::format(" Error: Priest group spell {} not implemented for town mode.", (*spell_num).name()), 4); break; } @@ -1263,7 +1264,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { break; default: - add_string_to_buf(" Error: Priest spell " + (*spell_num).name() + " not implemented for town mode.", 4); + add_string_to_buf(fmt::format(" Error: Priest spell {} not implemented for town mode.", (*spell_num).name()), 4); break; } } @@ -1432,7 +1433,7 @@ void cast_town_spell(location where) { break; default: - add_string_to_buf(" Error: Spell " + (*town_spell).name() + " not implemented for town mode.", 4); + add_string_to_buf(fmt::format(" Error: Spell {} not implemented for town mode.", (*town_spell).name()), 4); break; } @@ -2071,10 +2072,8 @@ static bool finish_pick_spell(cDialog& me, bool spell_toast, const short store_s } void print_cast_status(eCastStatus status, eSkill type, std::string pc_name) { - std::string prefix = "Cast"; + std::string prefix = pc_name.empty() ? "Cast" : fmt::format("Cast ({}): ", pc_name); // When multiple PCs are checked, explain why each one can't cast. - if(!pc_name.empty()) prefix += " (" + pc_name + ")"; - prefix += ": "; switch(status){ case CAST_OK: break; case NO_CAST_ANAMA: @@ -2637,7 +2636,7 @@ short damage_pc(cPlayer& which_pc,short how_much,eDamageType damage_type,eRace t which_pc.status[eStatus::ASLEEP]--; if(do_print) - add_string_to_buf(" " + which_pc.name + " takes " + std::to_string(how_much) + '.'); + add_string_to_buf(fmt::format(" {} takes {}.", which_pc.name, how_much)); if(damage_type != eDamageType::MARKED && boom) { if(is_combat()) boom_space(which_pc.combat_pos,overall_mode,boom_type,how_much,sound_type); @@ -2658,11 +2657,11 @@ short damage_pc(cPlayer& which_pc,short how_much,eDamageType damage_type,eRace t which_pc.cur_health = 0; else // Check if PC can die if(how_much > 25) { - add_string_to_buf(" " + which_pc.name + " is obliterated."); + which_pc.spell_note(eSpellNote::OBLITERATED); kill_pc(which_pc, eMainStatus::DUST); } else { - add_string_to_buf(" " + which_pc.name + " is killed."); + which_pc.spell_note(eSpellNote::KILLED); kill_pc(which_pc,eMainStatus::DEAD); } if(which_pc.cur_health == 0 && which_pc.main_status == eMainStatus::ALIVE) diff --git a/src/universe/living.cpp b/src/universe/living.cpp index e5ca9a4ce..2c2ded203 100644 --- a/src/universe/living.cpp +++ b/src/universe/living.cpp @@ -259,6 +259,15 @@ void iLiving::spell_note(eSpellNote which_mess) const { case eSpellNote::HEAT_RAY: msg = " Hits {} with heat ray!"; break; + case eSpellNote::DRAINED_XP: + msg = " {} drained."; + break; + case eSpellNote::PROTECTED: + msg = " {} protected."; + break; + case eSpellNote::KILLED: + msg = " {} is killed."; + break; default: msg += "{}: Unknown action " + std::to_string(int(which_mess)); } diff --git a/src/universe/living.hpp b/src/universe/living.hpp index 5ba85c5b4..ba93214e0 100644 --- a/src/universe/living.hpp +++ b/src/universe/living.hpp @@ -30,7 +30,7 @@ enum class eSpellNote { DIES = 46, RALLIES = 47, CLEANS_ACID = 48, BREAKS_BARRIER = 49, BREAKS_FORCECAGE = 50, OBLITERATED = 51, TRAPPED = 52, THROWS_DART = 53, THROWS_KNIFE = 54, FIRES_RAY = 55, GAZES2 = 56, BREATHES_ON = 57, THROWS_WEB = 58, SPITS = 59, BREATHES = 60, - HEAT_RAY = 61, + HEAT_RAY = 61, DRAINED_XP = 62, PROTECTED = 63, KILLED = 64, }; class iLiving { From 57274380e5c6b52481e3e0b48228245b2d4fd4a0 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 10 Aug 2025 11:56:44 -0400 Subject: [PATCH 20/24] More fmtlib uses --- src/game/boe.specials.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/game/boe.specials.cpp b/src/game/boe.specials.cpp index 87ee53861..5945d5dd4 100644 --- a/src/game/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -35,6 +35,7 @@ #include "boe.menus.hpp" #include "replay.hpp" #include +#include #include "winutil.hpp" extern eGameMode overall_mode; @@ -639,7 +640,7 @@ void use_item(short pc,short item) { if(!the_item.ident) name = the_item.name.c_str(); else name = the_item.full_name.c_str(); - add_string_to_buf("Use: " + name); + add_string_to_buf(fmt::format("Use: {}", name)); if(the_item.variety == eItemType::POTION) play_sound(56); @@ -1116,7 +1117,7 @@ void use_item(short pc,short item) { case eSpell::WALL_ICE_BALL: add_string_to_buf(" It shoots a blue sphere."); break; case eSpell::CHARM_FOE: add_string_to_buf(" It fires a lovely, sparkling beam."); break; case eSpell::ANTIMAGIC: add_string_to_buf(" Your hair stands on end."); break; - default: add_string_to_buf(" It casts a spell: " + (*spell).name()); break; + default: add_string_to_buf(fmt::format(" It casts a spell: {}", (*spell).name())); break; } switch((*spell).need_select) { case SELECT_NO: break; @@ -1172,7 +1173,7 @@ void use_item(short pc,short item) { str1 = str1.substr(0, r1); } r1 = the_item.graphic_num; - cStrDlog(str1, str2, "Reading " + the_item.name, r1, PIC_ITEM).show(); + cStrDlog(str1, str2, fmt::format("Reading {}", the_item.name), r1, PIC_ITEM).show(); break; // Now for all the non-usable abilities. These are enumerated here so that the compiler can catch if we've missed one. case eItemAbil::ACCURACY: case eItemAbil::ANTIMAGIC_WEAPON: case eItemAbil::ASPTONGUE: case eItemAbil::BOOST_MAGIC: @@ -2126,7 +2127,7 @@ void run_special(eSpecCtx which_mode, eSpecCtxType which_type, spec_num_t start_ case eSpecCtxType::OUTDOOR: type = "outdoors" ; break; case eSpecCtxType::TOWN: type = "town"; break; } - add_string_to_buf("Warning: Null " + type + " special called (ID " + std::to_string(cur_spec) + ") - was this intended?", 4); + add_string_to_buf(fmt::format("Warning: Null {} special called (ID {}) - was this intended?", type, cur_spec), 4); } general_spec(ctx); break; @@ -2180,7 +2181,7 @@ cSpecial get_node(spec_num_t cur_spec, eSpecCtxType cur_spec_type) { switch(cur_spec_type) { case eSpecCtxType::SCEN: if(cur_spec != minmax(0,univ.scenario.scen_specials.size() - 1,cur_spec)) { - showError("The scenario called a scenario special node out of range: " + std::to_string(cur_spec)); + showError(fmt::format("The scenario called a scenario special node out of range: {}", cur_spec)); return dummy_node; } return univ.scenario.scen_specials[cur_spec]; @@ -2190,7 +2191,7 @@ cSpecial get_node(spec_num_t cur_spec, eSpecCtxType cur_spec_type) { return dummy_node; } if(cur_spec != minmax(0,univ.out->specials.size() - 1,cur_spec)) { - showError("The scenario called an outdoor special node out of range: " + std::to_string(cur_spec)); + showError(fmt::format("The scenario called an outdoor special node out of range: {}", cur_spec)); return dummy_node; } return univ.out->specials[cur_spec]; @@ -2200,7 +2201,7 @@ cSpecial get_node(spec_num_t cur_spec, eSpecCtxType cur_spec_type) { return dummy_node; } if(cur_spec != minmax(0,univ.town->specials.size() - 1,cur_spec)) { - showError("The scenario called a town special node out of range: " + std::to_string(cur_spec)); + showError(fmt::format("The scenario called a town special node out of range: {}", cur_spec)); return dummy_node; } return univ.town->specials[cur_spec]; @@ -2551,7 +2552,7 @@ void general_spec(const runtime_state& ctx) { add_string_to_buf("You have completed a quest!"); if(quest.gold > 0) { int gold = quest.gold; - add_string_to_buf(" Received " + std::to_string(gold) + " as a reward."); + add_string_to_buf(fmt::format(" Received {} as a reward.", gold)); give_gold(gold, true); } if(quest.xp > 0) @@ -2561,7 +2562,7 @@ void general_spec(const runtime_state& ctx) { break; } default: - showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); + showError(fmt::format("Special node type \"{}\" is either miscategorized or unimplemented!", (*cur_node.type).name())); break; } if(check_mess) handle_message(ctx); @@ -2705,7 +2706,7 @@ void oneshot_spec(const runtime_state& ctx) { case eSpecType::ONCE_DISPLAY_MSG: break; // Nothing to do here, but need to include it to prevent the below error from showing. default: - showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); + showError(fmt::format("Special node type \"{}\" is either miscategorized or unimplemented!", (*cur_node.type).name())); break; } if(check_mess) { @@ -3319,7 +3320,7 @@ void affect_spec(const runtime_state& ctx) { } break; default: - showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); + showError(fmt::format("Special node type \"{}\" is either miscategorized or unimplemented!", (*cur_node.type).name())); break; } if(check_mess) { @@ -3796,7 +3797,7 @@ void ifthen_spec(const runtime_state& ctx) { ctx.next_spec = spec.ex1c; break; default: - showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); + showError(fmt::format("Special node type \"{}\" is either miscategorized or unimplemented!", (*cur_node.type).name())); break; } if(check_mess) { @@ -4181,7 +4182,7 @@ void townmode_spec(const runtime_state& ctx) { case eSpecType::TOWN_SET_ATTITUDE:{ int num_monst = univ.town.monst.size(); if((spec.ex1a < 0) || (spec.ex1a >= num_monst)){ - showError("Tried to change the attitude of nonexistent monster " + std::to_string(spec.ex1a) + " of 0..." + std::to_string(num_monst)); + showError(fmt::format("Tried to change the attitude of nonexistent monster {} of 0...{}", spec.ex1a, num_monst)); break; } if(spec.ex1b < 0 || spec.ex1b > 3){ @@ -4397,7 +4398,7 @@ void townmode_spec(const runtime_state& ctx) { sf::sleep(sf::seconds(spec.ex2b)); break; default: - showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); + showError(fmt::format("Special node type \"{}\" is either miscategorized or unimplemented!", (*cur_node.type).name())); break; } if(check_mess) { @@ -4533,7 +4534,7 @@ void rect_spec(const runtime_state& ctx){ else take_explored(l.x, l.y); break; default: - showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); + showError(fmt::format("Special node type \"{}\" is either miscategorized or unimplemented!", (*cur_node.type).name())); break; } } @@ -4580,7 +4581,7 @@ void outdoor_spec(const runtime_state& ctx){ case eSpecType::OUT_FORCE_TOWN: { short town = spec.ex1a; if(town < 0 || town >= univ.scenario.towns.size()){ - showError("The scenario attempted to put the party in a nonexistent town: " + std::to_string(town)); + showError(fmt::format("The scenario attempted to put the party in a nonexistent town: {}", town)); break; } size_t town_dim = univ.scenario.towns[town]->max_dim; @@ -4598,7 +4599,7 @@ void outdoor_spec(const runtime_state& ctx){ } break; default: - showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); + showError(fmt::format("Special node type \"{}\" is either miscategorized or unimplemented!", (*cur_node.type).name())); break; } From d01b4a4bac0e5d947520d0b5dac4c41117b29db8 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 10 Aug 2025 13:07:16 -0400 Subject: [PATCH 21/24] Fix some uses of deprecated SFML API --- src/gfx/render_image.cpp | 4 ++-- src/gfx/render_text.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gfx/render_image.cpp b/src/gfx/render_image.cpp index 9554675c4..9cfec9ab7 100644 --- a/src/gfx/render_image.cpp +++ b/src/gfx/render_image.cpp @@ -119,8 +119,8 @@ void rect_draw_some_item(const sf::Texture& src_gworld,rectangle src_rect,const rect_draw_some_item(src_gworld, src_rect, src, dest_rect); src.display(); - maskShader.setParameter("texture", sf::Shader::CurrentTexture); - maskShader.setParameter("mask", mask_gworld); + maskShader.setUniform("texture", sf::Shader::CurrentTexture); + maskShader.setUniform("mask", mask_gworld); rect_draw_some_item(src.getTexture(), dest_rect, targ_gworld, targ_rect, &maskShader, colour); } diff --git a/src/gfx/render_text.cpp b/src/gfx/render_text.cpp index 869ac0704..a72c2558a 100644 --- a/src/gfx/render_text.cpp +++ b/src/gfx/render_text.cpp @@ -51,7 +51,7 @@ void TextStyle::applyTo(sf::Text& text, double scale) const { if(italic) style |= sf::Text::Italic; if(underline) style |= sf::Text::Underlined; text.setStyle(style); - text.setColor(colour); + text.setFillColor(colour); } struct text_params_t { @@ -347,10 +347,10 @@ static void win_draw_string(sf::RenderTarget& dest_window,rectangle dest_rect,st bounds.offset(-adjust_x, -adjust_y); if(options.returnType == text_params_t::RECTS) options.returnRects.push_back(bounds); - str_to_draw.setColor(options.hilite_fg); + str_to_draw.setFillColor(options.hilite_fg); bounds.inset(0,-4); fill_rect(dest_window, bounds, options.hilite_bg); - } else str_to_draw.setColor(options.style.colour); + } else str_to_draw.setFillColor(options.style.colour); draw_scale_aware_text(dest_window, str_to_draw); } } From 48683cea19e220db65a4fd618d45abe6c64ca52d Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 10 Aug 2025 13:07:38 -0400 Subject: [PATCH 22/24] This should fix a couple warnings seen in the Linux CI --- src/game/boe.specials.cpp | 1 + src/gfx/render_shapes.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/boe.specials.cpp b/src/game/boe.specials.cpp index 5945d5dd4..62d80e8a4 100644 --- a/src/game/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -4725,4 +4725,5 @@ iLiving& current_pc_picked_in_spec_enc(const runtime_state& ctx) { return *targ; else return univ.party; } + BOOST_UNREACHABLE_RETURN(*ctx.cur_target); } diff --git a/src/gfx/render_shapes.cpp b/src/gfx/render_shapes.cpp index bd88bf313..96477a447 100644 --- a/src/gfx/render_shapes.cpp +++ b/src/gfx/render_shapes.cpp @@ -15,7 +15,7 @@ #include "render_image.hpp" using boost::math::constants::pi; -using pt_idx_t = decltype(((sf::Shape*)nullptr)->getPointCount()); +using pt_idx_t = decltype(std::declval().getPointCount()); std::map colour_map = { {"white", Colours::WHITE}, From c2fa1bae795664cad3dc088c57a3c073de415c33 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 10 Aug 2025 17:04:57 -0400 Subject: [PATCH 23/24] A few more fmtlib uses --- src/game/boe.text.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/game/boe.text.cpp b/src/game/boe.text.cpp index 2aa7a3ac8..7b0e35a6d 100644 --- a/src/game/boe.text.cpp +++ b/src/game/boe.text.cpp @@ -29,6 +29,7 @@ const int LINES_IN_ITEM_WIN = 8; #include "tools/winutil.hpp" #include "replay.hpp" #include +#include typedef struct { std::string message; @@ -680,13 +681,13 @@ void print_party_stats() { } if(overall_mode == MODE_STARTUP) return; add_string_to_buf("PARTY STATS:"); - add_string_to_buf(" Number of kills: " + std::to_string(univ.party.total_m_killed)); + add_string_to_buf(fmt::format(" Number of kills: {}", univ.party.total_m_killed)); if((is_town()) || ((is_combat()) && (which_combat_type == 1))) { - add_string_to_buf(" Kills in this town: " + std::to_string(univ.town->m_killed)); + add_string_to_buf(fmt::format(" Kills in this town: {}", univ.town->m_killed)); } - add_string_to_buf(" Total experience: " + std::to_string(univ.party.total_xp_gained)); - add_string_to_buf(" Total damage done: " + std::to_string(univ.party.total_dam_done)); - add_string_to_buf(" Total damage taken: " + std::to_string(univ.party.total_dam_taken)); + add_string_to_buf(fmt::format(" Total experience: {}", univ.party.total_xp_gained)); + add_string_to_buf(fmt::format(" Total damage done: {}", univ.party.total_dam_done)); + add_string_to_buf(fmt::format(" Total damage taken: {}", univ.party.total_dam_taken)); print_buf(); } @@ -1033,7 +1034,7 @@ void add_string_to_buf(std::string str, unsigned short indent) { if(wrapped_str == text_buffer[prev_pointer].message){ text_buffer[prev_pointer].duplicate_count++; - std::string test_fit = wrapped_str + " (x" + std::to_string(text_buffer[prev_pointer].duplicate_count) + ")"; + std::string test_fit = fmt::format("{} (x{})", wrapped_str, text_buffer[prev_pointer].duplicate_count); if(string_length(test_fit, buf_style) >= width){ text_buffer[prev_pointer].line_count = line_count + 1; // The duplicate count in parenthesis is on its own line @@ -1121,7 +1122,7 @@ void print_buf () { }else{ message += " "; } - message += "(x" + std::to_string(text_buffer[message_idx].duplicate_count) + ")"; + message += fmt::format("(x{})", text_buffer[message_idx].duplicate_count); } moveTo = location(4, 1 + 12 * (LINES_IN_TEXT_WIN + line_offset - num_lines_total - text_buffer[message_idx].line_count)); From 0e558d48c15ee898aa08d9195e45ef2d55bae21f Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 18 Aug 2025 13:56:07 -0400 Subject: [PATCH 24/24] A couple more fmtlib uses --- src/game/boe.town.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index 7f46d89ad..4c799cfec 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "boe.global.hpp" @@ -84,7 +85,7 @@ void start_town_mode(short which_town, short entry_dir, bool debug_enter) { if(town_number < 0 || town_number >= univ.scenario.towns.size()) { showError("The scenario tried to put you into a town that doesn't exist.", - "Requested town: " + std::to_string(town_number) + "|Max town: " + std::to_string(univ.scenario.towns.size())); + fmt::format("Requested town: {}|Max town: {}", town_number, univ.scenario.towns.size())); return; } @@ -106,7 +107,7 @@ void start_town_mode(short which_town, short entry_dir, bool debug_enter) { if(town_number < 0 || town_number >= univ.scenario.towns.size()) { showError("The scenario tried to put you into a town that doesn't exist.", - "Requested town: " + std::to_string(former_town) + "|Adjusted town: " + std::to_string(town_number) + "|Max town: " + std::to_string(univ.scenario.towns.size())); + fmt::format("Requested town: {}|Adjusted town: {}|Max town: {}", former_town, town_number, univ.scenario.towns.size())); return; } @@ -1640,4 +1641,4 @@ void move_thing(ePushableThing type, location from_loc, location to_loc) { && univ.town.items[i].contained && univ.town.items[i].held) univ.town.items[i].item_loc = to_loc; } -} \ No newline at end of file +}