diff --git a/Source/Contents/ConfigMgr.cpp b/Source/Contents/ConfigMgr.cpp new file mode 100644 index 00000000..e51219dc --- /dev/null +++ b/Source/Contents/ConfigMgr.cpp @@ -0,0 +1,17 @@ +#include "Contents/ConfigMgr.h" + +#include + +// GLOBAL: gl_24838 +CConfigMgr* g_configMgr = nullptr; + +// OFFSET: 0x007A6FE0 + +// OFFSET: 0x007A7070 + +// OFFSET: 0x007A7160 +// FUNCTION: fn_09045 +void CConfigMgr::Update() { +} + +// OFFSET: 0x007A7170 diff --git a/Source/Contents/ConfigMgr.h b/Source/Contents/ConfigMgr.h new file mode 100644 index 00000000..7b9711ff --- /dev/null +++ b/Source/Contents/ConfigMgr.h @@ -0,0 +1,37 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_CONFIGMGR_H +#define RAGNAROK_SOURCE_CONTENTS_CONFIGMGR_H + +#include + +// VTABLE: vt_00751 +class CConfigMgr { +public: + // INLINED + CConfigMgr() : m_initialized(false), m_hasPerformanceCounter(true) { + if (!QueryPerformanceFrequency(&this->m_frequency)) { + this->m_hasPerformanceCounter = false; + this->m_frequency.QuadPart = 1000000; + } + + this->m_ticksPerFrame = this->m_frequency.QuadPart / 60; + this->m_initialized = true; + } + virtual ~CConfigMgr(); + + static bool Create(); + static void Update(); + static void Destroy(); + + /* 0008 */ bool m_initialized; + /* 0009 */ bool m_hasPerformanceCounter; + /* 0010 */ LARGE_INTEGER m_frequency; + /* 0018 */ LONGLONG m_ticksPerFrame; +}; + +extern CConfigMgr* g_configMgr; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CConfigMgr) == 0x20); +#endif + +#endif diff --git a/Source/Contents/SimpleStringMgr.cpp b/Source/Contents/SimpleStringMgr.cpp new file mode 100644 index 00000000..01b29541 --- /dev/null +++ b/Source/Contents/SimpleStringMgr.cpp @@ -0,0 +1,10 @@ +#include "Contents/SimpleStringMgr.h" + +#include + +// GLOBAL: gl_24840 +CSimpleStringMgr* g_simpleStringMgr = nullptr; + +// OFFSET: 0x007A96A0 + +// OFFSET: 0x007A9DA0 diff --git a/Source/Contents/SimpleStringMgr.h b/Source/Contents/SimpleStringMgr.h new file mode 100644 index 00000000..3382a00c --- /dev/null +++ b/Source/Contents/SimpleStringMgr.h @@ -0,0 +1,37 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_SIMPLESTRINGMGR_H +#define RAGNAROK_SOURCE_CONTENTS_SIMPLESTRINGMGR_H + +#include +#include +#include + +// VTABLE: vt_00755 +class CSimpleStringMgr { +public: + enum STR_TYPE { + STR_TYPE_EMOTION = 0, + }; + + struct StrTypeHash { + std::size_t operator()(STR_TYPE type) const { + return static_cast(type); + } + }; + + virtual ~CSimpleStringMgr() { + } + + static void Destroy(); + const char* GetString(const char* key); + + /* 0004 */ bool m_initialized; + /* 0008 */ std::unordered_map, StrTypeHash> m_tables; +}; + +extern CSimpleStringMgr* g_simpleStringMgr; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CSimpleStringMgr) == 0x28); +#endif + +#endif diff --git a/Source/Contents/SpecialPopupMgr.cpp b/Source/Contents/SpecialPopupMgr.cpp new file mode 100644 index 00000000..b32ecda9 --- /dev/null +++ b/Source/Contents/SpecialPopupMgr.cpp @@ -0,0 +1,25 @@ +#include "Contents/SpecialPopupMgr.h" + +extern "C" { +#include +} + +#include +#include +#include +#include + +// GLOBAL: gl_24839 +CSpecialPopupMgr* g_specialPopupMgr = nullptr; + +// OFFSET: 0x007A7930 + +// OFFSET: 0x007A7A20 + +// OFFSET: 0x007A7A40 + +// OFFSET: 0x007A7DB0 + +// OFFSET: 0x007A80B0 + +// OFFSET: 0x007A82D0 diff --git a/Source/Contents/SpecialPopupMgr.h b/Source/Contents/SpecialPopupMgr.h new file mode 100644 index 00000000..2110ba03 --- /dev/null +++ b/Source/Contents/SpecialPopupMgr.h @@ -0,0 +1,57 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_SPECIALPOPUPMGR_H +#define RAGNAROK_SOURCE_CONTENTS_SPECIALPOPUPMGR_H + +#include +#include +#include + +struct lua_State; + +// VTABLE: vt_00752 +struct PopupData { + // INLINED + PopupData() : m_messageId(0), m_color(0xFFFFFFFF) { + } + virtual ~PopupData() { + } + + /* 0004 */ int m_messageId; + /* 0008 */ unsigned int m_color; + /* 000C */ std::vector m_descriptions; +}; + +// VTABLE: vt_00753 +class CSpecialPopupMgr { +public: + // INLINED + CSpecialPopupMgr() { + this->m_initialized = true; + } + virtual ~CSpecialPopupMgr() { + } + + static bool Create(); + static void Destroy(); + PopupData* GetPopup(int id); + static int LuaAddDesc(lua_State* state); + static int LuaAddMsg(lua_State* state); + + // INLINED + void AddDescription(int id, std::string description) { + this->m_popups[id].m_descriptions.push_back(description); + } + + /* 0004 */ bool m_initialized; + /* 0008 */ std::map m_popups; +}; + +extern CSpecialPopupMgr* g_specialPopupMgr; + +std::string FormatPopupString(const char* format, ...); + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(PopupData) == 0x18); +static_assert(sizeof(CSpecialPopupMgr) == 0x10); +#endif + +#endif diff --git a/data/compile.json b/data/compile.json index a81571af..ba293338 100644 --- a/data/compile.json +++ b/data/compile.json @@ -302,6 +302,7 @@ "Source/Contents/ClientState.cpp": 4, "Source/Contents/ClientTiming.cpp": 4, "Source/Contents/ClientXmlTables.cpp": 4, + "Source/Contents/ConfigMgr.cpp": 4, "Source/Contents/Configuration/OptionWriter.cpp": 4, "Source/Contents/Configuration/ScriptOptions.cpp": 4, "Source/Contents/Configuration/ServiceConfiguration.cpp": 4, @@ -451,6 +452,7 @@ "Source/Contents/RobeTopLayer.cpp": 4, "Source/Contents/ServerTimeManager.cpp": 4, "Source/Contents/ShowRankingScheduler.cpp": 4, + "Source/Contents/SimpleStringMgr.cpp": 4, "Source/Contents/Skills/AutomaticSkills.cpp": 4, "Source/Contents/Skills/ClientSkills.cpp": 4, "Source/Contents/Skills/PlayerSkillBundle.cpp": 4, @@ -473,6 +475,7 @@ "Source/Contents/Sound/SoundConfiguration.cpp": 4, "Source/Contents/Sound/SoundMaker.cpp": 4, "Source/Contents/Sound/SoundMgr.cpp": 4, + "Source/Contents/SpecialPopupMgr.cpp": 4, "Source/Contents/SpriteFrameSynchronization.cpp": 4, "Source/Contents/SpriteJob.cpp": 4, "Source/Contents/SpriteLayerDepth.cpp": 4,