mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-09 10:33:51 +00:00
fix(terrain): main game also propagates MODF scale to WMO instances
Mirrors the editor's WMO scale fix. WMOReady gains a scale field that is computed from the loaded MODF placement.scale (u16 / 1024) and forwarded to wmoRenderer->createInstance(). Without this the main game ignored MODF scale even on WotLK ADTs that use it.
This commit is contained in:
parent
cbf1d4638f
commit
1d05bb0f13
2 changed files with 5 additions and 1 deletions
|
|
@ -99,6 +99,7 @@ struct PendingTile {
|
||||||
pipeline::WMOModel model;
|
pipeline::WMOModel model;
|
||||||
glm::vec3 position;
|
glm::vec3 position;
|
||||||
glm::vec3 rotation;
|
glm::vec3 rotation;
|
||||||
|
float scale = 1.0f;
|
||||||
};
|
};
|
||||||
std::vector<WMOReady> wmoModels;
|
std::vector<WMOReady> wmoModels;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -860,6 +860,8 @@ std::shared_ptr<PendingTile> TerrainManager::prepareTile(int x, int y) {
|
||||||
ready.model = std::move(wmoModel);
|
ready.model = std::move(wmoModel);
|
||||||
ready.position = pos;
|
ready.position = pos;
|
||||||
ready.rotation = rot;
|
ready.rotation = rot;
|
||||||
|
ready.scale = placement.scale > 0
|
||||||
|
? static_cast<float>(placement.scale) / 1024.0f : 1.0f;
|
||||||
pending->wmoModels.push_back(std::move(ready));
|
pending->wmoModels.push_back(std::move(ready));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1103,7 +1105,8 @@ bool TerrainManager::advanceFinalization(FinalizingTile& ft) {
|
||||||
}
|
}
|
||||||
// Create the instance on first visit (liquidGroupIndex == 0)
|
// Create the instance on first visit (liquidGroupIndex == 0)
|
||||||
if (ft.wmoLiquidGroupIndex == 0) {
|
if (ft.wmoLiquidGroupIndex == 0) {
|
||||||
uint32_t wmoInstId = wmoRenderer->createInstance(wmoReady.modelId, wmoReady.position, wmoReady.rotation);
|
uint32_t wmoInstId = wmoRenderer->createInstance(
|
||||||
|
wmoReady.modelId, wmoReady.position, wmoReady.rotation, wmoReady.scale);
|
||||||
if (!wmoInstId) {
|
if (!wmoInstId) {
|
||||||
ft.wmoInstanceIndex++;
|
ft.wmoInstanceIndex++;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue