rodecomp/Source/Contents/World/WorldEnvironment.h
ragnarok-clanker e168b4e4a6 Restore translation-unit ownership and publish verified source corrections
Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas.

449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
2026-10-25 15:42:21 +00:00

38 lines
1.2 KiB
C

#ifndef RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDENVIRONMENT_H
#define RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDENVIRONMENT_H
#include "Render/Renderer.h"
#include "Resource/World/WorldResource.h"
struct WorldEnvironmentLighting {
float direction[3];
float diffuse[3];
float ambient[3];
};
// INLINED
inline void PublishWorldEnvironment(
const C3dWorldRes& resource, int* modeBounds, WorldSpatialTree*& serialized, WorldEnvironmentLighting& lighting, unsigned char& rendererFlag,
CRenderer& renderer
) {
serialized = resource.spatial;
modeBounds[0] = resource.bounds[2];
modeBounds[1] = resource.bounds[3];
modeBounds[2] = resource.bounds[0];
modeBounds[3] = resource.bounds[1];
lighting.direction[0] = resource.lightDirection[0];
lighting.direction[1] = resource.lightDirection[1];
lighting.direction[2] = resource.lightDirection[2];
lighting.diffuse[0] = resource.diffuse[0];
lighting.diffuse[1] = resource.diffuse[1];
lighting.diffuse[2] = resource.diffuse[2];
lighting.ambient[0] = resource.ambient[0];
lighting.ambient[1] = resource.ambient[1];
lighting.ambient[2] = resource.ambient[2];
rendererFlag = resource.flag;
renderer.SetLighting(lighting.direction, lighting.diffuse, lighting.ambient);
}
#endif