1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 15:02:34 +02:00

Fixed loading ZoneCylinder texture

This commit is contained in:
NFS_MONSTR 2018-05-19 17:13:47 +03:00
parent b77ca47fd4
commit b019d187d6
3 changed files with 19 additions and 5 deletions

View File

@ -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) {

View 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.
*/

View File

@ -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"}};
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 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);
}