diff --git a/src/ObjCommon/Shader/ShaderCommon.cpp b/src/ObjCommon/Shader/ShaderCommon.cpp index 7dc6c7bb..1703d376 100644 --- a/src/ObjCommon/Shader/ShaderCommon.cpp +++ b/src/ObjCommon/Shader/ShaderCommon.cpp @@ -6,11 +6,11 @@ namespace shader { std::string GetFileNameForPixelShaderAssetName(const std::string& assetName) { - return std::format("shader_bin/ps_{}.cso", assetName); + return std::format("techniquesets/shader_bin/ps_{}.cso", assetName); } std::string GetFileNameForVertexShaderAssetName(const std::string& assetName) { - return std::format("shader_bin/vs_{}.cso", assetName); + return std::format("techniquesets/shader_bin/vs_{}.cso", assetName); } } // namespace shader diff --git a/src/ObjLoading/Game/T6/CustomMap/CustomMapLinker.h b/src/ObjLoading/Game/T6/CustomMap/CustomMapLinker.h index 0ba12b45..708b53e7 100644 --- a/src/ObjLoading/Game/T6/CustomMap/CustomMapLinker.h +++ b/src/ObjLoading/Game/T6/CustomMap/CustomMapLinker.h @@ -138,6 +138,14 @@ private: Material* loadImageIntoMaterial(std::string& imageName) { + std::string imagePath = std::format("images/{}.iwi", imageName); + auto imageFile = m_search_path.Open(imagePath); + if (!imageFile.IsOpen()) + { + printf("WARN: failed to find image %s.\n", imageName.c_str()); + return NULL; + } + Material* material = new Material; material->info.name = m_memory.Dup(imageName.c_str()); @@ -1808,7 +1816,7 @@ private: std::string entityString; - const auto entFile = m_search_path.Open("entities.json"); + const auto entFile = m_search_path.Open("custom_map/entities.json"); if (!entFile.IsOpen()) { printf("ERROR: can't find entity json!\n"); @@ -1817,7 +1825,7 @@ private: json entJs = json::parse(*entFile.m_stream); parseMapEntsJSON(entJs["entities"], entityString); - const auto spawnFile = m_search_path.Open("spawns.json"); + const auto spawnFile = m_search_path.Open("custom_map/spawns.json"); json spawnJs; if (!spawnFile.IsOpen()) { diff --git a/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp b/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp index d01fa70d..e093907d 100644 --- a/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp +++ b/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp @@ -1,6 +1,7 @@ #include "LoaderTechniqueSetT6.h" #include "Game/T6/T6.h" +#include "Shader/ShaderCommon.h" #include #include @@ -129,7 +130,7 @@ namespace currPass->pixelShader->name = _strdup(pixelName.c_str()); currPass->pixelShader->prog.ps = NULL; - const auto psFileName = std::format("techniquesets/shader_bin/ps_{}", pixelName); + const auto psFileName = shader::GetFileNameForPixelShaderAssetName(pixelName); const auto psFile = m_search_path.Open(psFileName); if (!psFile.IsOpen()) { @@ -153,7 +154,7 @@ namespace currPass->vertexShader->name = _strdup(vertexName.c_str()); currPass->vertexShader->prog.vs = NULL; - const auto vsFileName = std::format("techniquesets/shader_bin/vs_{}", vertexName); + const auto vsFileName = shader::GetFileNameForVertexShaderAssetName(vertexName); const auto vsFile = m_search_path.Open(vsFileName); if (!vsFile.IsOpen()) { diff --git a/src/ObjWriting/Game/T6/ObjWriterT6.cpp b/src/ObjWriting/Game/T6/ObjWriterT6.cpp index e98f8c26..dafc7eb3 100644 --- a/src/ObjWriting/Game/T6/ObjWriterT6.cpp +++ b/src/ObjWriting/Game/T6/ObjWriterT6.cpp @@ -1,6 +1,5 @@ #include "ObjWriterT6.h" -#include "AssetDumpers/AssetDumperTechniqueSet.h" #include "FontIcon/FontIconDumperT6.h" #include "Game/T6/Material/MaterialJsonDumperT6.h" #include "Game/T6/Techset/TechsetDumperT6.h" @@ -18,6 +17,7 @@ #include "Sound/SndBankDumperT6.h" #include "Sound/SndDriverGlobalsDumperT6.h" #include "StringTable/StringTableDumperT6.h" +#include "Techset/AssetDumperTechniqueSet.h" #include "Tracer/TracerDumperT6.h" #include "Vehicle/VehicleDumperT6.h" #include "Weapon/AttachmentDumperT6.h" diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTechniqueSet.cpp b/src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.cpp similarity index 100% rename from src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTechniqueSet.cpp rename to src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.cpp diff --git a/src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTechniqueSet.h b/src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.h similarity index 100% rename from src/ObjWriting/Game/T6/AssetDumpers/AssetDumperTechniqueSet.h rename to src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.h