From c5aea5fa7694a764abb90df97b7ad061f9508e7c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 09:57:08 +0100 Subject: [PATCH 01/11] =?UTF-8?q?=F0=9F=93=9D=20docs(models,render):=20add?= =?UTF-8?q?ed=20inlined=20comments=20to=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Contents/Models/ModelPlayback.cpp | 1 + Source/Render/TextureStageModes.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/Contents/Models/ModelPlayback.cpp b/Source/Contents/Models/ModelPlayback.cpp index 6fcaf4b..a1087a2 100644 --- a/Source/Contents/Models/ModelPlayback.cpp +++ b/Source/Contents/Models/ModelPlayback.cpp @@ -4,6 +4,7 @@ #include namespace { + // INLINED unsigned UnsignedFrame(double value) { if (!(value < 0x1p32) || value <= -1.0) { return 0xFFFFFFFFu; diff --git a/Source/Render/TextureStageModes.h b/Source/Render/TextureStageModes.h index dcbe7f0..83d48e9 100644 --- a/Source/Render/TextureStageModes.h +++ b/Source/Render/TextureStageModes.h @@ -122,6 +122,7 @@ namespace { }; } +// INLINED static inline std::span TextureStageModeWrites(int mode) { switch (mode) { case 0: From e66baf48bdf1aaff4d963ca43ddd772506608c7e Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 09:57:19 +0100 Subject: [PATCH 02/11] =?UTF-8?q?=F0=9F=93=9D=20docs(UserHotkeyScript):=20?= =?UTF-8?q?added=20inlined=20comments=20for=20Lua=20wrapper=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Contents/Hotkeys/UserHotkeyScript.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Contents/Hotkeys/UserHotkeyScript.h b/Source/Contents/Hotkeys/UserHotkeyScript.h index 099d9f9..47edf06 100644 --- a/Source/Contents/Hotkeys/UserHotkeyScript.h +++ b/Source/Contents/Hotkeys/UserHotkeyScript.h @@ -11,18 +11,22 @@ void SaveUserHotkeys(); void ChangeUserHotkey(int tab, int index, int key1, int key2, const std::string& description); void LoadUserHotkeyTab(Json::Value& values, int tab); +// INLINED inline void ClearUserHotkeys(LuaScript&) { ClearUserHotkeys(); } +// INLINED inline void SaveUserHotkeys(LuaScript&) { SaveUserHotkeys(); } +// INLINED inline void ChangeUserHotkey(LuaScript&, int tab, int index, int key1, int key2, const std::string& description) { ChangeUserHotkey(tab, index, key1, key2, description); } +// INLINED inline void LoadUserHotkeyTab(LuaScript&, Json::Value& values, int tab) { LoadUserHotkeyTab(values, tab); } From ee401857a11f6f100559ed69ee17bdeee0d7b31a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 09:59:03 +0100 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=93=9D=20docs(annotations):=20annot?= =?UTF-8?q?ated=20inlined=20functions=20across=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Archive/PakCipher.cpp | 1 + Source/Client/Application/UnhandledExceptionHandler.cpp | 2 ++ Source/Contents/Configuration/GraphicsConfiguration.h | 1 + Source/File/File.h | 1 + 4 files changed, 5 insertions(+) diff --git a/Source/Archive/PakCipher.cpp b/Source/Archive/PakCipher.cpp index 71f5beb..a78bf41 100644 --- a/Source/Archive/PakCipher.cpp +++ b/Source/Archive/PakCipher.cpp @@ -51,6 +51,7 @@ namespace myGPack { 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11, }; + // INLINED void Permute(std::uint8_t* block, const std::uint8_t* table, unsigned count) { std::uint8_t result[8] = {}; diff --git a/Source/Client/Application/UnhandledExceptionHandler.cpp b/Source/Client/Application/UnhandledExceptionHandler.cpp index af45557..e75209b 100644 --- a/Source/Client/Application/UnhandledExceptionHandler.cpp +++ b/Source/Client/Application/UnhandledExceptionHandler.cpp @@ -33,10 +33,12 @@ char g_moduleBaseName[260] = {}; char g_crashString[8096] = {}; namespace { + // INLINED int ReadPlayerJob() { return g_session.m_job; } + // INLINED const char* ReadPlayerJobName(int jobId) { const char* const* namesBegin = g_session.m_jobNamesBegin; const char* const* namesEnd = g_session.m_jobNamesEnd; diff --git a/Source/Contents/Configuration/GraphicsConfiguration.h b/Source/Contents/Configuration/GraphicsConfiguration.h index 5161536..1c20e88 100644 --- a/Source/Contents/Configuration/GraphicsConfiguration.h +++ b/Source/Contents/Configuration/GraphicsConfiguration.h @@ -69,6 +69,7 @@ inline void GraphicsConfiguration::Load(LuaScript& script, ScriptOptions& option } } +// INLINED inline AdapterConfiguration GraphicsConfiguration::Adapter() const { return {this->backend, this->drawGuid, this->renderGuid, this->deviceGuid, this->deviceName}; } diff --git a/Source/File/File.h b/Source/File/File.h index 5882ada..f98fd33 100644 --- a/Source/File/File.h +++ b/Source/File/File.h @@ -14,6 +14,7 @@ public: bool OpenWrite(const char* path, CRenderSystemBase* renderSystem); bool Open(const char* path, int mode, bool resourcePath, bool option); + // INLINED bool Open(const char* path) { this->m_path = path; this->m_handle = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); From 38defb749a527f89a3faaaee8ec3145b2f703e74 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:00:45 +0100 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20fix(FontCache):?= =?UTF-8?q?=20attached=20STATIC=200x01311ED0=20to=20the=20fallback=20font?= =?UTF-8?q?=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Render/Text/FontCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Render/Text/FontCache.cpp b/Source/Render/Text/FontCache.cpp index 5079db5..638ae6f 100644 --- a/Source/Render/Text/FontCache.cpp +++ b/Source/Render/Text/FontCache.cpp @@ -11,7 +11,6 @@ namespace { // STATIC: 0x01311F00 - // STATIC: 0x01311ED0 const char* const primary[] = { "\xB1\xBC\xB8\xB2", "Arial", @@ -27,6 +26,7 @@ namespace { "Arial", "Tahoma" }; + // STATIC: 0x01311ED0 const char* const fallback[] = {"Gulim", "Arial", "MS Gothic", "SimSun", "MingLiU", "Tahoma", "Arial", "Verdana", "Verdana", "Arial", "Arial", "Tahoma"}; // OFFSET: 0x0054F2C0 From 779dd40d2e395d4ecfcd725ded99c6ab510d1adf Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:01:19 +0100 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20refactor(source):?= =?UTF-8?q?=20annotated=20inlined=20functions=20and=20removed=20unused=20i?= =?UTF-8?q?nclude?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Client/Browser/WebBrowser.cpp | 1 + Source/Contents/Skills/SkillTreeScript.cpp | 2 ++ Source/Render/Primitives/RenderVertexPool.cpp | 1 + Source/Render/Text/FontCache.cpp | 1 - Source/Resource/Models/ModelResourceV2.cpp | 1 + Source/Resource/World/GroundResource.cpp | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Client/Browser/WebBrowser.cpp b/Source/Client/Browser/WebBrowser.cpp index 9646cbc..74505b8 100644 --- a/Source/Client/Browser/WebBrowser.cpp +++ b/Source/Client/Browser/WebBrowser.cpp @@ -10,6 +10,7 @@ #include namespace { + // INLINED BrowserWindowSizing Sizing(CWebBrowser& owner) { return {owner.browser, owner.screenWidth, owner.screenHeight, owner.rebar, owner.auxiliaryVisible, owner.width, owner.height}; } diff --git a/Source/Contents/Skills/SkillTreeScript.cpp b/Source/Contents/Skills/SkillTreeScript.cpp index 45ad9fd..94d2e11 100644 --- a/Source/Contents/Skills/SkillTreeScript.cpp +++ b/Source/Contents/Skills/SkillTreeScript.cpp @@ -8,6 +8,7 @@ extern "C" { #include namespace { + // INLINED CPlayerSkillBundle& Bundle(lua_State* state) { return *static_cast(lua_touserdata(state, lua_upvalueindex(1))); } @@ -59,6 +60,7 @@ namespace { } } +// INLINED void RegisterSkillTreeCallbacks(lua_State* state, CPlayerSkillBundle& bundle) { lua_pushlightuserdata(state, &bundle); lua_pushcclosure(state, AddSkill, 1); diff --git a/Source/Render/Primitives/RenderVertexPool.cpp b/Source/Render/Primitives/RenderVertexPool.cpp index 7153ad2..5b8f293 100644 --- a/Source/Render/Primitives/RenderVertexPool.cpp +++ b/Source/Render/Primitives/RenderVertexPool.cpp @@ -3,6 +3,7 @@ #include namespace { + // INLINED void Append(std::vector& block, unsigned count) { const unsigned first = static_cast(block.size()); block.resize(first + count); diff --git a/Source/Render/Text/FontCache.cpp b/Source/Render/Text/FontCache.cpp index 5079db5..6dbe239 100644 --- a/Source/Render/Text/FontCache.cpp +++ b/Source/Render/Text/FontCache.cpp @@ -1,7 +1,6 @@ #include "Render/Text/FontCache.h" #include -#include #include #include diff --git a/Source/Resource/Models/ModelResourceV2.cpp b/Source/Resource/Models/ModelResourceV2.cpp index 45daf08..0d06794 100644 --- a/Source/Resource/Models/ModelResourceV2.cpp +++ b/Source/Resource/Models/ModelResourceV2.cpp @@ -19,6 +19,7 @@ namespace { return name; } + // INLINED void ReadKeys(ResourceByteReader& input, std::vector& keys, bool scale) { int count = 0; input.Read(&count, 4); diff --git a/Source/Resource/World/GroundResource.cpp b/Source/Resource/World/GroundResource.cpp index be7571f..1108f12 100644 --- a/Source/Resource/World/GroundResource.cpp +++ b/Source/Resource/World/GroundResource.cpp @@ -2,10 +2,10 @@ #include "Resource/World/GroundResource.h" #include "Resource/ResourceByteReader.h" -#include #include namespace { + // INLINED const unsigned char* Slice(ResourceByteReader& input, std::uint32_t bytes) { const auto address = reinterpret_cast(input.data) + input.position; input.position += bytes; From 98e3d7fa1774d0d609fe2698a06f89b00fdd38fc Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:02:55 +0100 Subject: [PATCH 06/11] =?UTF-8?q?=F0=9F=8E=A8=20style(shortcuts):=20annota?= =?UTF-8?q?ted=20inlined=20helper=20functions=20and=20updated=20stdio=20in?= =?UTF-8?q?clude?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/UI/Shortcuts/ShortcutDetails.cpp | 1 + Source/UI/Shortcuts/ShortcutDrop.cpp | 1 + Source/UI/Shortcuts/ShortcutTooltip.cpp | 3 ++- Source/UI/Text/TextMarkup.cpp | 2 ++ Source/UI/Text/UITextViewer.cpp | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/UI/Shortcuts/ShortcutDetails.cpp b/Source/UI/Shortcuts/ShortcutDetails.cpp index 46cd27e..9229e4f 100644 --- a/Source/UI/Shortcuts/ShortcutDetails.cpp +++ b/Source/UI/Shortcuts/ShortcutDetails.cpp @@ -6,6 +6,7 @@ #include "UI/Window/WindowRetirement.h" namespace { + // INLINED void ToScreen(const UIWindow& window, int& x, int& y) { x = (x + window.geometry.x); y = (y + window.geometry.y); diff --git a/Source/UI/Shortcuts/ShortcutDrop.cpp b/Source/UI/Shortcuts/ShortcutDrop.cpp index 8fbf313..41830d0 100644 --- a/Source/UI/Shortcuts/ShortcutDrop.cpp +++ b/Source/UI/Shortcuts/ShortcutDrop.cpp @@ -9,6 +9,7 @@ #include namespace { + // INLINED bool Grouped(std::uint32_t id) { return id - 8000u <= 60 || id - 8200u <= 41 || id - 8400u <= 57; } diff --git a/Source/UI/Shortcuts/ShortcutTooltip.cpp b/Source/UI/Shortcuts/ShortcutTooltip.cpp index 70c2dbc..27741eb 100644 --- a/Source/UI/Shortcuts/ShortcutTooltip.cpp +++ b/Source/UI/Shortcuts/ShortcutTooltip.cpp @@ -3,9 +3,10 @@ #include "UI/Buttons/UIButton.h" #include "UI/Window/UIWindow.h" -#include +#include namespace { + // INLINED void ToScreen(const UIWindow& window, int& x, int& y) { x = (x + window.geometry.x); y = (y + window.geometry.y); diff --git a/Source/UI/Text/TextMarkup.cpp b/Source/UI/Text/TextMarkup.cpp index 8fba8eb..47f7482 100644 --- a/Source/UI/Text/TextMarkup.cpp +++ b/Source/UI/Text/TextMarkup.cpp @@ -3,10 +3,12 @@ #include namespace { + // INLINED bool Hex(unsigned char value) { return (value >= '0' && value <= '9') || (value >= 'a' && value <= 'f') || (value >= 'A' && value <= 'F'); } + // INLINED bool Color(const char* text, const char* end) { if (*text != '^' || end - text < 6) { return false; diff --git a/Source/UI/Text/UITextViewer.cpp b/Source/UI/Text/UITextViewer.cpp index 053f93e..e0bea96 100644 --- a/Source/UI/Text/UITextViewer.cpp +++ b/Source/UI/Text/UITextViewer.cpp @@ -12,6 +12,7 @@ #include namespace { + // INLINED unsigned Digit(unsigned char value) { if (value >= '0' && value <= '9') { return value - '0'; @@ -28,6 +29,7 @@ namespace { return 0; } + // INLINED void ScanColors(const std::string& line, unsigned short codePage, std::uint32_t& color) { const char* current = line.c_str(); const char* end = current + line.size(); From add868efe737eba5298c5ced609590f73277cb29 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:09:10 +0100 Subject: [PATCH 07/11] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(source):=20?= =?UTF-8?q?removed=20unused=20includes=20and=20add=20INLINE=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Render/DX9/D3DX9Runtime.h | 2 ++ Source/Render/Text/TextContext.h | 1 - Source/Render/Textures/ClientTextureSources.h | 4 ++++ Source/Resource/BinkRuntime.h | 2 ++ Source/Resource/Bitmap/BitmapImage.cpp | 1 - Source/Resource/Bitmap/BitmapResource.cpp | 1 - Source/Resource/Models/AnimatedModelResource.cpp | 2 -- Source/Resource/Models/ModelResource.cpp | 6 ++---- Source/Resource/Sprites/SpriteEncoding.cpp | 1 - Source/Resource/Sprites/SpriteResource.cpp | 1 - Source/Utility/Cipher/Rijndael.h | 7 ++++--- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/Render/DX9/D3DX9Runtime.h b/Source/Render/DX9/D3DX9Runtime.h index 2bed26c..007a63a 100644 --- a/Source/Render/DX9/D3DX9Runtime.h +++ b/Source/Render/DX9/D3DX9Runtime.h @@ -25,6 +25,7 @@ private: HMODULE m_module; }; +// INLINED inline D3DX9Runtime::D3DX9Runtime() : m_module(LoadLibraryA("D3DX9_43.dll")) { if (!this->m_module) { @@ -43,6 +44,7 @@ inline D3DX9Runtime::D3DX9Runtime() : m_module(LoadLibraryA("D3DX9_43.dll")) { } } +// INLINED inline D3DX9Runtime::~D3DX9Runtime() { FreeLibrary(this->m_module); } diff --git a/Source/Render/Text/TextContext.h b/Source/Render/Text/TextContext.h index dbfdd95..82e8a77 100644 --- a/Source/Render/Text/TextContext.h +++ b/Source/Render/Text/TextContext.h @@ -1,7 +1,6 @@ #ifndef RAGNAROK_SOURCE_RENDER_TEXT_TEXTCONTEXT_H #define RAGNAROK_SOURCE_RENDER_TEXT_TEXTCONTEXT_H -#include #include class CDC; diff --git a/Source/Render/Textures/ClientTextureSources.h b/Source/Render/Textures/ClientTextureSources.h index 9e3347e..aa52761 100644 --- a/Source/Render/Textures/ClientTextureSources.h +++ b/Source/Render/Textures/ClientTextureSources.h @@ -26,16 +26,19 @@ private: IDirectDraw7* const& m_directDraw; }; +// INLINED inline ClientTextureSources::ClientTextureSources( TextureNames& names, const int& modeType, BinkMovies* const& movies, CRenderSystemBase*& system, IDirectDraw7* const& directDraw ) : m_names(names), m_modeType(modeType), m_movies(movies), m_system(system), m_directDraw(directDraw) { } +// INLINED inline const char* ClientTextureSources::Resolve(const char* name) { return this->m_names.Resolve(name); } +// INLINED inline bool ClientTextureSources::MovieSize(const char* name, int& width, int& height) { if (this->m_modeType != 1 || !this->m_movies) { return false; @@ -52,6 +55,7 @@ inline bool ClientTextureSources::MovieSize(const char* name, int& width, int& h return true; } +// INLINED inline void ClientTextureSources::CleanupTextures() { if (this->m_system && this->m_system->Backend() == 1 && this->m_directDraw) { this->m_directDraw->Compact(); diff --git a/Source/Resource/BinkRuntime.h b/Source/Resource/BinkRuntime.h index 635ba8b..1024e6f 100644 --- a/Source/Resource/BinkRuntime.h +++ b/Source/Resource/BinkRuntime.h @@ -33,6 +33,7 @@ private: HMODULE m_module; }; +// INLINED inline BinkRuntime::BinkRuntime() : m_module(LoadLibraryA("binkw32.dll")) { if (!this->m_module) { throw std::system_error(GetLastError(), std::system_category(), "binkw32.dll"); @@ -55,6 +56,7 @@ inline BinkRuntime::BinkRuntime() : m_module(LoadLibraryA("binkw32.dll")) { } } +// INLINED inline BinkRuntime::~BinkRuntime() { FreeLibrary(this->m_module); } diff --git a/Source/Resource/Bitmap/BitmapImage.cpp b/Source/Resource/Bitmap/BitmapImage.cpp index 841bcdf..b227ebb 100644 --- a/Source/Resource/Bitmap/BitmapImage.cpp +++ b/Source/Resource/Bitmap/BitmapImage.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include namespace { diff --git a/Source/Resource/Bitmap/BitmapResource.cpp b/Source/Resource/Bitmap/BitmapResource.cpp index 1535160..566f11b 100644 --- a/Source/Resource/Bitmap/BitmapResource.cpp +++ b/Source/Resource/Bitmap/BitmapResource.cpp @@ -1,6 +1,5 @@ #include "Client/Application/ErrorDialog.h" #include "Resource/Bitmap/BitmapResource.h" -#include "Resource/Bitmap/IJL15Runtime.h" #include #include diff --git a/Source/Resource/Models/AnimatedModelResource.cpp b/Source/Resource/Models/AnimatedModelResource.cpp index 6cdd5cb..73b0b1d 100644 --- a/Source/Resource/Models/AnimatedModelResource.cpp +++ b/Source/Resource/Models/AnimatedModelResource.cpp @@ -5,8 +5,6 @@ #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceByteReader.h" -#include - // INLINED AnimatedModelNode::AnimatedModelNode(TextureCache& textures) : model(nullptr), parent(nullptr), unknown_0040(0), vertexCount(0), textureVertexCount(0), faceCount(0), sharedTextureVertices(0), m_textures(textures) { diff --git a/Source/Resource/Models/ModelResource.cpp b/Source/Resource/Models/ModelResource.cpp index d7a6cf0..a0a9d77 100644 --- a/Source/Resource/Models/ModelResource.cpp +++ b/Source/Resource/Models/ModelResource.cpp @@ -205,8 +205,7 @@ bool C3dModelResV1::Load(const char* name) { input.Read(magic, 4); if (std::strcmp(magic, "GRSM") != 0) { - constexpr char message[] = "모델파일이 아닙니다. 형식을 " - "다시한번 확인해주세요."; + constexpr char message[] = "모델파일이 아닙니다. 형식을 다시한번 확인해주세요."; ShowErrorDialog(this->m_context->renderSystem, message, 0); file.Close(); @@ -220,8 +219,7 @@ bool C3dModelResV1::Load(const char* name) { input.Read(&minor, 1); if (major != 1 || minor > 5) { - constexpr char message[] = "지원되지 않는 버젼입니다. " - "내용물이 깨져있을 수 있습니다"; + constexpr char message[] = "지원되지 않는 버젼입니다. 내용물이 깨져있을 수 있습니다"; ShowErrorDialog(this->m_context->renderSystem, message, 0); file.Close(); diff --git a/Source/Resource/Sprites/SpriteEncoding.cpp b/Source/Resource/Sprites/SpriteEncoding.cpp index b19ee1f..3107faa 100644 --- a/Source/Resource/Sprites/SpriteEncoding.cpp +++ b/Source/Resource/Sprites/SpriteEncoding.cpp @@ -1,7 +1,6 @@ #include "Resource/Sprites/SpriteResource.h" #include -#include // OFFSET: 0x00761070 // FUNCTION: fn_08063 diff --git a/Source/Resource/Sprites/SpriteResource.cpp b/Source/Resource/Sprites/SpriteResource.cpp index 2e663d5..3932975 100644 --- a/Source/Resource/Sprites/SpriteResource.cpp +++ b/Source/Resource/Sprites/SpriteResource.cpp @@ -7,7 +7,6 @@ #include #include -#include #include // OFFSET: 0x0075FE90 diff --git a/Source/Utility/Cipher/Rijndael.h b/Source/Utility/Cipher/Rijndael.h index 14d782f..040e43b 100644 --- a/Source/Utility/Cipher/Rijndael.h +++ b/Source/Utility/Cipher/Rijndael.h @@ -1,9 +1,6 @@ #ifndef RAGNAROK_SOURCE_UTILITY_CIPHER_RIJNDAEL_H #define RAGNAROK_SOURCE_UTILITY_CIPHER_RIJNDAEL_H -#include -#include - class CRijndael { public: enum { ECB = 0, CBC = 1, CFB = 2 }; @@ -23,18 +20,22 @@ public: void DefDecryptBlock(const char* in, char* result); void Xor(unsigned char* destination, const unsigned char* source); + // INLINED inline int GetKeyLength() const { return this->m_keylength; } + // INLINED inline int GetBlockSize() const { return this->m_blockSize; } + // INLINED inline int GetRounds() const { return this->m_iROUNDS; } + // INLINED inline void ResetChain() { for (int i = 0; i < this->m_blockSize; ++i) { this->m_chain[i] = this->m_chain0[i]; From 3dbd2763113486942d1c118b92b4a5e4c6c7b0b4 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:21:57 +0100 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=93=9A=20docs(inlining):=20marked?= =?UTF-8?q?=20inlined=20functions=20across=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Client/Input/InputCharset.cpp | 1 + Source/Contents/Effects/EffectActor.cpp | 1 + Source/Contents/Ground/GroundGeometry.cpp | 1 + Source/Contents/Items/ItemNaming.cpp | 1 + Source/Contents/World/WorldModelLoading.cpp | 1 + Source/Render/DX7/DirectDrawEnumeration.cpp | 1 + Source/Render/DeviceContext/DCBitmap.cpp | 1 + Source/Resource/Audio/MilesRuntime.h | 3 +++ Source/Resource/Bitmap/IJL15Runtime.h | 2 ++ 9 files changed, 12 insertions(+) diff --git a/Source/Client/Input/InputCharset.cpp b/Source/Client/Input/InputCharset.cpp index 7ada0aa..50822d1 100644 --- a/Source/Client/Input/InputCharset.cpp +++ b/Source/Client/Input/InputCharset.cpp @@ -19,6 +19,7 @@ const char* InputCharset::Prefix(bool alternate) const { return prefix; } +// INLINED unsigned InputCharset::CodePage(unsigned fallback) const { return this->enabled ? LanguageCodePage(this->language) : fallback; } diff --git a/Source/Contents/Effects/EffectActor.cpp b/Source/Contents/Effects/EffectActor.cpp index 2b1f3e3..4aae63d 100644 --- a/Source/Contents/Effects/EffectActor.cpp +++ b/Source/Contents/Effects/EffectActor.cpp @@ -9,6 +9,7 @@ EffectActorState::~EffectActorState() { this->Attachments().DetachAll(); } +// INLINED EffectAttachments EffectActorState::Attachments() { return {this->effects, this->first, this->second}; } diff --git a/Source/Contents/Ground/GroundGeometry.cpp b/Source/Contents/Ground/GroundGeometry.cpp index 902101d..9078f15 100644 --- a/Source/Contents/Ground/GroundGeometry.cpp +++ b/Source/Contents/Ground/GroundGeometry.cpp @@ -93,6 +93,7 @@ void GroundGeometry::Reset(int columns, int rows) { this->unknown_0058 = 0; } +// INLINED GroundSpatial GroundGeometry::Spatial() const { return {this->width, this->height, this->cellSize, this->cells}; } diff --git a/Source/Contents/Items/ItemNaming.cpp b/Source/Contents/Items/ItemNaming.cpp index ab853ca..70df50b 100644 --- a/Source/Contents/Items/ItemNaming.cpp +++ b/Source/Contents/Items/ItemNaming.cpp @@ -40,6 +40,7 @@ namespace { } } +// INLINED const char* ItemNaming::Message(int id) const { return LookupMessage(id, this->languagePrefix, this->service, this->language); } diff --git a/Source/Contents/World/WorldModelLoading.cpp b/Source/Contents/World/WorldModelLoading.cpp index cf617da..0e19686 100644 --- a/Source/Contents/World/WorldModelLoading.cpp +++ b/Source/Contents/World/WorldModelLoading.cpp @@ -129,6 +129,7 @@ void WorldModelLoading::Run() { } } +// INLINED void WorldModelLoading::Publish(WorldSpatialTree& root) { C3dActor* const* data = this->models.data(); PublishWorldModels(root, data, this->published, this->pending); diff --git a/Source/Render/DX7/DirectDrawEnumeration.cpp b/Source/Render/DX7/DirectDrawEnumeration.cpp index 765e204..17de44d 100644 --- a/Source/Render/DX7/DirectDrawEnumeration.cpp +++ b/Source/Render/DX7/DirectDrawEnumeration.cpp @@ -9,6 +9,7 @@ struct DirectDrawEnumeration::AdapterContext { DirectDrawDeviceRecord record{}; }; +// INLINED DirectDrawEnumeration::DirectDrawEnumeration(const GUID& selectedDraw, RECT& monitor) : m_selectedDraw(selectedDraw), m_monitor(monitor) { } diff --git a/Source/Render/DeviceContext/DCBitmap.cpp b/Source/Render/DeviceContext/DCBitmap.cpp index 61a0c6d..5506243 100644 --- a/Source/Render/DeviceContext/DCBitmap.cpp +++ b/Source/Render/DeviceContext/DCBitmap.cpp @@ -19,6 +19,7 @@ CDCBitmap* CreateBitmapDC(int width, int height, bool fill) { return bitmap; } +// INLINED void CDCBitmap::UploadTexture(CRenderSystemBase& system, CTexture*& texture) { this->m_bitmap.UploadTexture(system, texture); } diff --git a/Source/Resource/Audio/MilesRuntime.h b/Source/Resource/Audio/MilesRuntime.h index 02e3dff..cc830da 100644 --- a/Source/Resource/Audio/MilesRuntime.h +++ b/Source/Resource/Audio/MilesRuntime.h @@ -83,11 +83,13 @@ private: HMODULE m_module; }; +// INLINED inline MilesRuntime& MilesRuntime::Get() { static MilesRuntime instance; return instance; } +// INLINED inline MilesRuntime::MilesRuntime() : m_module(LoadLibraryA("Mss32.dll")) { if (!this->m_module) { throw std::system_error(GetLastError(), std::system_category(), "Mss32.dll"); @@ -158,6 +160,7 @@ inline MilesRuntime::MilesRuntime() : m_module(LoadLibraryA("Mss32.dll")) { } } +// INLINED inline MilesRuntime::~MilesRuntime() { FreeLibrary(this->m_module); } diff --git a/Source/Resource/Bitmap/IJL15Runtime.h b/Source/Resource/Bitmap/IJL15Runtime.h index a3e641d..61512ef 100644 --- a/Source/Resource/Bitmap/IJL15Runtime.h +++ b/Source/Resource/Bitmap/IJL15Runtime.h @@ -45,6 +45,7 @@ private: IJL15Runtime& operator=(const IJL15Runtime&) = delete; }; +// INLINED inline IJL15Runtime::IJL15Runtime() : m_module(LoadLibraryA("ijl15.dll")) { if (!this->m_module) { throw std::system_error(GetLastError(), std::system_category(), "ijl15.dll"); @@ -61,6 +62,7 @@ inline IJL15Runtime::IJL15Runtime() : m_module(LoadLibraryA("ijl15.dll")) { } } +// INLINED inline IJL15Runtime::~IJL15Runtime() { FreeLibrary(this->m_module); } From ff15df90ad03cb8380379452c3177eaa3b7f54f2 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:42:13 +0100 Subject: [PATCH 09/11] =?UTF-8?q?=F0=9F=93=9D=20docs(annotations):=20marke?= =?UTF-8?q?d=20inlined=20functions=20across=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Contents/Async/AsyncWorkMgr.h | 1 + Source/Contents/Models/ModelRendering.cpp | 1 + Source/Network/Connection/Connection.h | 3 +++ Source/Render/DX7/RenderSystemDX7.h | 1 + Source/Render/DX9/DeviceOwnerDX9.cpp | 2 ++ Source/Render/DX9/RenderSystemDX9.cpp | 2 ++ Source/Render/DX9/RenderSystemDX9.h | 1 + Source/Render/DX9/ScreenshotDX9.cpp | 1 + Source/Render/Projection/RendererViewport.cpp | 1 + Source/Resource/Resource.cpp | 1 + Source/Resource/ResourceFailures.cpp | 2 ++ Source/Resource/World/TerrainResource.cpp | 1 + Source/UI/Cooldowns/CooldownOwner.cpp | 2 ++ Source/UI/Edit/ItemTagRetirement.cpp | 1 + Source/UI/Edit/UIEditCtrl.cpp | 2 ++ Source/UI/Lists/UIComboBoxEx.cpp | 1 + Source/UI/Party/UIRegisterPartyWnd.cpp | 1 + Source/UI/Text/UIBalloonText.cpp | 1 + Source/UI/Text/UITextViewerLinks.cpp | 1 + Source/UI/Window/UIMessageBox.cpp | 1 + 20 files changed, 27 insertions(+) diff --git a/Source/Contents/Async/AsyncWorkMgr.h b/Source/Contents/Async/AsyncWorkMgr.h index b03b379..f40520f 100644 --- a/Source/Contents/Async/AsyncWorkMgr.h +++ b/Source/Contents/Async/AsyncWorkMgr.h @@ -64,6 +64,7 @@ public: void StopRecruiting(std::uint32_t accountId, std::string world, std::string url, std::string token, std::uint32_t masterAccountId, StopRecruitingContext& context); + // INLINED CAsyncWorkRecycleObjectPoolMgr& Pools() { return *this->m_pools; } diff --git a/Source/Contents/Models/ModelRendering.cpp b/Source/Contents/Models/ModelRendering.cpp index 7dadcbc..b27d854 100644 --- a/Source/Contents/Models/ModelRendering.cpp +++ b/Source/Contents/Models/ModelRendering.cpp @@ -10,6 +10,7 @@ #include "Utility/Math/ScalarConversion.h" #include +// INLINED ModelRenderContext::ModelRenderContext( const RenderProjection& projection, RenderCommandPool& commands, RenderVertexPool& vertices, RenderQueues& queues, const int& width, const int& height, const bool& depthAlpha, const float& depthStart, const float& depthEnd, const bool& overrideColor, const bool& integerColor, const float* overrideScale, diff --git a/Source/Network/Connection/Connection.h b/Source/Network/Connection/Connection.h index 6cb1986..33b0aef 100644 --- a/Source/Network/Connection/Connection.h +++ b/Source/Network/Connection/Connection.h @@ -46,12 +46,15 @@ public: void ResetBuffers(); void SetDeferred(unsigned char value); + // INLINED SOCKET NativeSocket() const { return this->m_socket; } + // INLINED ConnectionBuffer& Input() { return this->m_input; } + // INLINED unsigned& SendDeadline() { return this->m_sendDeadline; } diff --git a/Source/Render/DX7/RenderSystemDX7.h b/Source/Render/DX7/RenderSystemDX7.h index cb43256..175c24a 100644 --- a/Source/Render/DX7/RenderSystemDX7.h +++ b/Source/Render/DX7/RenderSystemDX7.h @@ -32,6 +32,7 @@ public: HRESULT TestDevice() override; HRESULT Present(bool option) override; + // INLINED DeviceOwnerDX7* Device() const { return this->m_device; } diff --git a/Source/Render/DX9/DeviceOwnerDX9.cpp b/Source/Render/DX9/DeviceOwnerDX9.cpp index b3fa12d..4c27141 100644 --- a/Source/Render/DX9/DeviceOwnerDX9.cpp +++ b/Source/Render/DX9/DeviceOwnerDX9.cpp @@ -269,10 +269,12 @@ HRESULT DeviceOwnerDX9::Present(int) { return this->lastPresent; } +// INLINED SurfaceDX9Context DeviceOwnerDX9::SurfaceContext() const { return {this->device, this->backBufferDescription, this->backBuffer}; } +// INLINED TextureDX9Context DeviceOwnerDX9::TextureContext( D3DX9Runtime& d3dx, RenderPrimitivePool& primitives, RenderQueues& queues, bool depthAlpha, float depthStart, float depthEnd ) const { diff --git a/Source/Render/DX9/RenderSystemDX9.cpp b/Source/Render/DX9/RenderSystemDX9.cpp index b020c4f..f02bf9f 100644 --- a/Source/Render/DX9/RenderSystemDX9.cpp +++ b/Source/Render/DX9/RenderSystemDX9.cpp @@ -23,6 +23,7 @@ CRenderSystemDX9::~CRenderSystemDX9() { delete this->m_defaultTexture; } +// INLINED void CRenderSystemDX9::RefreshContexts() { this->m_surfaceContext = this->m_device->SurfaceContext(); auto& context = this->m_textureContext; @@ -43,6 +44,7 @@ std::int32_t CRenderSystemDX9::Backend() { return 2; } +// INLINED HRESULT CRenderSystemDX9::Initialize(HWND window) { const HRESULT result = InitializeConfiguredDeviceDX9(*this->m_device, window, this->m_context->deviceOptions, this->m_context->adapter, this->m_context->serviceUsesDX7); diff --git a/Source/Render/DX9/RenderSystemDX9.h b/Source/Render/DX9/RenderSystemDX9.h index 6c27754..d4800f6 100644 --- a/Source/Render/DX9/RenderSystemDX9.h +++ b/Source/Render/DX9/RenderSystemDX9.h @@ -49,6 +49,7 @@ public: HRESULT TestDevice() override; HRESULT Present(bool option) override; + // INLINED DeviceOwnerDX9& Device() { return *this->m_device; } diff --git a/Source/Render/DX9/ScreenshotDX9.cpp b/Source/Render/DX9/ScreenshotDX9.cpp index 08d5cef..0bfb5da 100644 --- a/Source/Render/DX9/ScreenshotDX9.cpp +++ b/Source/Render/DX9/ScreenshotDX9.cpp @@ -9,6 +9,7 @@ namespace { class ScreenshotOverlay : public UIRPData { public: + // INLINED const std::list& Primitives() const { return this->m_primitives; } diff --git a/Source/Render/Projection/RendererViewport.cpp b/Source/Render/Projection/RendererViewport.cpp index 6896f41..dc0456c 100644 --- a/Source/Render/Projection/RendererViewport.cpp +++ b/Source/Render/Projection/RendererViewport.cpp @@ -30,6 +30,7 @@ void RendererViewport::SetSize(int columns, int rows, const float& projectionSca cotangent = projectionScale / this->uiScaleY; } +// INLINED RenderProjection RendererViewport::Projection() const { return {this->scaleX, this->scaleY, this->centerX, this->centerY}; } diff --git a/Source/Resource/Resource.cpp b/Source/Resource/Resource.cpp index d7367f3..d87556e 100644 --- a/Source/Resource/Resource.cpp +++ b/Source/Resource/Resource.cpp @@ -11,6 +11,7 @@ ResourceName::ResourceName(const char* name) { this->Assign(name); } +// INLINED void ResourceName::Assign(const char* name) { myGPack::AssignNameKey(this->hash, this->text, name); } diff --git a/Source/Resource/ResourceFailures.cpp b/Source/Resource/ResourceFailures.cpp index 6b53357..ea9320a 100644 --- a/Source/Resource/ResourceFailures.cpp +++ b/Source/Resource/ResourceFailures.cpp @@ -3,10 +3,12 @@ #include +// INLINED ResourceFailures::ResourceFailures(ResourceMessages& messages) : m_messages(&messages) { InitializeCriticalSection(&this->m_lock); } +// INLINED ResourceFailures::~ResourceFailures() { DeleteCriticalSection(&this->m_lock); } diff --git a/Source/Resource/World/TerrainResource.cpp b/Source/Resource/World/TerrainResource.cpp index 6fa8e20..88fcafb 100644 --- a/Source/Resource/World/TerrainResource.cpp +++ b/Source/Resource/World/TerrainResource.cpp @@ -75,6 +75,7 @@ void C3dAttr::Unload() { this->height = 0; } +// INLINED TerrainHeight C3dAttr::Grid() const { return {this->width, this->height, this->cellSize, this->m_cells.data()}; } diff --git a/Source/UI/Cooldowns/CooldownOwner.cpp b/Source/UI/Cooldowns/CooldownOwner.cpp index 667db74..d330e80 100644 --- a/Source/UI/Cooldowns/CooldownOwner.cpp +++ b/Source/UI/Cooldowns/CooldownOwner.cpp @@ -28,11 +28,13 @@ void CooldownOwner::ClearReverseCommands() { this->m_drawing.reverse.clear(); } +// INLINED CooldownState* CooldownOwner::Find(unsigned id) { const auto entry = this->m_values.find(id); return entry == this->m_values.end() ? nullptr : &entry->second; } +// INLINED void CooldownOwner::Erase(unsigned id) { this->m_values.erase(id); } diff --git a/Source/UI/Edit/ItemTagRetirement.cpp b/Source/UI/Edit/ItemTagRetirement.cpp index 163696d..fdaeb89 100644 --- a/Source/UI/Edit/ItemTagRetirement.cpp +++ b/Source/UI/Edit/ItemTagRetirement.cpp @@ -2,6 +2,7 @@ #include "UI/Edit/ItemTagRetirement.h" #include "UI/Window/UIWindow.h" +// INLINED FocusedItemTagRemoval::FocusedItemTagRemoval(InputFocus& focus) : m_focus(focus) { } diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index 4f60255..ac84bcc 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -187,9 +187,11 @@ void EditPainting::Draw() { } class LinkLayout : public EditLinkLayout { public: + // INLINED explicit LinkLayout(UIEditCtrl& control) : m_control(control) { } + // INLINED void Update() override { this->m_control.UpdateLinks(); } diff --git a/Source/UI/Lists/UIComboBoxEx.cpp b/Source/UI/Lists/UIComboBoxEx.cpp index 9c596a9..105a037 100644 --- a/Source/UI/Lists/UIComboBoxEx.cpp +++ b/Source/UI/Lists/UIComboBoxEx.cpp @@ -10,6 +10,7 @@ #include namespace { + // INLINED unsigned Palette(ResourceMgr& resources, int column, int row) { constexpr char path[] = "유저인터페이스\\colorchip.bmp"; auto* chip = static_cast(resources.Load(path)); diff --git a/Source/UI/Party/UIRegisterPartyWnd.cpp b/Source/UI/Party/UIRegisterPartyWnd.cpp index 1fb9236..f39f339 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.cpp +++ b/Source/UI/Party/UIRegisterPartyWnd.cpp @@ -216,6 +216,7 @@ void UIRegisterPartyWnd::SetInfo(CAdvenPartyInfo value) { this->Invalidate(); } +// INLINED const char* UIRegisterPartyWnd::Text(UIEditCtrl& control) const { const auto& edit = this->m_registration->edits; return edit.focus.window == &control ? edit.input.text.c_str() : control.text.c_str(); diff --git a/Source/UI/Text/UIBalloonText.cpp b/Source/UI/Text/UIBalloonText.cpp index 23cb5af..a04234f 100644 --- a/Source/UI/Text/UIBalloonText.cpp +++ b/Source/UI/Text/UIBalloonText.cpp @@ -32,6 +32,7 @@ namespace { } } + // INLINED SIZE Measure(UIBalloonText& window, BalloonTextContext& owner, const std::string& text, int family, int height) { if (text.empty()) { return {0, 0}; diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index 0bc68ce..b379977 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -11,6 +11,7 @@ #include +// INLINED std::string UITextViewer::ConvertChat(std::string text) { std::string converted; DisplayNavigationLink(converted, text); diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index 0f75d27..a8464a6 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -17,6 +17,7 @@ namespace { constexpr char prefix[] = "유저인터페이스\\"; + // INLINED std::uint32_t Palette(ResourceMgr& resources, int x, int y) { const auto* resource = static_cast(resources.Load((std::string(prefix) + "colorchip.bmp").c_str())); const auto& image = resource->image; From e331e03f4c2dfbaf91fd8df0f746a6c93d489116 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:43:00 +0100 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=93=9D=20docs(headers):=20annotated?= =?UTF-8?q?=20inlined=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Render/DX7/TextureBindingDX7.h | 1 + Source/Resource/ResourceByteReader.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/Render/DX7/TextureBindingDX7.h b/Source/Render/DX7/TextureBindingDX7.h index 333600d..50be23f 100644 --- a/Source/Render/DX7/TextureBindingDX7.h +++ b/Source/Render/DX7/TextureBindingDX7.h @@ -15,6 +15,7 @@ struct TextureBindingDX7 { /* 0274 */ IDirect3DDevice7* device = nullptr; void Set(unsigned stage, CTextureDX7* texture); + // INLINED void Set(IDirect3DDevice7* dev, unsigned stage, CTextureDX7* texture) { this->device = dev; this->Set(stage, texture); diff --git a/Source/Resource/ResourceByteReader.h b/Source/Resource/ResourceByteReader.h index de9e4ad..98b7bad 100644 --- a/Source/Resource/ResourceByteReader.h +++ b/Source/Resource/ResourceByteReader.h @@ -8,6 +8,7 @@ struct ResourceByteReader { unsigned size; unsigned position = 0; + // INLINED bool Read(void* output, unsigned bytes) { if (position + bytes > size) { return false; From 07d2f8441c8bca286a9d7cef70422c0c009af61a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:46:28 +0100 Subject: [PATCH 11/11] =?UTF-8?q?=F0=9F=93=9D=20docs(headers):=20added=20i?= =?UTF-8?q?nlined=20comments=20to=20method=20definitions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Resource/World/TerrainResource.h | 1 + Source/UI/Cooldowns/CooldownOwner.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Source/Resource/World/TerrainResource.h b/Source/Resource/World/TerrainResource.h index 6d8b067..8113642 100644 --- a/Source/Resource/World/TerrainResource.h +++ b/Source/Resource/World/TerrainResource.h @@ -28,6 +28,7 @@ public: private: struct Cell : TerrainHeightCell { + // INLINED Cell() noexcept { } }; diff --git a/Source/UI/Cooldowns/CooldownOwner.h b/Source/UI/Cooldowns/CooldownOwner.h index c4d1a30..96cef5f 100644 --- a/Source/UI/Cooldowns/CooldownOwner.h +++ b/Source/UI/Cooldowns/CooldownOwner.h @@ -14,6 +14,7 @@ public: CooldownState* Find(unsigned id); void Erase(unsigned id); + // INLINED CooldownDrawing& Drawing() { return this->m_drawing; }