mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 02:12:45 +01:00
Fixed loading ZoneCylinder texture
This commit is contained in:
parent
b77ca47fd4
commit
b019d187d6
@ -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) {
|
||||
|
@ -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"}};
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user