rodecomp/Source/Contents/TerrainPathSearch.h
ragnarok-clanker f61f0747fa Decompile 2 functions in Source/Contents/MapSkyMgr.cpp, Source/Contents/MapSkyMgr.h, ...
Batch #1449 by Yommy: 2 byte-identical, 0 confirmed by peer review.

- fn_17872 CPathFinder::Height: byte-identical
- fn_17873 CPathFinder::Width: byte-identical

Merged automatically: every function is byte-identical to the original.
Adds to the build: Source/Contents/MapSkyMgr.cpp, Source/Contents/EquipmentResources.cpp, Source/Contents/Pathfinding.cpp, Source/Resource/ImfResource.cpp
2026-10-28 12:59:53 +00:00

56 lines
1.4 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_TERRAINPATHSEARCH_H
#define RAGNAROK_SOURCE_CONTENTS_TERRAINPATHSEARCH_H
#include "Contents/MovementRouteInterpolation.h"
#include <cstddef>
#include <cstdint>
#include <map>
#include <queue>
#include <string>
#include <vector>
class C3dAttr;
struct MovementPathNodeCompare {
bool operator()(const MovementPathNode* left, const MovementPathNode* right) const {
return left->estimatedCost > right->estimatedCost;
}
};
class MovementOpenList : public std::priority_queue<MovementPathNode*, std::vector<MovementPathNode*>, MovementPathNodeCompare> {
public:
std::vector<MovementPathNode*>& Nodes() {
return this->c;
}
};
class CPathFinder {
public:
CPathFinder();
~CPathFinder();
/* 0000 */ C3dAttr* attr;
/* 0004 */ int destinationX;
/* 0008 */ int destinationY;
/* 000C */ int nodeCount;
/* 0010 */ MovementPathNode nodes[150];
/* 1078 */ std::map<std::string, C3dAttr*> attrCache;
/* 1080 */ bool useNodePool;
/* 1084 */ std::vector<MovementPathNode> nodePool;
/* 1090 */ std::map<int, MovementPathNode*> nodeMap;
/* 1098 */ MovementOpenList openList;
void Reset();
int Height() const;
int Width() const;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(CPathFinder, attrCache) == 0x1078);
static_assert(offsetof(CPathFinder, nodePool) == 0x1084);
static_assert(offsetof(CPathFinder, nodeMap) == 0x1090);
static_assert(offsetof(CPathFinder, openList) == 0x1098);
#endif
#endif