Files
wowdecomp/WoW/Source/WorldClient/MapLoad.cpp
T
SatyandClaude Opus 5.5 f6d07ea346 World port: liquids, map load chain, terrain rendering in MapViewer
Liquid system ported from 12340 (LiquidSystem module, chunk/WMO liquid, wave
manager, geometry factories); CMap load chain (Load, LoadWdt, low-detail WDL,
lights, CreateMapObjDef, PurgeMaps); CMapChunk create/batch/vertex/index code;
CMapRenderChunk; frustum stack and scene cull helpers. MapViewer renders
terrain through a viewer-only shortcut (ViewerWorld.cpp). Engine fix: int
render-state setters write the full pointer-sized slot (x64 texture crash).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-28 08:07:38 +02:00

26 lines
1000 B
C++

#include "MapLoad.h"
#include "Engine/Source/Model2/M2Model.h"
#include "WoW/Source/WorldClient/DayNight__DNInfo.h"
// VERIFY: 1ce54c55 manual
// OFFSET: 0x00780CD0
void CMapStaticEntity::ModelLightingCallback(CM2Model* model, CM2Lighting* lighting, void* userArg) {
CMapStaticEntity* entity = reinterpret_cast<CMapStaticEntity*>(userArg);
lighting->m_flags |= 0x10;
auto dayNight = DayNight::GetInfo();
if (entity) {
lighting->SetFog(C3Vector(dayNight->m_fog.m_color), dayNight->m_fog.m_start, dayNight->m_fog.m_end, dayNight->m_fog.m_density);
entity->SelectLights(lighting);
entity->SelectUnderwater(lighting);
if ((entity->m_flags & MAPOBJ_FLAG_INTERIOR) != 0) {
lighting->m_flags |= 8;
return;
}
} else {
lighting->AddAmbient(C3Vector(dayNight->m_light1.m_ambient));
lighting->AddDiffuse(C3Vector(dayNight->m_light1.m_diffuse), dayNight->m_light1.m_dir);
}
lighting->m_flags &= ~8u;
}