From 421728d027865385e7bd4474220c5a32773be2e9 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 6 Apr 2025 15:58:44 +0200 Subject: [PATCH] WIP --- src/Linker/LinkerPaths.cpp | 4 ++-- src/Unlinker/UnlinkerArgs.cpp | 2 +- src/ZoneLoading/Game/IW4/ContentLoaderIW4.h | 14 ++++++++------ src/ZoneLoading/Zone/Stream/IZoneInputStream.h | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Linker/LinkerPaths.cpp b/src/Linker/LinkerPaths.cpp index 7142259e..f72d48cb 100644 --- a/src/Linker/LinkerPaths.cpp +++ b/src/Linker/LinkerPaths.cpp @@ -56,8 +56,8 @@ namespace void CreateFromString(const std::string& templateString) { const auto templateStringLength = templateString.size(); - auto partStart = 0u; - for (auto i = 0u; i < templateStringLength; i++) + auto partStart = 0uz; + for (auto i = 0uz; i < templateStringLength; i++) { if (templateString[i] != '?') continue; diff --git a/src/Unlinker/UnlinkerArgs.cpp b/src/Unlinker/UnlinkerArgs.cpp index 3d492667..5d9964df 100644 --- a/src/Unlinker/UnlinkerArgs.cpp +++ b/src/Unlinker/UnlinkerArgs.cpp @@ -245,7 +245,7 @@ void UnlinkerArgs::AddSpecifiedAssetType(std::string value) void UnlinkerArgs::ParseCommaSeparatedAssetTypeString(const std::string& input) { - auto currentPos = 0u; + auto currentPos = 0uz; size_t endPos; std::string lowerInput(input); diff --git a/src/ZoneLoading/Game/IW4/ContentLoaderIW4.h b/src/ZoneLoading/Game/IW4/ContentLoaderIW4.h index 4ba9f1b8..8a3fd944 100644 --- a/src/ZoneLoading/Game/IW4/ContentLoaderIW4.h +++ b/src/ZoneLoading/Game/IW4/ContentLoaderIW4.h @@ -1,4 +1,5 @@ #pragma once + #include "Game/IW4/IW4.h" #include "Loading/ContentLoaderBase.h" #include "Loading/IContentLoadingEntryPoint.h" @@ -7,17 +8,18 @@ namespace IW4 { class ContentLoader final : public ContentLoaderBase, public IContentLoadingEntryPoint { - XAsset* varXAsset; - ScriptStringList* varScriptStringList; + public: + ContentLoader(); + void Load(Zone* zone, IZoneInputStream* stream) override; + + private: void LoadScriptStringList(bool atStreamStart); void LoadXAsset(bool atStreamStart) const; void LoadXAssetArray(bool atStreamStart, size_t count); - public: - ContentLoader(); - - void Load(Zone* zone, IZoneInputStream* stream) override; + XAsset* varXAsset; + ScriptStringList* varScriptStringList; }; } // namespace IW4 diff --git a/src/ZoneLoading/Zone/Stream/IZoneInputStream.h b/src/ZoneLoading/Zone/Stream/IZoneInputStream.h index b1158e17..c363b759 100644 --- a/src/ZoneLoading/Zone/Stream/IZoneInputStream.h +++ b/src/ZoneLoading/Zone/Stream/IZoneInputStream.h @@ -25,7 +25,7 @@ public: LoadDataInBlock(const_cast(reinterpret_cast(dst)), sizeof(T)); } - template void Load(T* dst, const uint32_t count) + template void Load(T* dst, const size_t count) { LoadDataInBlock(const_cast(reinterpret_cast(dst)), count * sizeof(T)); }