Decompile fn_17930 (CView::Render)

Batch #15637 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_17930 CView::Render: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, eAthena
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-10 10:29:18 +00:00
commit 7db24787cb

View file

@ -262,19 +262,20 @@ void CView::Render() {
g_effectMgr->Render();
CRenderer* const renderer = g_renderer;
const float x = this->camera.target[0] - this->frame.eye[0];
const float y = this->camera.target[1] - this->frame.eye[1];
const float z = this->camera.target[2] - this->frame.eye[2];
*reinterpret_cast<float*>(&g_renderer->viewDirectionX) = x;
*reinterpret_cast<float*>(&g_renderer->viewDirectionY) = y;
*reinterpret_cast<float*>(&g_renderer->viewDirectionZ) = z;
*reinterpret_cast<float*>(&renderer->viewDirectionX) = x;
*reinterpret_cast<float*>(&renderer->viewDirectionY) = y;
*reinterpret_cast<float*>(&renderer->viewDirectionZ) = z;
const float inverseLength = 1.0f / SquareRoot(x * x + y * y + z * z);
*reinterpret_cast<float*>(&g_renderer->viewDirectionX) *= inverseLength;
*reinterpret_cast<float*>(&g_renderer->viewDirectionY) *= inverseLength;
*reinterpret_cast<float*>(&g_renderer->viewDirectionZ) *= inverseLength;
*reinterpret_cast<float*>(&renderer->viewDirectionX) *= inverseLength;
*reinterpret_cast<float*>(&renderer->viewDirectionY) *= inverseLength;
*reinterpret_cast<float*>(&renderer->viewDirectionZ) *= inverseLength;
this->spatial.inside.clear();
this->spatial.clipped.clear();
this->spatial.inside.erase(this->spatial.inside.begin(), this->spatial.inside.end());
this->spatial.clipped.erase(this->spatial.clipped.begin(), this->spatial.clipped.end());
this->scene->ground->RenderLod(reinterpret_cast<int>(matrix));
}