diff --git a/premake5.lua b/premake5.lua index 3ffa7dcc3..651de9118 100644 --- a/premake5.lua +++ b/premake5.lua @@ -126,6 +126,7 @@ include "src/ZoneLoading.lua" include "src/ZoneWriting.lua" include "src/ZoneCommon.lua" include "src/ObjCommon.lua" +include "src/ObjImage.lua" include "src/ObjLoading.lua" include "src/ObjWriting.lua" include "tools/scripts/raw.lua" @@ -142,6 +143,7 @@ group "Components" ZoneLoading:project() ZoneWriting:project() ObjCommon:project() + ObjImage:project() ObjLoading:project() ObjWriting:project() group "" diff --git a/src/Common/Game/IW3/IW3.h b/src/Common/Game/IW3/IW3.h index 889b87c4e..a489583c6 100644 --- a/src/Common/Game/IW3/IW3.h +++ b/src/Common/Game/IW3/IW3.h @@ -4,7 +4,6 @@ // #include #include "Game/IAsset.h" -#include "Image/Texture.h" #include "IW3_Assets.h" diff --git a/src/Common/Game/IW4/CommonIW4.cpp b/src/Common/Game/IW4/CommonIW4.cpp index de6cc73df..6b3b6f975 100644 --- a/src/Common/Game/IW4/CommonIW4.cpp +++ b/src/Common/Game/IW4/CommonIW4.cpp @@ -2,6 +2,8 @@ #include "Utils/Pack.h" +#include + using namespace IW4; int Common::StringTable_HashString(const char* str) diff --git a/src/Common/Game/IW4/IW4.h b/src/Common/Game/IW4/IW4.h index 25beb1687..4335bdb12 100644 --- a/src/Common/Game/IW4/IW4.h +++ b/src/Common/Game/IW4/IW4.h @@ -4,7 +4,6 @@ // #include #include "Game/IAsset.h" -#include "Image/Texture.h" #include "IW4_Assets.h" diff --git a/src/Common/Game/IW5/CommonIW5.cpp b/src/Common/Game/IW5/CommonIW5.cpp index 79379dd41..55b820fc5 100644 --- a/src/Common/Game/IW5/CommonIW5.cpp +++ b/src/Common/Game/IW5/CommonIW5.cpp @@ -2,6 +2,8 @@ #include "Utils/Pack.h" +#include + using namespace IW5; int Common::StringTable_HashString(const char* str) diff --git a/src/Common/Game/IW5/IW5.h b/src/Common/Game/IW5/IW5.h index df2110cc0..ba6b314d6 100644 --- a/src/Common/Game/IW5/IW5.h +++ b/src/Common/Game/IW5/IW5.h @@ -4,7 +4,6 @@ // #include #include "Game/IAsset.h" -#include "Image/Texture.h" #include "IW5_Assets.h" diff --git a/src/Common/Game/T5/T5.h b/src/Common/Game/T5/T5.h index efd71592c..c493782d8 100644 --- a/src/Common/Game/T5/T5.h +++ b/src/Common/Game/T5/T5.h @@ -4,7 +4,6 @@ // #include #include "Game/IAsset.h" -#include "Image/Texture.h" #include "T5_Assets.h" diff --git a/src/Common/Game/T6/T6.h b/src/Common/Game/T6/T6.h index 6a0e560e0..0b9bc5c69 100644 --- a/src/Common/Game/T6/T6.h +++ b/src/Common/Game/T6/T6.h @@ -4,7 +4,6 @@ // #include #include "Game/IAsset.h" -#include "Image/Texture.h" #include "T6_Assets.h" diff --git a/src/ImageConverter.lua b/src/ImageConverter.lua index e4552cd09..79a7f3cf4 100644 --- a/src/ImageConverter.lua +++ b/src/ImageConverter.lua @@ -38,13 +38,11 @@ function ImageConverter:project() self:include(includes) Utils:include(includes) - ObjLoading:include(includes) - ObjWriting:include(includes) + ObjImage:include(includes) Raw:use() links:linkto(Utils) - links:linkto(ObjLoading) - links:linkto(ObjWriting) + links:linkto(ObjImage) links:linkall() end diff --git a/src/ImageConverter/ImageConverterArgs.cpp b/src/ImageConverter/ImageConverterArgs.cpp index f63b0c224..8b51a46fd 100644 --- a/src/ImageConverter/ImageConverterArgs.cpp +++ b/src/ImageConverter/ImageConverterArgs.cpp @@ -1,8 +1,6 @@ #include "ImageConverterArgs.h" #include "GitVersion.h" -#include "ObjLoading.h" -#include "ObjWriting.h" #include "Utils/Arguments/UsageInformation.h" #include @@ -109,8 +107,6 @@ void ImageConverterArgs::PrintVersion() void ImageConverterArgs::SetVerbose(const bool isVerbose) { m_verbose = isVerbose; - ObjLoading::Configuration.Verbose = isVerbose; - ObjWriting::Configuration.Verbose = isVerbose; } bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue) diff --git a/src/ObjImage.lua b/src/ObjImage.lua new file mode 100644 index 000000000..bbb726210 --- /dev/null +++ b/src/ObjImage.lua @@ -0,0 +1,47 @@ +ObjImage = {} + +function ObjImage:include(includes) + if includes:handle(self:name()) then + includedirs { + path.join(ProjectFolder(), "ObjImage") + } + end +end + +function ObjImage:link(links) + links:add(self:name()) + links:linkto(Utils) +end + +function ObjImage:use() + +end + +function ObjImage:name() + return "ObjImage" +end + +function ObjImage:project() + local folder = ProjectFolder() + local includes = Includes:create() + + project(self:name()) + targetdir(TargetDirectoryLib) + location "%{wks.location}/src/%{prj.name}" + kind "StaticLib" + language "C++" + + files { + path.join(folder, "ObjImage/**.h"), + path.join(folder, "ObjImage/**.cpp") + } + + vpaths { + ["*"] = { + path.join(folder, "ObjImage") + } + } + + self:include(includes) + Utils:include(includes) +end diff --git a/src/Common/Image/D3DFormat.h b/src/ObjImage/Image/D3DFormat.h similarity index 100% rename from src/Common/Image/D3DFormat.h rename to src/ObjImage/Image/D3DFormat.h diff --git a/src/ObjLoading/Image/DdsLoader.cpp b/src/ObjImage/Image/DdsLoader.cpp similarity index 100% rename from src/ObjLoading/Image/DdsLoader.cpp rename to src/ObjImage/Image/DdsLoader.cpp diff --git a/src/ObjLoading/Image/DdsLoader.h b/src/ObjImage/Image/DdsLoader.h similarity index 100% rename from src/ObjLoading/Image/DdsLoader.h rename to src/ObjImage/Image/DdsLoader.h diff --git a/src/Common/Image/DdsTypes.h b/src/ObjImage/Image/DdsTypes.h similarity index 100% rename from src/Common/Image/DdsTypes.h rename to src/ObjImage/Image/DdsTypes.h diff --git a/src/ObjWriting/Image/DdsWriter.cpp b/src/ObjImage/Image/DdsWriter.cpp similarity index 100% rename from src/ObjWriting/Image/DdsWriter.cpp rename to src/ObjImage/Image/DdsWriter.cpp diff --git a/src/ObjWriting/Image/DdsWriter.h b/src/ObjImage/Image/DdsWriter.h similarity index 100% rename from src/ObjWriting/Image/DdsWriter.h rename to src/ObjImage/Image/DdsWriter.h diff --git a/src/ObjLoading/Image/Dx12TextureLoader.cpp b/src/ObjImage/Image/Dx12TextureLoader.cpp similarity index 100% rename from src/ObjLoading/Image/Dx12TextureLoader.cpp rename to src/ObjImage/Image/Dx12TextureLoader.cpp diff --git a/src/ObjLoading/Image/Dx12TextureLoader.h b/src/ObjImage/Image/Dx12TextureLoader.h similarity index 100% rename from src/ObjLoading/Image/Dx12TextureLoader.h rename to src/ObjImage/Image/Dx12TextureLoader.h diff --git a/src/ObjLoading/Image/Dx9TextureLoader.cpp b/src/ObjImage/Image/Dx9TextureLoader.cpp similarity index 100% rename from src/ObjLoading/Image/Dx9TextureLoader.cpp rename to src/ObjImage/Image/Dx9TextureLoader.cpp diff --git a/src/ObjLoading/Image/Dx9TextureLoader.h b/src/ObjImage/Image/Dx9TextureLoader.h similarity index 100% rename from src/ObjLoading/Image/Dx9TextureLoader.h rename to src/ObjImage/Image/Dx9TextureLoader.h diff --git a/src/Common/Image/DxgiFormat.h b/src/ObjImage/Image/DxgiFormat.h similarity index 100% rename from src/Common/Image/DxgiFormat.h rename to src/ObjImage/Image/DxgiFormat.h diff --git a/src/ObjWriting/Image/IImageWriter.h b/src/ObjImage/Image/IImageWriter.h similarity index 100% rename from src/ObjWriting/Image/IImageWriter.h rename to src/ObjImage/Image/IImageWriter.h diff --git a/src/Common/Image/ImageFormat.cpp b/src/ObjImage/Image/ImageFormat.cpp similarity index 100% rename from src/Common/Image/ImageFormat.cpp rename to src/ObjImage/Image/ImageFormat.cpp diff --git a/src/Common/Image/ImageFormat.h b/src/ObjImage/Image/ImageFormat.h similarity index 100% rename from src/Common/Image/ImageFormat.h rename to src/ObjImage/Image/ImageFormat.h diff --git a/src/ObjLoading/Image/IwiLoader.cpp b/src/ObjImage/Image/IwiLoader.cpp similarity index 100% rename from src/ObjLoading/Image/IwiLoader.cpp rename to src/ObjImage/Image/IwiLoader.cpp diff --git a/src/ObjLoading/Image/IwiLoader.h b/src/ObjImage/Image/IwiLoader.h similarity index 100% rename from src/ObjLoading/Image/IwiLoader.h rename to src/ObjImage/Image/IwiLoader.h diff --git a/src/Common/Image/IwiTypes.h b/src/ObjImage/Image/IwiTypes.h similarity index 100% rename from src/Common/Image/IwiTypes.h rename to src/ObjImage/Image/IwiTypes.h diff --git a/src/ObjWriting/Image/IwiWriter13.cpp b/src/ObjImage/Image/IwiWriter13.cpp similarity index 100% rename from src/ObjWriting/Image/IwiWriter13.cpp rename to src/ObjImage/Image/IwiWriter13.cpp diff --git a/src/ObjWriting/Image/IwiWriter13.h b/src/ObjImage/Image/IwiWriter13.h similarity index 100% rename from src/ObjWriting/Image/IwiWriter13.h rename to src/ObjImage/Image/IwiWriter13.h diff --git a/src/ObjWriting/Image/IwiWriter27.cpp b/src/ObjImage/Image/IwiWriter27.cpp similarity index 100% rename from src/ObjWriting/Image/IwiWriter27.cpp rename to src/ObjImage/Image/IwiWriter27.cpp diff --git a/src/ObjWriting/Image/IwiWriter27.h b/src/ObjImage/Image/IwiWriter27.h similarity index 100% rename from src/ObjWriting/Image/IwiWriter27.h rename to src/ObjImage/Image/IwiWriter27.h diff --git a/src/ObjWriting/Image/IwiWriter6.cpp b/src/ObjImage/Image/IwiWriter6.cpp similarity index 100% rename from src/ObjWriting/Image/IwiWriter6.cpp rename to src/ObjImage/Image/IwiWriter6.cpp diff --git a/src/ObjWriting/Image/IwiWriter6.h b/src/ObjImage/Image/IwiWriter6.h similarity index 100% rename from src/ObjWriting/Image/IwiWriter6.h rename to src/ObjImage/Image/IwiWriter6.h diff --git a/src/ObjWriting/Image/IwiWriter8.cpp b/src/ObjImage/Image/IwiWriter8.cpp similarity index 100% rename from src/ObjWriting/Image/IwiWriter8.cpp rename to src/ObjImage/Image/IwiWriter8.cpp diff --git a/src/ObjWriting/Image/IwiWriter8.h b/src/ObjImage/Image/IwiWriter8.h similarity index 100% rename from src/ObjWriting/Image/IwiWriter8.h rename to src/ObjImage/Image/IwiWriter8.h diff --git a/src/Common/Image/Texture.cpp b/src/ObjImage/Image/Texture.cpp similarity index 100% rename from src/Common/Image/Texture.cpp rename to src/ObjImage/Image/Texture.cpp diff --git a/src/Common/Image/Texture.h b/src/ObjImage/Image/Texture.h similarity index 100% rename from src/Common/Image/Texture.h rename to src/ObjImage/Image/Texture.h diff --git a/src/Common/Image/TextureConverter.cpp b/src/ObjImage/Image/TextureConverter.cpp similarity index 100% rename from src/Common/Image/TextureConverter.cpp rename to src/ObjImage/Image/TextureConverter.cpp diff --git a/src/Common/Image/TextureConverter.h b/src/ObjImage/Image/TextureConverter.h similarity index 100% rename from src/Common/Image/TextureConverter.h rename to src/ObjImage/Image/TextureConverter.h diff --git a/src/ObjLoading.lua b/src/ObjLoading.lua index 45f110c2c..712ad146d 100644 --- a/src/ObjLoading.lua +++ b/src/ObjLoading.lua @@ -3,6 +3,7 @@ ObjLoading = {} function ObjLoading:include(includes) if includes:handle(self:name()) then ObjCommon:include(includes) + ObjImage:include(includes) ZoneCommon:include(includes) includedirs { path.join(ProjectFolder(), "ObjLoading") @@ -14,6 +15,7 @@ function ObjLoading:link(links) links:add(self:name()) links:linkto(Utils) links:linkto(ObjCommon) + links:linkto(ObjImage) links:linkto(ZoneCommon) links:linkto(minilzo) links:linkto(minizip) diff --git a/src/ObjLoading/Game/IW4/Leaderboard/JsonLeaderboardDefLoader.h b/src/ObjLoading/Game/IW4/Leaderboard/JsonLeaderboardDefLoader.h index 046461041..22f85756b 100644 --- a/src/ObjLoading/Game/IW4/Leaderboard/JsonLeaderboardDefLoader.h +++ b/src/ObjLoading/Game/IW4/Leaderboard/JsonLeaderboardDefLoader.h @@ -3,6 +3,8 @@ #include "Game/IW4/IW4.h" #include "Utils/MemoryManager.h" +#include + namespace IW4 { bool LoadLeaderboardAsJson(std::istream& stream, LeaderboardDef& leaderboard, MemoryManager* memory); diff --git a/src/ObjLoading/Game/IW5/Leaderboard/JsonLeaderboardDefLoader.h b/src/ObjLoading/Game/IW5/Leaderboard/JsonLeaderboardDefLoader.h index 84186e24c..1dc020b67 100644 --- a/src/ObjLoading/Game/IW5/Leaderboard/JsonLeaderboardDefLoader.h +++ b/src/ObjLoading/Game/IW5/Leaderboard/JsonLeaderboardDefLoader.h @@ -3,6 +3,8 @@ #include "Game/IW5/IW5.h" #include "Utils/MemoryManager.h" +#include + namespace IW5 { bool LoadLeaderboardAsJson(std::istream& stream, LeaderboardDef& leaderboard, MemoryManager* memory); diff --git a/src/ObjWriting.lua b/src/ObjWriting.lua index 39f15dca6..ac3e69e8e 100644 --- a/src/ObjWriting.lua +++ b/src/ObjWriting.lua @@ -3,6 +3,7 @@ ObjWriting = {} function ObjWriting:include(includes) if includes:handle(self:name()) then ObjCommon:include(includes) + ObjImage:include(includes) ObjLoading:include(includes) ZoneCommon:include(includes) includedirs { @@ -15,6 +16,7 @@ function ObjWriting:link(links) links:add(self:name()) links:linkto(Utils) links:linkto(ObjCommon) + links:linkto(ObjImage) links:linkto(ObjLoading) links:linkto(ZoneCommon) links:linkto(minilzo) diff --git a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperTechniqueSet.cpp b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperTechniqueSet.cpp index 610b18cbf..101d323d2 100644 --- a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperTechniqueSet.cpp +++ b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperTechniqueSet.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include diff --git a/test/ObjCommonTests.lua b/test/ObjCommonTests.lua index 18dc9201c..a1360e05d 100644 --- a/test/ObjCommonTests.lua +++ b/test/ObjCommonTests.lua @@ -45,9 +45,11 @@ function ObjCommonTests:project() self:include(includes) ObjCommon:include(includes) + ObjImage:include(includes) catch2:include(includes) links:linkto(ObjCommon) + links:linkto(ObjImage) links:linkto(catch2) links:linkall() end