rodecomp/Source/Contents/Ground/TerrainHeight.h
ragnarok-clanker 4cf3413524 Decompile 4 functions in Source/Client/Mode/CGameMode.h, Source/Contents/Ground/TerrainCoordinates.cpp, ...
Batch #1556 by ragnarok-clanker: 2 byte-identical, 2 confirmed by peer review.

- fn_19489 CNavi_Link::GetLinkedInfo: byte-identical
- fn_19481 CNaviInfo::IsVisited: byte-identical
- fn_45449 CNaviData::Clear: logic confirmed by peer review
- fn_19371 CNaviData::~CNaviData: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
Adds to the build: Source/Contents/NavigationDestinations.cpp, Source/Contents/NavigationGraph.cpp, Source/Contents/WorldNavigation.cpp
2026-10-28 18:48:31 +00:00

36 lines
1.1 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_GROUND_TERRAINHEIGHT_H
#define RAGNAROK_SOURCE_CONTENTS_GROUND_TERRAINHEIGHT_H
#include <cstddef>
#include <cstdint>
struct TerrainHeightCell {
/* 0000 */ float heights[4];
/* 0010 */ std::uint32_t type;
};
struct TerrainHeight {
const int& width;
const int& height;
const int& cellSize;
const TerrainHeightCell* cells;
float Height(float x, float z) const;
float PlaneHeight(float x, float z) const;
const TerrainHeightCell* CellAt(int column, int row) const;
bool Walkable(int column, int row) const;
void CellOrigin(int column, int row, float& x, float& z) const;
void CellCenter(int column, int row, float& x, float& z) const;
void WorldSubcell(float x, float z, int& column, int& row, int& subColumn, int& subRow) const;
void SpatialCell(float x, float z, int& column, int& row) const;
void HeightBounds(const int* rectangle, float& minimum, float& maximum) const;
float RayDistance(const float* ray, int column, int row) const;
};
static_assert(sizeof(TerrainHeightCell) == 20);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(TerrainHeightCell, type) == 0x10);
#endif
#endif