mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-25 11:52:40 +01:00
Merge pull request #474 from NFSMONSTR/fix_loading_zonecylinder_texture
Fixed loading ZoneCylinder texture
This commit is contained in:
commit
c226432e88
@ -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.empty())
|
||||
currenttextureslot = textureSlot;
|
||||
ClumpPtr result = loadClump(name);
|
||||
currenttextureslot = currentSlot;
|
||||
return result;
|
||||
}
|
||||
|
||||
void GameData::loadModelFile(const std::string& name) {
|
||||
auto file = index.openFilePath(name);
|
||||
if (!file) {
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -26,10 +26,10 @@
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
std::map<GameRenderer::SpecialModel, std::string> kSpecialModels = {
|
||||
{GameRenderer::ZoneCylinderA, "zonecyla.dff"},
|
||||
{GameRenderer::ZoneCylinderB, "zonecylb.dff"},
|
||||
{GameRenderer::Arrow, "arrow.dff"}};
|
||||
const std::map<GameRenderer::SpecialModel, std::pair<std::string,std::string>> kSpecialModels = {
|
||||
{GameRenderer::ZoneCylinderA, std::pair<std::string,std::string>("zonecyla.dff", "particle")},
|
||||
{GameRenderer::ZoneCylinderB, std::pair<std::string,std::string>("zonecylb.dff", "particle")},
|
||||
{GameRenderer::Arrow, std::pair<std::string,std::string>("arrow.dff", "")}};
|
||||
|
||||
namespace {
|
||||
constexpr float kMaxPhysicsSubSteps = 2;
|
||||
@ -60,7 +60,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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user