rodecomp/Source/Contents/World/WorldModelView.h
ragnarok-clanker a6f3799235 Decompile 5 functions in Source/Contents/World/WorldModelView.cpp, Source/Contents/World/WorldModelView.h, ...
Batch #12484 by cremane: 0 byte-identical, 5 confirmed by peer review.

- fn_17921 WorldViewSpatial::ClassifyAxisAligned: logic confirmed by peer review
- fn_17922 WorldViewSpatial::ClassifyOriented: logic confirmed by peer review
- fn_17930 CView::Render: logic confirmed by peer review
- fn_17923 WorldViewSpatial::CollectNode: logic confirmed by peer review
- fn_17919 WorldViewSpatial::Collect: logic confirmed by peer review (already on main)

Peer-reviewed-by: Yommy, dori, codeplay
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-05 15:48:16 +00:00

55 lines
1.7 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDMODELVIEW_H
#define RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDMODELVIEW_H
#include <cstddef>
#include <list>
struct OrientedBounds;
struct WorldSpatialTree;
class GroundGeometry;
struct ModelViewPlanes {
/* 0010 */ float planes[6][4];
/* 0070 */ float normals[6][3];
};
struct WorldViewSpatial {
WorldViewSpatial();
~WorldViewSpatial();
/* 0000 */ std::list<WorldSpatialTree*> inside;
/* 0008 */ std::list<WorldSpatialTree*> clipped;
/* 0010 */ ModelViewPlanes planes;
int ClassifyAxisAligned(const WorldSpatialTree& bounds) const;
int ClassifyOriented(const OrientedBounds& bounds) const;
void Collect(float horizontal, float vertical, const float* matrix, WorldSpatialTree& root);
void CollectNode(WorldSpatialTree& node, int depth, bool fullyInside);
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(ModelViewPlanes) == 0x00A8);
static_assert(offsetof(ModelViewPlanes, normals) == 0x0060);
static_assert(offsetof(WorldViewSpatial, clipped) == 0x0008);
static_assert(offsetof(WorldViewSpatial, planes) == 0x0010);
#endif
extern int g_worldViewDrawn;
extern int g_visibleMinX;
extern int g_visibleMinY;
extern int g_visibleMaxX;
extern int g_visibleMaxY;
int ClassifyModelView(const OrientedBounds& bounds, const ModelViewPlanes& planes);
void DrawWorldModelLeaves(
std::list<WorldSpatialTree*>& clipped, std::list<WorldSpatialTree*>& inside, const ModelViewPlanes& planes, const float* matrix, unsigned frame, int updates,
GroundGeometry& ground, int* visibleRectangle
);
extern int g_groundOverlayA;
extern int g_groundOverlayB;
extern int g_groundOverlaySkip;
extern int g_groundOverlayC;
#endif