From ac8ab971161642ee5a8aac6170ee86eae3f3b6f7 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Mon, 30 Oct 2023 21:52:23 -0500 Subject: [PATCH 01/19] modernize parts of plAvBrainHuman --- .../PubUtilLib/plAvatar/plAvBrainHuman.cpp | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp index 12fee0554b..0a6f0f29b0 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp @@ -206,12 +206,7 @@ void plAvBrainHuman::Activate(plArmatureModBase *avMod) void plAvBrainHuman::IInitBoneMap() { - struct tuple { - HumanBoneID fID; - const char * fName; - }; - - tuple tupleMap[] = + static constexpr std::tuple BoneMap[] = { { Pelvis, "Bone_Root" }, // left leg @@ -304,20 +299,14 @@ void plAvBrainHuman::IInitBoneMap() { RThumb3, "Bone_RThumb3" }, }; - int numTuples = sizeof(tupleMap) / sizeof(tuple); - - for(int i = 0; i < numTuples; i++) + for (const auto& [BoneId, BoneName] : BoneMap) { - HumanBoneID id = tupleMap[i].fID; - ST::string name = tupleMap[i].fName; - - const plSceneObject * bone = this->fAvMod->FindBone(name); - if( bone ) + if( const plSceneObject * bone = this->fAvMod->FindBone(BoneName) ) { - fAvMod->AddBoneMapping(id, bone); + fAvMod->AddBoneMapping(BoneId, bone); } else - hsStatusMessageF("Couldn't find standard bone %s.", name.c_str()); + hsStatusMessageF("Couldn't find standard bone %s.", BoneName.data()); } } From 0dcc255d9748ddc8a527236f319e157d738e6ae2 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Mon, 30 Oct 2023 22:04:03 -0500 Subject: [PATCH 02/19] use empty instead of explictly checking the size. --- Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index 26c35d92ca..e28a26d7ca 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp @@ -133,7 +133,7 @@ plArmatureModBase::~plArmatureModBase() { delete fController; - while (fUnusedBones.size() > 0) + while (!fUnusedBones.empty()) { delete fUnusedBones.back(); fUnusedBones.pop_back(); @@ -143,7 +143,7 @@ plArmatureModBase::~plArmatureModBase() bool plArmatureModBase::MsgReceive(plMessage* msg) { plArmatureBrain *curBrain = nullptr; - if (fBrains.size() > 0) + if (!fBrains.empty()) { curBrain = fBrains.back(); if(curBrain->MsgReceive(msg)) @@ -179,7 +179,7 @@ bool plArmatureModBase::IEval(double time, float elapsed, uint32_t dirty) { if (IsFinal()) { - if (fBrains.size()) + if (!fBrains.empty()) { plArmatureBrain *curBrain = fBrains.back(); if (curBrain) @@ -345,7 +345,7 @@ void plArmatureModBase::PushBrain(plArmatureBrain *brain) void plArmatureModBase::PopBrain() { plArmatureBrain *oldBrain = nullptr; - if (fBrains.size() > 0) + if (!fBrains.empty()) { oldBrain = fBrains.back(); oldBrain->Deactivate(); @@ -362,7 +362,7 @@ void plArmatureModBase::PopBrain() plArmatureBrain *plArmatureModBase::GetCurrentBrain() const { plArmatureBrain *result = nullptr; - if (fBrains.size() > 0) + if (!fBrains.empty()) result = fBrains.back(); return result; From 2b07951ca0bfcfd441b113da4cdd3d8f2c83869f Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Mon, 30 Oct 2023 22:47:42 -0500 Subject: [PATCH 03/19] use better naming --- Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp index 0a6f0f29b0..e31beafcb1 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp @@ -299,11 +299,11 @@ void plAvBrainHuman::IInitBoneMap() { RThumb3, "Bone_RThumb3" }, }; - for (const auto& [BoneId, BoneName] : BoneMap) + for (const auto& [BoneID, BoneName] : BoneMap) { if( const plSceneObject * bone = this->fAvMod->FindBone(BoneName) ) { - fAvMod->AddBoneMapping(BoneId, bone); + fAvMod->AddBoneMapping(BoneID, bone); } else hsStatusMessageF("Couldn't find standard bone %s.", BoneName.data()); From 534f79ecd20bbced4883f915e330775cfc7cd347 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Mon, 30 Oct 2023 22:48:31 -0500 Subject: [PATCH 04/19] replace for loop with std::any_of --- .../PubUtilLib/plAgeDescription/plAgeDescription.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp index 42b2fa1bf9..1d2f0aeadf 100644 --- a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp @@ -491,11 +491,8 @@ void plAgeDescription::CopyFrom(const plAgeDescription& other) bool plAgeDescription::FindLocation(const plLocation& loc) const { - for (const plAgePage& page : fPages) + return std::any_of(fPages.begin(), fPages.end(), [this, loc](const plAgePage& page) { - plLocation pageLoc = CalcPageLocation(page.GetName()); - if (pageLoc == loc) - return true; - } - return false; + return loc == CalcPageLocation(page.GetName()); + }); } From 7f19c6d094bbc6536afc7f73d2723c31f24d0d56 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Tue, 31 Oct 2023 04:35:04 -0500 Subject: [PATCH 05/19] modernize for loop --- Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp index c338ec1ea6..11edc9147c 100644 --- a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp +++ b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp @@ -438,17 +438,17 @@ void plATCAnim::Write(hsStream *stream, hsResMgr *mgr) stream->WriteLEFloat(fEaseOutLength); stream->WriteLE32((uint32_t)fMarkers.size()); - for (MarkerMap::iterator it = fMarkers.begin(); it != fMarkers.end(); it++) + for (auto& fMarker : fMarkers) { - stream->WriteSafeString(it->first); - stream->WriteLEFloat(it->second); + stream->WriteSafeString(fMarker.first); + stream->WriteLEFloat(fMarker.second); } stream->WriteLE32((uint32_t)fLoops.size()); - for (LoopMap::iterator loopIt = fLoops.begin(); loopIt != fLoops.end(); loopIt++) + for (auto& fLoop : fLoops) { - stream->WriteSafeString(loopIt->first); - std::pair& loop = loopIt->second; + stream->WriteSafeString(fLoop.first); + std::pair& loop = fLoop.second; stream->WriteLEFloat(loop.first); stream->WriteLEFloat(loop.second); } From eb79e584a9f1d583f1f070dbc2468a5679babce2 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Tue, 31 Oct 2023 05:30:25 -0500 Subject: [PATCH 06/19] use range based for loop --- .../FeatureLib/pfConsole/pfConsoleDirSrc.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp index d833caef05..d7556eceef 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp @@ -61,13 +61,13 @@ bool pfConsoleDirSrc::ParseDirectory(const plFileName& path, const char* mask /* hsAssert(fEngine != nullptr, "Cannot do a dir execute without an engine!"); std::vector files = plFileSystem::ListDir(path, mask); - for (auto iter = files.begin(); iter != files.end(); ++iter) + for (auto& file : files) { - plFileName name = iter->GetFileName(); + plFileName name = file.GetFileName(); if (AlreadyProcessedFile(path, name)) continue; AddProcessedFile(path, name); - if (!fEngine->ExecuteFile(*iter)) + if (!fEngine->ExecuteFile(file)) { // Change the following line once we have a better way of reporting // errors in the parsing @@ -90,9 +90,8 @@ bool pfConsoleDirSrc::ParseDirectory(const plFileName& path, const char* mask /* void pfConsoleDirSrc::ResetProcessedFiles() { - int i; - for(i=0;ifFile && path == fProcessedFiles[i]->fPath) + for (const auto& fProcessedFile : fProcessedFiles) + { + if (file == fProcessedFile->fFile && path == fProcessedFile->fPath) return true; } } From 685cbaf431327ae51a31dfc295fb4feb28344e81 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Tue, 31 Oct 2023 05:30:43 -0500 Subject: [PATCH 07/19] make these constexpr --- Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleParser.cpp b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleParser.cpp index 8c1a0957ea..19e3fe4e65 100644 --- a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleParser.cpp +++ b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleParser.cpp @@ -46,8 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfConsoleCmd.h" -static const char kTokenSeparators[] = " =\r\n\t,"; -static const char kTokenGrpSeps[] = " =\r\n._\t,"; +static constexpr char kTokenSeparators[] = " =\r\n\t,"; +static constexpr char kTokenGrpSeps[] = " =\r\n._\t,"; std::optional pfConsoleTokenizer::NextNamePart() { From 25b54348acfa02f5027662a43a6bfd98d98afacd Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Wed, 1 Nov 2023 02:16:23 -0500 Subject: [PATCH 08/19] use zero initialization instead of memset --- Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp b/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp index 0604e448c5..87844a7641 100644 --- a/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp +++ b/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp @@ -99,14 +99,12 @@ void plClient::IChangeResolution(int width, int height) HMONITOR monitor = MonitorFromWindow(fWindowHndl, MONITOR_DEFAULTTONULL); if (!monitor) return; - MONITORINFOEXW moninfo; - memset(&moninfo, 0, sizeof(moninfo)); + MONITORINFOEXW moninfo = {}; moninfo.cbSize = sizeof(moninfo); GetMonitorInfoW(monitor, &moninfo); // Fetch a base display settings - DEVMODEW devmode; - memset(&devmode, 0, sizeof(devmode)); + DEVMODEW devmode = {}; devmode.dmSize = sizeof(devmode); EnumDisplaySettingsW(moninfo.szDevice, ENUM_REGISTRY_SETTINGS, &devmode); From 9869a1549e348564ef9d0a9f7cf3f842151623f9 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 10:17:25 -0500 Subject: [PATCH 09/19] Update Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp accepted suggestion Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp index e31beafcb1..d74e2599e4 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp @@ -301,7 +301,7 @@ void plAvBrainHuman::IInitBoneMap() for (const auto& [BoneID, BoneName] : BoneMap) { - if( const plSceneObject * bone = this->fAvMod->FindBone(BoneName) ) + if (const plSceneObject * bone = fAvMod->FindBone(BoneName)) { fAvMod->AddBoneMapping(BoneID, bone); } From db1f392143bfe8d3d1dec83cc8b56077ff1f7df4 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 10:18:38 -0500 Subject: [PATCH 10/19] Update Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp b/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp index 87844a7641..669fd8c2e0 100644 --- a/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp +++ b/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp @@ -99,7 +99,7 @@ void plClient::IChangeResolution(int width, int height) HMONITOR monitor = MonitorFromWindow(fWindowHndl, MONITOR_DEFAULTTONULL); if (!monitor) return; - MONITORINFOEXW moninfo = {}; + MONITORINFOEXW moninfo{}; moninfo.cbSize = sizeof(moninfo); GetMonitorInfoW(monitor, &moninfo); From fce75e96778dde392e78a2330f81037a570a68b4 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 10:18:47 -0500 Subject: [PATCH 11/19] Update Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp b/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp index 669fd8c2e0..e01bbde091 100644 --- a/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp +++ b/Sources/Plasma/Apps/plClient/win32/plClient_Win.cpp @@ -104,7 +104,7 @@ void plClient::IChangeResolution(int width, int height) GetMonitorInfoW(monitor, &moninfo); // Fetch a base display settings - DEVMODEW devmode = {}; + DEVMODEW devmode{}; devmode.dmSize = sizeof(devmode); EnumDisplaySettingsW(moninfo.szDevice, ENUM_REGISTRY_SETTINGS, &devmode); From d70578ce099dd25c4470137714d38ca2037a2d0e Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 10:18:57 -0500 Subject: [PATCH 12/19] Update Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp index d7556eceef..d1f1b42f4c 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp @@ -61,7 +61,7 @@ bool pfConsoleDirSrc::ParseDirectory(const plFileName& path, const char* mask /* hsAssert(fEngine != nullptr, "Cannot do a dir execute without an engine!"); std::vector files = plFileSystem::ListDir(path, mask); - for (auto& file : files) + for (const auto& file : files) { plFileName name = file.GetFileName(); if (AlreadyProcessedFile(path, name)) From f8a81957c620bf7f7fc8e8b56ddb30dc44a6d987 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 10:57:32 -0500 Subject: [PATCH 13/19] remove the extra copy --- Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp index d1f1b42f4c..8251766ee9 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp @@ -63,17 +63,16 @@ bool pfConsoleDirSrc::ParseDirectory(const plFileName& path, const char* mask /* std::vector files = plFileSystem::ListDir(path, mask); for (const auto& file : files) { - plFileName name = file.GetFileName(); - if (AlreadyProcessedFile(path, name)) + if (AlreadyProcessedFile(path, file)) continue; - AddProcessedFile(path, name); + AddProcessedFile(path, file); if (!fEngine->ExecuteFile(file)) { // Change the following line once we have a better way of reporting // errors in the parsing ST::string_stream error, caption; - caption << "Error parsing " << name.AsString(); + caption << "Error parsing " << file.AsString(); error << fEngine->GetErrorMsg() << ":\n\nCommand: '" << fEngine->GetLastErrorLine() << "'\n\nPress OK to continue parsing files."; From c7fb0c088860a63721ace91ca5302a7931d64bd4 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 11:00:13 -0500 Subject: [PATCH 14/19] Update Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp index 1d2f0aeadf..4d2fb8d3b5 100644 --- a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp @@ -493,6 +493,6 @@ bool plAgeDescription::FindLocation(const plLocation& loc) const { return std::any_of(fPages.begin(), fPages.end(), [this, loc](const plAgePage& page) { - return loc == CalcPageLocation(page.GetName()); + return CalcPageLocation(page.GetName()) == loc; }); } From 7687c6ad3a22d679091855fed51c73813be6fba2 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 11:00:49 -0500 Subject: [PATCH 15/19] Update Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp index 4d2fb8d3b5..ca1f0f8bac 100644 --- a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp @@ -491,7 +491,7 @@ void plAgeDescription::CopyFrom(const plAgeDescription& other) bool plAgeDescription::FindLocation(const plLocation& loc) const { - return std::any_of(fPages.begin(), fPages.end(), [this, loc](const plAgePage& page) + return std::any_of(fPages.begin(), fPages.end(), [this, &loc](const plAgePage& page) { return CalcPageLocation(page.GetName()) == loc; }); From 6d8b14388f3c2499dc7f790b200bbdf5559a4b50 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 11:01:05 -0500 Subject: [PATCH 16/19] Update Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp index 11edc9147c..c1db47b788 100644 --- a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp +++ b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp @@ -438,7 +438,7 @@ void plATCAnim::Write(hsStream *stream, hsResMgr *mgr) stream->WriteLEFloat(fEaseOutLength); stream->WriteLE32((uint32_t)fMarkers.size()); - for (auto& fMarker : fMarkers) + for (const auto& fMarker : fMarkers) { stream->WriteSafeString(fMarker.first); stream->WriteLEFloat(fMarker.second); From 03cb48b3855e5924c93826ddfa4ae83872359e5b Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 11:01:32 -0500 Subject: [PATCH 17/19] remove fprefix Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp index c1db47b788..65f594f36f 100644 --- a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp +++ b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp @@ -445,7 +445,7 @@ void plATCAnim::Write(hsStream *stream, hsResMgr *mgr) } stream->WriteLE32((uint32_t)fLoops.size()); - for (auto& fLoop : fLoops) + for (const auto& loop : fLoops) { stream->WriteSafeString(fLoop.first); std::pair& loop = fLoop.second; From e3da6c43b73ab64e21a0dc1c1138da3224973f5f Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 11:01:51 -0500 Subject: [PATCH 18/19] Update Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp Co-authored-by: Adam Johnson --- Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp index 65f594f36f..d32dcc3df9 100644 --- a/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp +++ b/Sources/Plasma/PubUtilLib/plAnimation/plAGAnim.cpp @@ -447,8 +447,8 @@ void plATCAnim::Write(hsStream *stream, hsResMgr *mgr) stream->WriteLE32((uint32_t)fLoops.size()); for (const auto& loop : fLoops) { - stream->WriteSafeString(fLoop.first); - std::pair& loop = fLoop.second; + stream->WriteSafeString(loop.first); + std::pair& loop = loop.second; stream->WriteLEFloat(loop.first); stream->WriteLEFloat(loop.second); } From fc646139e9beef82b60ed0c40a96ad33f7d98210 Mon Sep 17 00:00:00 2001 From: noah the goodra Date: Fri, 3 Nov 2023 11:18:08 -0500 Subject: [PATCH 19/19] add missing brackets --- Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp index d74e2599e4..c9840e71de 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp @@ -306,7 +306,9 @@ void plAvBrainHuman::IInitBoneMap() fAvMod->AddBoneMapping(BoneID, bone); } else - hsStatusMessageF("Couldn't find standard bone %s.", BoneName.data()); + { + hsStatusMessageF("Couldn't find standard bone %s.", BoneName.data()); + } } }