mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-25 20:02:40 +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;
|
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) {
|
void GameData::loadModelFile(const std::string& name) {
|
||||||
auto file = index.openFilePath(name);
|
auto file = index.openFilePath(name);
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
@ -142,6 +142,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
ClumpPtr loadClump(const std::string& name);
|
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.
|
* Loads a DFF and associates its atomics with models.
|
||||||
*/
|
*/
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
std::map<GameRenderer::SpecialModel, std::string> kSpecialModels = {
|
std::map<GameRenderer::SpecialModel, std::pair<std::string,std::string>> kSpecialModels = {
|
||||||
{GameRenderer::ZoneCylinderA, "zonecyla.dff"},
|
{GameRenderer::ZoneCylinderA, std::pair<std::string,std::string>("zonecyla.dff", "particle")},
|
||||||
{GameRenderer::ZoneCylinderB, "zonecylb.dff"},
|
{GameRenderer::ZoneCylinderB, std::pair<std::string,std::string>("zonecylb.dff", "particle")},
|
||||||
{GameRenderer::Arrow, "arrow.dff"}};
|
{GameRenderer::Arrow, std::pair<std::string,std::string>("arrow.dff", "")}};
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr float kPhysicsTimeStep = 1.0f/30.0f;
|
constexpr float kPhysicsTimeStep = 1.0f/30.0f;
|
||||||
@ -61,7 +61,7 @@ RWGame::RWGame(Logger& log, int argc, char* argv[])
|
|||||||
data.load();
|
data.load();
|
||||||
|
|
||||||
for (const auto& p : kSpecialModels) {
|
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);
|
renderer.setSpecialModel(p.first, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user