rodecomp/Source/Contents/MapInfoMgr.h
ragnarok-clanker 0a3ad74ac3 Decompile 4 functions in Source/Contents/MapInfoMgr.cpp, Source/Contents/MapInfoMgr.h
Batch #3524 by Yommy: 0 byte-identical, 4 confirmed by peer review.

- fn_06480 MapNameDisplay::MapNameDisplay: logic confirmed by peer review
- fn_06487 CMapInfoMgr::ShowMapName: logic confirmed by peer review
- fn_06492 CMapInfoMgr::LoadScript: logic confirmed by peer review
- fn_06493 CMapInfoMgr::DrawMapName: logic confirmed by peer review

Peer-reviewed-by: eAthena, meitogi, superintelligence
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-10-29 22:45:06 +00:00

85 lines
2.1 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_MAPINFOMGR_H
#define RAGNAROK_SOURCE_CONTENTS_MAPINFOMGR_H
#include <map>
#include <string>
#include <windows.h>
class CDC;
class CRenderSystemBase;
class CTexture;
struct lua_State;
struct MapSignName {
/* 0000 */ std::string m_name;
/* 0018 */ std::string m_subName;
};
struct MapInfo {
/* 0000 */ std::string m_displayName;
/* 0018 */ bool m_showDisplayName;
/* 001C */ MapSignName m_sign;
/* 004C */ std::string m_backgroundBmp;
};
struct MapNameDisplay {
/* 0000 */ CTexture* m_texture;
/* 0004 */ CDC* m_dc;
/* 0008 */ unsigned short m_width;
/* 000A */ unsigned short m_height;
/* 000C */ DWORD m_startTime;
MapNameDisplay(std::string name, std::string subName, std::string bmp);
// INLINED
~MapNameDisplay() {
if (this->m_dc != nullptr) {
delete this->m_dc;
this->m_dc = nullptr;
}
}
};
class CMapInfoMgr {
public:
static bool Create();
static void Destroy();
static int L_AddMapBackgroundBmp(lua_State* state);
static int L_AddMapDisplayName(lua_State* state);
static int L_AddMapSignName(lua_State* state);
/* 0004 */ bool m_initialized;
/* 0008 */ std::map<std::string, MapInfo> m_maps;
/* 0010 */ std::string m_emptyName;
/* 0028 */ MapNameDisplay* m_display;
virtual ~CMapInfoMgr();
// INLINED
CMapInfoMgr() : m_display(nullptr) {
this->m_initialized = true;
}
void AddMapDisplayName(std::string map, std::string name, bool show);
void AddMapSignName(std::string map, std::string name, std::string subName);
// INLINED
void AddMapBackgroundBmp(std::string map, std::string bmp) {
this->m_maps[map].m_backgroundBmp = bmp;
}
void ShowMapName(std::string map);
MapInfo* FindMapInfo(std::string map);
const char* GetDisplayName(std::string map);
const char* GetSignSubName(std::string map);
bool LoadScript();
void DrawMapName(CRenderSystemBase& system);
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(MapInfo) == 0x64);
static_assert(sizeof(MapNameDisplay) == 0x10);
static_assert(sizeof(CMapInfoMgr) == 0x2C);
#endif
extern CMapInfoMgr* g_mapInfoMgr;
#endif