From add868efe737eba5298c5ced609590f73277cb29 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 10:09:10 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(source):=20remove?= =?UTF-8?q?d=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];