Batch #3354 by eAthena: 0 byte-identical, 12 confirmed by peer review. - fn_06483 CMapInfoMgr::`scalar deleting destructor': logic confirmed by peer review - fn_06484 CMapInfoMgr::AddMapDisplayName: logic confirmed by peer review - fn_06485 CMapInfoMgr::AddMapSignName: logic confirmed by peer review - fn_06486 CMapInfoMgr::Create: logic confirmed by peer review - fn_06488 CMapInfoMgr::Destroy: logic confirmed by peer review - fn_06489 CMapInfoMgr::GetDisplayName: logic confirmed by peer review - fn_06490 CMapInfoMgr::FindMapInfo: logic confirmed by peer review - fn_06491 CMapInfoMgr::GetSignSubName: logic confirmed by peer review - fn_06495 CMapInfoMgr::L_AddMapBackgroundBmp: logic confirmed by peer review - fn_06496 CMapInfoMgr::L_AddMapDisplayName: logic confirmed by peer review - fn_06497 CMapInfoMgr::L_AddMapSignName: logic confirmed by peer review - fn_06505 CPrivateAirplaneMgr::Destroy: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, meitogi 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/MapInfoMgr.cpp, Source/Contents/PrivateAirplaneMgr.cpp
80 lines
1.9 KiB
C++
80 lines
1.9 KiB
C++
#ifndef RAGNAROK_SOURCE_CONTENTS_MAPINFOMGR_H
|
|
#define RAGNAROK_SOURCE_CONTENTS_MAPINFOMGR_H
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
#include <windows.h>
|
|
|
|
class CDC;
|
|
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;
|
|
|
|
// 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;
|
|
}
|
|
MapInfo* FindMapInfo(std::string map);
|
|
const char* GetDisplayName(std::string map);
|
|
const char* GetSignSubName(std::string map);
|
|
};
|
|
|
|
#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
|