diff --git a/rwengine/src/engine/GameData.cpp b/rwengine/src/engine/GameData.cpp index 9391a949..fb5987f1 100644 --- a/rwengine/src/engine/GameData.cpp +++ b/rwengine/src/engine/GameData.cpp @@ -409,6 +409,15 @@ ClumpPtr GameData::loadClump(const std::string& name) { return m; } +ClumpPtr GameData::loadClump(const std::string& name, const std::string& textureSlot) { + std::string currentSlot = currenttextureslot; + if (textureSlot.size()>0) + currenttextureslot = textureSlot; + ClumpPtr result = loadClump(name); + currenttextureslot = currentSlot; + return result; +} + void GameData::loadModelFile(const std::string& name) { auto file = index.openFilePath(name); if (!file) { diff --git a/rwengine/src/engine/GameData.hpp b/rwengine/src/engine/GameData.hpp index e18dc961..9968a827 100644 --- a/rwengine/src/engine/GameData.hpp +++ b/rwengine/src/engine/GameData.hpp @@ -142,6 +142,11 @@ public: */ ClumpPtr loadClump(const std::string& name); + /** + * Loads an archived model and returns it directly + */ + ClumpPtr loadClump(const std::string& name, const std::string& textureSlot); + /** * Loads a DFF and associates its atomics with models. */ diff --git a/rwgame/RWGame.cpp b/rwgame/RWGame.cpp index 82289377..8454920e 100644 --- a/rwgame/RWGame.cpp +++ b/rwgame/RWGame.cpp @@ -26,10 +26,10 @@ #include #include -std::map kSpecialModels = { - {GameRenderer::ZoneCylinderA, "zonecyla.dff"}, - {GameRenderer::ZoneCylinderB, "zonecylb.dff"}, - {GameRenderer::Arrow, "arrow.dff"}}; +std::map> kSpecialModels = { + {GameRenderer::ZoneCylinderA, std::pair("zonecyla.dff", "particle")}, + {GameRenderer::ZoneCylinderB, std::pair("zonecylb.dff", "particle")}, + {GameRenderer::Arrow, std::pair("arrow.dff", "")}}; namespace { constexpr float kPhysicsTimeStep = 1.0f/30.0f; @@ -61,7 +61,7 @@ RWGame::RWGame(Logger& log, int argc, char* argv[]) data.load(); for (const auto& p : kSpecialModels) { - auto model = data.loadClump(p.second); + auto model = data.loadClump(p.second.first, p.second.second); renderer.setSpecialModel(p.first, model); }