diff --git a/Source/Archive/GPak.cpp b/Source/Archive/GPak.cpp index b69db3d1..241f2dc7 100644 --- a/Source/Archive/GPak.cpp +++ b/Source/Archive/GPak.cpp @@ -1136,12 +1136,12 @@ HashSearchResult_655D70 HashTable_655340::FindLast(const short* key, unsigned in struct SeedGen_657C30 { unsigned int seed; - __declspec(noinline) unsigned int sub_657C30(); + __declspec(noinline) unsigned int NextSeed(); }; // OFFSET: 0x00657C30 // FUNCTION: fn_05095 -__declspec(noinline) unsigned int SeedGen_657C30::sub_657C30() { +__declspec(noinline) unsigned int SeedGen_657C30::NextSeed() { this->seed = static_cast(static_cast(this->seed) * 40014u % 0x7fffffabu); return this->seed; } @@ -1185,7 +1185,7 @@ void RanluxEngine_655F00::Seed(const unsigned int* seed_ptr, char flag, int unus carry = (state[24] == 0) ? 1 : 0; } else { SeedGen_657C30 gen{seed}; - carry = gen.sub_657C30(); + carry = gen.NextSeed(); } state[0] = 24; diff --git a/Source/Client/Mode/LoginMode.cpp b/Source/Client/Mode/LoginMode.cpp index d85ffe24..c8697580 100644 --- a/Source/Client/Mode/LoginMode.cpp +++ b/Source/Client/Mode/LoginMode.cpp @@ -1337,7 +1337,7 @@ bool sub_D92B60(int) { // OFFSET: 0x00D9A230 // FUNCTION: fn_22310 -void sub_D9A230() { +void PreloadLoginSprites() { PreloadCommonSprites(); } diff --git a/Source/Contents/AchievementMgr.cpp b/Source/Contents/AchievementMgr.cpp index 421eaac8..d5ab65f1 100644 --- a/Source/Contents/AchievementMgr.cpp +++ b/Source/Contents/AchievementMgr.cpp @@ -38,7 +38,7 @@ bool CAchievementMgr::CreateInstance() { return false; } - if (!g_achievementMgr->sub_66EAA0()) { + if (!g_achievementMgr->LoadAchievementInfo()) { if (g_achievementMgr != nullptr) { delete g_achievementMgr; } @@ -241,7 +241,7 @@ private: // OFFSET: 0x0066EAA0 // FUNCTION: fn_05322 -bool CAchievementMgr::sub_66EAA0() { +bool CAchievementMgr::LoadAchievementInfo() { NLuaState lua; if (lua.IsValid()) { luaL_openlibs(lua.GetState()); diff --git a/Source/Contents/AchievementMgr.h b/Source/Contents/AchievementMgr.h index d47d3e0a..88c4d131 100644 --- a/Source/Contents/AchievementMgr.h +++ b/Source/Contents/AchievementMgr.h @@ -57,7 +57,7 @@ public: static bool CreateInstance(); static void DestroyInstance(); - bool sub_66EAA0(); + bool LoadAchievementInfo(); /* 0004 */ bool unknown_0004; /* 0008 */ int groupWidth; diff --git a/Source/Contents/Actors/Skill.cpp b/Source/Contents/Actors/Skill.cpp index e3f8c489..6d0dd08f 100644 --- a/Source/Contents/Actors/Skill.cpp +++ b/Source/Contents/Actors/Skill.cpp @@ -267,7 +267,7 @@ static_assert(sizeof(SkillPickInfo) == 0x28); // OFFSET: 0x00E55100 // FUNCTION: fn_24303 -void CSkill::sub_E55100(const float* box, float x, float y) { +void CSkill::SetRenderInfo(const float* box, float x, float y) { if (this->render.unknown_00A4Bytes[1] != 0) { // GLOBAL: gl_25171 static int minimum = static_cast(g_renderer->UiScaleX() * 34.0f); @@ -309,7 +309,7 @@ void CSkill::sub_E55100(const float* box, float x, float y) { // OFFSET: 0x00E55320 // FUNCTION: fn_24304 -void CSkill::sub_E55320(const char* modelName) { +void CSkill::ShowModel(const char* modelName) { if (modelName == nullptr || this->render.enabled == 0) { return; } @@ -530,7 +530,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int case 0x99: case 0xE5: this->render.unknown_00A4Bytes[1] = 1; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0x8D: this->render.unknown_00A4Bytes[1] = 1; @@ -538,11 +538,11 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int case 0x8F: this->render.unknown_00A4Bytes[1] = 1; this->m_effectId = 0x6A; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0x94: this->render.unknown_00A4Bytes[1] = 1; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (this->render.enabled && !this->HasId(0x91)) { this->LaunchEffect(0x91, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -550,22 +550,22 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int case 0x95: this->render.unknown_00A4Bytes[1] = 1; this->m_effectId = 0x8B; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0x96: this->render.unknown_00A4Bytes[1] = 1; this->m_effectId = 0x63; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0x97: this->render.unknown_00A4Bytes[1] = 1; this->m_effectId = 0x6C; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0x98: this->render.unknown_00A4Bytes[1] = 1; this->m_effectId = 0x6B; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0xBC: case 0xDC: @@ -619,23 +619,23 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int case 0xD5: this->m_effectId = 0x8B; this->render.unknown_00A4Bytes[1] = 0; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0xD6: case 0xD9: this->m_effectId = 0x6B; this->render.unknown_00A4Bytes[1] = 0; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0xD7: this->m_effectId = 0x6C; this->render.unknown_00A4Bytes[1] = 0; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); return; case 0xD8: this->m_effectId = 0x6B; this->render.unknown_00A4Bytes[1] = 0; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (!this->HasId(0x91)) { this->LaunchEffect(0x91, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -858,28 +858,28 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int return; case 0x5174: this->render.unknown_00A4Bytes[1] = 1; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (this->render.enabled) { g_effectMgr->Spawn(this->render.accountId, 0x752, position.x, position.y, position.z, 0, -1, 0, 0); } return; case 0x5175: this->render.unknown_00A4Bytes[1] = 1; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (this->render.enabled) { g_effectMgr->Spawn(this->render.accountId, 0x75A, position.x, position.y, position.z, 0, -1, 0, 0); } return; case 0x5176: this->render.unknown_00A4Bytes[1] = 1; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (this->render.enabled) { g_effectMgr->Spawn(this->render.accountId, 0x756, position.x, position.y, position.z, 0, -1, 0, 0); } return; case 0x5177: this->render.unknown_00A4Bytes[1] = 1; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (this->render.enabled) { g_effectMgr->Spawn(this->render.accountId, 0x77F, position.x, position.y, position.z, 0, -1, 0, 0); } @@ -917,7 +917,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int } this->m_effectTimer = 36000; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (this->m_model != nullptr) { this->m_model->playback = 1; } @@ -939,7 +939,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int } this->render.enabled = 1; - this->sub_E55320(this->GetTrapModelName()); + this->ShowModel(this->GetTrapModelName()); if (this->GetEffectiveJob(-1) == 0x94 && !this->HasId(0x91)) { this->LaunchEffect(0x91, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } diff --git a/Source/Contents/Actors/Skill.h b/Source/Contents/Actors/Skill.h index 5e69e02b..53d0e765 100644 --- a/Source/Contents/Actors/Skill.h +++ b/Source/Contents/Actors/Skill.h @@ -21,8 +21,8 @@ public: void ReleaseModel(); void LaunchGroundEffects(int effectId, int unused, int duration); void Render(int argument) override; - void sub_E55100(const float* box, float x, float y); - void sub_E55320(const char* modelName); + void SetRenderInfo(const float* box, float x, float y); + void ShowModel(const char* modelName); /* 0410 */ int unknown_0410; /* 0414 */ unsigned m_effectTimer; diff --git a/Source/Contents/Configuration/ServiceConfiguration.cpp b/Source/Contents/Configuration/ServiceConfiguration.cpp index 4c8a0fc5..9de391a0 100644 --- a/Source/Contents/Configuration/ServiceConfiguration.cpp +++ b/Source/Contents/Configuration/ServiceConfiguration.cpp @@ -174,13 +174,13 @@ const char* GetLicenceText() { return text.c_str(); } -void sub_AD1270(); +void LoadEtcInfo(); void InitializeLanguage(); // OFFSET: 0x00ACFF90 // FUNCTION: fn_17808 void InitializeServiceStrings() { - sub_AD1270(); + LoadEtcInfo(); switch (g_serviceType) { case 0: @@ -329,7 +329,7 @@ void LoadLoadingScreens(int count) { // OFFSET: 0x00AD1270 // FUNCTION: fn_17810 -void sub_AD1270() { +void LoadEtcInfo() { if (ResourceExists("etcinfo.txt", 0)) { CCommonObject storage; g_loadingScreens.clear(); @@ -489,7 +489,7 @@ void InitializeLanguage() { // - Cases 2 and 3 and the code before the switch are fully intact and ported as they are. // OFFSET: 0x00AD1C90 // FUNCTION: fn_17817 -void sub_AD1C90() { +void InitializeServiceConfiguration() { const std::uint8_t portSource[] = {0xED, 0xBA, 0xF1, 0x3F, 0xAB}; g_servicePort = DecryptText<0xEB3D4FAB0FC183DBULL>(portSource); diff --git a/Source/Contents/Effects/BlastForge.cpp b/Source/Contents/Effects/BlastForge.cpp index b7267a6e..b7e9b740 100644 --- a/Source/Contents/Effects/BlastForge.cpp +++ b/Source/Contents/Effects/BlastForge.cpp @@ -20,7 +20,7 @@ CBlastForge::CBlastForge() : CEffect(-1), unknown_00DC(0), startTime(timeGetTime // OFFSET: 0x006F7660 // FUNCTION: fn_06860 -void CBlastForge::sub_6F7660() { +void CBlastForge::RestartBlastParticles() { if (this->unknown_00D4) { FreeParticle(this->unknown_00D4); this->unknown_00D4 = nullptr; @@ -67,7 +67,7 @@ void CBlastForge::Slot01() { this->unknown_00D0->m_loop = true; } - this->sub_6F7660(); + this->RestartBlastParticles(); } // OFFSET: 0x006F7A20 @@ -125,7 +125,7 @@ void CBlastForge::Slot03() { this->unknown_00D0->Process(0.0f, 0.0f, 0.0f); } - this->sub_6F7F80(); + this->ProcessBlastParticles(); } // OFFSET: 0x006F7EA0 @@ -150,7 +150,7 @@ void CBlastForge::Slot04() { // OFFSET: 0x006F7F80 // FUNCTION: fn_06866 -void CBlastForge::sub_6F7F80() { +void CBlastForge::ProcessBlastParticles() { if (this->unknown_00D4 && this->unknown_00D8) { if (this->unknown_00D4->life == 0.0f || static_cast(this->unknown_00D4->unknown_00E8) < this->unknown_00D4->life * 60.0f) { this->unknown_00D4->position.x = this->position[0]; @@ -207,6 +207,6 @@ void CBlastForge::sub_6F7F80() { const DWORD now = timeGetTime(); if (static_cast(now) - this->startTime >= 1000) { this->startTime = timeGetTime(); - this->sub_6F7660(); + this->RestartBlastParticles(); } } diff --git a/Source/Contents/Effects/BlastForge.h b/Source/Contents/Effects/BlastForge.h index 9a712d25..55767e0c 100644 --- a/Source/Contents/Effects/BlastForge.h +++ b/Source/Contents/Effects/BlastForge.h @@ -17,8 +17,8 @@ public: void Close() override; bool Slot06() override; - void sub_6F7660(); - void sub_6F7F80(); + void RestartBlastParticles(); + void ProcessBlastParticles(); /* 00CC */ CEZ2STRParticle* unknown_00CC; /* 00D0 */ CEZ2STRParticle* unknown_00D0; diff --git a/Source/Contents/Effects/CloudKillEffect.cpp b/Source/Contents/Effects/CloudKillEffect.cpp index d89c4fb2..39734768 100644 --- a/Source/Contents/Effects/CloudKillEffect.cpp +++ b/Source/Contents/Effects/CloudKillEffect.cpp @@ -182,13 +182,13 @@ void CCloudKillEffect::Slot03() { void CCloudKillEffect::Slot04() { for (auto it = this->particles.begin(); it != this->particles.end(); ++it) { if (*it) { - static_cast(*it)->sub_B40F30(1); + static_cast(*it)->Draw(1); } } for (auto it = this->sprites.begin(); it != this->sprites.end(); ++it) { if (*it) { - static_cast(*it)->sub_B40F30(1); + static_cast(*it)->Draw(1); } } } diff --git a/Source/Contents/Effects/HealEffect.cpp b/Source/Contents/Effects/HealEffect.cpp index 0c28f9e1..5974ce80 100644 --- a/Source/Contents/Effects/HealEffect.cpp +++ b/Source/Contents/Effects/HealEffect.cpp @@ -247,7 +247,7 @@ void CHealEffect::AddCone(int kind) { // OFFSET: 0x00B67F90 // FUNCTION: fn_19070 -void CHealEffect::sub_B67F90(CParticle* particle) { +void CHealEffect::UpdateParticleVertices(CParticle* particle) { if (!particle) { return; } @@ -279,7 +279,7 @@ void CHealEffect::sub_B67F90(CParticle* particle) { points[3].y = 0.0f; points[3].z = scale * g_sinTable[(angle + 270) % 360]; - this->sub_B69E30(points); + this->RotateToCamera(points); const float baseX = particle->unknown_00D0; const float baseY = particle->unknown_00D4; @@ -585,7 +585,7 @@ void CHealEffect::Slot03() { particle->unknown_00D4 -= particle->unknown_0054; particle->unknown_00D8 -= 0.0f; } - this->sub_B67F90(particle); + this->UpdateParticleVertices(particle); ++particle->unknown_00E8; } } @@ -634,7 +634,7 @@ void CHealEffect::Slot04() { // OFFSET: 0x00B69E30 // FUNCTION: fn_19078 -void CHealEffect::sub_B69E30(vector3d* points) { +void CHealEffect::RotateToCamera(vector3d* points) { const int yaw = 360 - static_cast(static_cast(g_modeMgr.GetGameMode())->camera->camera.yaw); const int pitch = (450 - static_cast(static_cast(g_modeMgr.GetGameMode())->camera->camera.pitch)) % 360; diff --git a/Source/Contents/Effects/HealEffect.h b/Source/Contents/Effects/HealEffect.h index d066d352..59a2c549 100644 --- a/Source/Contents/Effects/HealEffect.h +++ b/Source/Contents/Effects/HealEffect.h @@ -24,8 +24,8 @@ public: void AddColumn(int kind); void AddCone(int kind); void SpawnParticles(); - void sub_B67F90(CParticle* particle); - void sub_B69E30(vector3d* points); + void UpdateParticleVertices(CParticle* particle); + void RotateToCamera(vector3d* points); /* 00CC */ vector3d columnEdge[2]; /* 00E4 */ vector3d coneEdge[2]; diff --git a/Source/Contents/Effects/HealSpEffect.cpp b/Source/Contents/Effects/HealSpEffect.cpp index b6d2670f..c4780c1d 100644 --- a/Source/Contents/Effects/HealSpEffect.cpp +++ b/Source/Contents/Effects/HealSpEffect.cpp @@ -202,6 +202,6 @@ void CHealSp::Slot04() { } for (std::list::iterator it = this->sprites.begin(); it != this->sprites.end(); ++it) { - (*it)->sub_B40F30(1); + (*it)->Draw(1); } } diff --git a/Source/Contents/Effects/LightSphereEffect.cpp b/Source/Contents/Effects/LightSphereEffect.cpp index 4ac5e574..18c10d2b 100644 --- a/Source/Contents/Effects/LightSphereEffect.cpp +++ b/Source/Contents/Effects/LightSphereEffect.cpp @@ -18,7 +18,7 @@ CLightSphereEffect::CLightSphereEffect() : CEffect(-1), spheres(), rays() { // OFFSET: 0x00B6CB90 // FUNCTION: fn_19105 -void CLightSphereEffect::sub_B6CB90(int param) { +void CLightSphereEffect::CreateRayParticles(int param) { for (int c = 0; c < 4; ++c) { for (int i = 0; i < 80; ++i) { CParticle* particle = CreateParticle(reinterpret_cast(&this->position), 5); @@ -144,8 +144,8 @@ void CLightSphereEffect::Slot01() { } } - this->sub_B6CB90(0); - this->sub_B6CB90(1); + this->CreateRayParticles(0); + this->CreateRayParticles(1); } // OFFSET: 0x00B6D160 diff --git a/Source/Contents/Effects/LightSphereEffect.h b/Source/Contents/Effects/LightSphereEffect.h index 88993a0c..0edc7eb0 100644 --- a/Source/Contents/Effects/LightSphereEffect.h +++ b/Source/Contents/Effects/LightSphereEffect.h @@ -17,7 +17,7 @@ public: void Close() override; bool Slot06() override; - void sub_B6CB90(int param); + void CreateRayParticles(int param); /* 00CC */ std::vector spheres; /* 00D8 */ std::vector rays; diff --git a/Source/Contents/Effects/MapChainEffect.cpp b/Source/Contents/Effects/MapChainEffect.cpp index 01b26d7a..1e2d1d27 100644 --- a/Source/Contents/Effects/MapChainEffect.cpp +++ b/Source/Contents/Effects/MapChainEffect.cpp @@ -17,7 +17,7 @@ CMapChainEffect::CMapChainEffect() // OFFSET: 0x00B4AB90 // FUNCTION: fn_18947 -void CMapChainEffect::sub_B4AB90(int param) { +void CMapChainEffect::CreateChainParticles(int param) { int local8 = 0; for (int localC = 0; localC < 360; localC += 60, ++local8) { for (int i = 0; i < 21; ++i) { @@ -82,11 +82,11 @@ void CMapChainEffect::Close() { // OFFSET: 0x00B4AFE0 // FUNCTION: fn_18949 void CMapChainEffect::Slot01() { - this->sub_B4AB90(25); - this->sub_B4AB90(50); - this->sub_B4AB90(95); - this->sub_B4AB90(120); - this->sub_B4AB90(165); + this->CreateChainParticles(25); + this->CreateChainParticles(50); + this->CreateChainParticles(95); + this->CreateChainParticles(120); + this->CreateChainParticles(165); } // OFFSET: 0x00B4B0A0 diff --git a/Source/Contents/Effects/MapChainEffect.h b/Source/Contents/Effects/MapChainEffect.h index 4ed1369b..8386ddbb 100644 --- a/Source/Contents/Effects/MapChainEffect.h +++ b/Source/Contents/Effects/MapChainEffect.h @@ -27,7 +27,7 @@ public: bool Slot06() override; void Slot07() override; - void sub_B4AB90(int param); + void CreateChainParticles(int param); /* 00CC */ MapChainPoint corners[2]; /* 00E4 */ std::vector particles; diff --git a/Source/Contents/Effects/MeteorEffect.cpp b/Source/Contents/Effects/MeteorEffect.cpp index f8cb5bf9..6174c6cf 100644 --- a/Source/Contents/Effects/MeteorEffect.cpp +++ b/Source/Contents/Effects/MeteorEffect.cpp @@ -135,7 +135,7 @@ void CMeteorEffect::Slot04() { for (auto it = this->unknown_00CC.begin(); it != this->unknown_00CC.end(); ++it) { CParticle* particle = *it; if ((particle->life == 0.0f || particle->life * 60.0f > static_cast(particle->unknown_00E8)) && particle) { - static_cast(particle)->sub_B40F30(0); + static_cast(particle)->Draw(0); } } } diff --git a/Source/Contents/Effects/MonsterSkillEffects.cpp b/Source/Contents/Effects/MonsterSkillEffects.cpp index 885caebc..712d1088 100644 --- a/Source/Contents/Effects/MonsterSkillEffects.cpp +++ b/Source/Contents/Effects/MonsterSkillEffects.cpp @@ -129,7 +129,7 @@ void CRootTwistEffect::Slot03() { // FUNCTION: fn_07133 void CRootTwistEffect::Slot04() { for (auto emitter = this->emitters.begin(); emitter != this->emitters.end(); ++emitter) { - AsSprite(*emitter)->sub_B40F30(1); + AsSprite(*emitter)->Draw(1); } } @@ -209,7 +209,7 @@ void CSprArrowEffect::Slot03() { // FUNCTION: fn_07139 void CSprArrowEffect::Slot04() { if (this->unknown_00CC != 0 && this->unknown_00FC) { - AsSprite(reinterpret_cast(this->unknown_00CC))->sub_B40F30(1); + AsSprite(reinterpret_cast(this->unknown_00CC))->Draw(1); } } @@ -366,7 +366,7 @@ void CSpriteMableEffect::Slot04() { } for (auto emitter = this->emitters.begin(); emitter != this->emitters.end(); ++emitter) { - AsSprite(*emitter)->sub_B40F30(1); + AsSprite(*emitter)->Draw(1); } } @@ -474,7 +474,7 @@ void CStemSpearEffect::Slot03() { void CStemSpearEffect::Slot04() { for (auto emitter = this->emitters.begin(); emitter != this->emitters.end(); ++emitter) { if ((*emitter)->elapsed > 0 && (*emitter)->elapsed < this->unknown_002C) { - AsSprite(*emitter)->sub_B40F30(1); + AsSprite(*emitter)->Draw(1); } } } @@ -518,7 +518,7 @@ void CSvgSpiritEffect::Slot03() { void CSvgSpiritEffect::Slot04() { EZ2STREmitter* emitter = this->emitter; if (emitter->elapsed > 0 && emitter->elapsed < this->unknown_002C) { - AsSprite(emitter)->sub_B40F30(1); + AsSprite(emitter)->Draw(1); } } @@ -537,7 +537,7 @@ bool CTunaPartyEffect::Slot06() { // FUNCTION: fn_07169 void CTunaPartyEffect::Slot04() { for (auto emitter = this->emitters.begin(); emitter != this->emitters.end(); ++emitter) { - AsSprite(*emitter)->sub_B40F30(1); + AsSprite(*emitter)->Draw(1); } } diff --git a/Source/Contents/Effects/PartyMemberEffects.cpp b/Source/Contents/Effects/PartyMemberEffects.cpp index 1d793fe5..d270a6fd 100644 --- a/Source/Contents/Effects/PartyMemberEffects.cpp +++ b/Source/Contents/Effects/PartyMemberEffects.cpp @@ -57,7 +57,7 @@ int CRollingCutterRagEffect::GetDuration() { // OFFSET: 0x00612010 // FUNCTION: fn_04339 -int sub_612010() { +int GetDefaultStateFlags() { return 0; } diff --git a/Source/Contents/Effects/PowderingEffect.cpp b/Source/Contents/Effects/PowderingEffect.cpp index fe852ffa..fa8aea63 100644 --- a/Source/Contents/Effects/PowderingEffect.cpp +++ b/Source/Contents/Effects/PowderingEffect.cpp @@ -72,7 +72,7 @@ void CPowderingEffect::Slot01() { particle->unknown_00D0 = static_cast(r1Final); particle->unknown_00D8 = static_cast(r2Final); - this->sub_7096B0(particle); + this->InitSmokeParticle(particle); InitParticleQuad(particle->vertices); this->smokeParticles.push_back(particle); } @@ -93,7 +93,7 @@ void CPowderingEffect::Slot01() { particle->SetSprite("이팩트\\particle2.spr"); particle->SetAction("이팩트\\particle2.act"); - this->sub_709570(particle); + this->InitSpriteParticle(particle); InitParticleQuad(particle->vertices); this->spriteParticles.push_back(particle); } @@ -101,7 +101,7 @@ void CPowderingEffect::Slot01() { // OFFSET: 0x00709570 // FUNCTION: fn_07090 -void CPowderingEffect::sub_709570(CParticle* particle) { +void CPowderingEffect::InitSpriteParticle(CParticle* particle) { CSpriteParticle* spriteParticle = static_cast(particle); const int span1 = this->unknown_00E4 * 5; @@ -141,7 +141,7 @@ void CPowderingEffect::Slot12() { // OFFSET: 0x007096B0 // FUNCTION: fn_07092 -void CPowderingEffect::sub_7096B0(CParticle* particle) { +void CPowderingEffect::InitSmokeParticle(CParticle* particle) { const int r1 = rand() % 50; particle->scale = 0.0f; const int r2 = rand() % 21; @@ -210,7 +210,7 @@ void CPowderingEffect::Slot03() { if (alpha < 0) { if (this->ActorExists()) { particle->unknown_00A8 = 0; - this->sub_7096B0(particle); + this->InitSmokeParticle(particle); continue; } else { alpha = 0; @@ -257,7 +257,7 @@ void CPowderingEffect::Slot03() { if (alpha < 0) { if (this->ActorExists()) { particle->unknown_00A8 = 0; - this->sub_709570(particle); + this->InitSpriteParticle(particle); continue; } else { alpha = 0; @@ -290,7 +290,7 @@ void CPowderingEffect::Slot04() { for (auto it = this->spriteParticles.begin(); it != this->spriteParticles.end(); ++it) { CSpriteParticle* particle = *it; if (particle && particle->unknown_00A8 != 2) { - particle->sub_B40F30(1); + particle->Draw(1); } } } diff --git a/Source/Contents/Effects/PowderingEffect.h b/Source/Contents/Effects/PowderingEffect.h index e94d1bba..1d67bc83 100644 --- a/Source/Contents/Effects/PowderingEffect.h +++ b/Source/Contents/Effects/PowderingEffect.h @@ -20,8 +20,8 @@ public: bool Slot06() override; void Slot12() override; - void sub_709570(CParticle* particle); - void sub_7096B0(CParticle* particle); + void InitSpriteParticle(CParticle* particle); + void InitSmokeParticle(CParticle* particle); /* 00CC */ std::vector smokeParticles; /* 00D8 */ std::vector spriteParticles; diff --git a/Source/Contents/Effects/RagEffect.cpp b/Source/Contents/Effects/RagEffect.cpp index 1baa2e3e..8f8be1ac 100644 --- a/Source/Contents/Effects/RagEffect.cpp +++ b/Source/Contents/Effects/RagEffect.cpp @@ -10274,7 +10274,7 @@ bool CRagEffect::Slot14() { } break; case 307: - this->sub_C51740("effect\\cloud11.tga", 0); + this->ForestLight("effect\\cloud11.tga", 0); break; case 308: this->ThrowItem("유저인터페이스\\item\\돌.bmp", 2); @@ -10329,13 +10329,13 @@ bool CRagEffect::Slot14() { this->AlphaDownRipples("effect\\ring_blue.tga", 0); break; case 322: - this->sub_C51740("effect\\cloud11.tga", 1); + this->ForestLight("effect\\cloud11.tga", 1); break; case 323: - this->sub_C51740("effect\\cloud11.tga", 2); + this->ForestLight("effect\\cloud11.tga", 2); break; case 324: - this->sub_C51740("effect\\cloud11.tga", 10); + this->ForestLight("effect\\cloud11.tga", 10); break; case 325: this->HealRingSparkle("effect\\ring_white.tga", 1); @@ -10362,7 +10362,7 @@ bool CRagEffect::Slot14() { this->TexturedRisingOrbs("effect\\white02.bmp", 1); break; case 333: - this->sub_C5CC00(); + this->Maple(); break; case 334: this->BLIND(0); @@ -14641,7 +14641,7 @@ void CRagEffect::QuadRingStackSized(const char* name, char kind) { // OFFSET: 0x00C649E0 // FUNCTION: fn_20263 -void CRagEffect::sub_C649E0() { +void CRagEffect::Sakura() { this->render.position = this->state.parent->render.position; if (this->state.stateCnt == 99999998) { @@ -14676,7 +14676,7 @@ void CRagEffect::sub_C649E0() { // OFFSET: 0x00C47F70 // FUNCTION: fn_20161 -void CRagEffect::sub_C47F70(char flag) { +void CRagEffect::CHIMTO(char flag) { this->render.position = this->state.parent->render.position; if (this->state.stateCnt != 0) { @@ -14761,7 +14761,7 @@ void CRagEffect::sub_C47F70(char flag) { // OFFSET: 0x00C66F60 // FUNCTION: fn_20277 -void CRagEffect::sub_C66F60() { +void CRagEffect::TANJI() { this->render.position = this->state.parent->render.position; if (this->state.stateCnt != 0) { @@ -14806,7 +14806,7 @@ void CRagEffect::sub_C66F60() { // OFFSET: 0x00C54420 // FUNCTION: fn_20197 -void CRagEffect::sub_C54420() { +void CRagEffect::Gravitation() { if (this->state.stateCnt != 0) { return; } @@ -14853,7 +14853,7 @@ void CRagEffect::sub_C54420() { // OFFSET: 0x00C51740 // FUNCTION: fn_20189 -void CRagEffect::sub_C51740(const char* name, char flag) { +void CRagEffect::ForestLight(const char* name, char flag) { if (this->state.stateCnt != 0) { return; } @@ -17550,7 +17550,7 @@ void CRagEffect::TexturedGroundRing(const char* name, char flag, int unused1, in // OFFSET: 0x00C5CC00 // FUNCTION: fn_20230 -void CRagEffect::sub_C5CC00() { +void CRagEffect::Maple() { this->render.position = this->state.parent->render.position; if (this->state.stateCnt == 99999998) { @@ -20121,7 +20121,7 @@ bool CRagEffect::Slot15() { if (this->state.stateCnt == 1) { g_soundMgr->PlayWave("effect\\dimension.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } - this->sub_C51740("effect\\cloud11.tga", 13); + this->ForestLight("effect\\cloud11.tga", 13); this->TexturedHalo("effect\\구체15.bmp", 4); this->WhiteRingRipple(0); break; @@ -20857,7 +20857,7 @@ bool CRagEffect::Slot15() { ); } } - this->sub_C47F70(12); + this->CHIMTO(12); break; case 726: if (this->state.stateCnt == 10) { @@ -20916,7 +20916,7 @@ bool CRagEffect::Slot15() { this->SonicWave(1); break; case 719: - this->sub_C51740("effect\\cloud11.tga", 12); + this->ForestLight("effect\\cloud11.tga", 12); break; case 718: this->RingStack(1); @@ -21423,10 +21423,10 @@ bool CRagEffect::Slot15() { this->TexturedAura("effect\\failed.bmp", 3); break; case 606: - this->sub_C47F70(2); + this->CHIMTO(2); break; case 607: - this->sub_C47F70(1); + this->CHIMTO(1); break; case 604: this->NpcStop(2); @@ -21637,7 +21637,7 @@ bool CRagEffect::Slot15() { this->TexturedAura("effect\\Tarot14.tga", 1); break; case 522: - this->sub_C54420(); + this->Gravitation(); break; case 521: if (this->state.stateCnt >= 10 && this->state.stateCnt <= 50) { @@ -22083,7 +22083,7 @@ bool CRagEffect::Slot15() { this->TexturedClassChange(6); break; case 581: - this->sub_C51740("effect\\cloud11.tga", 11); + this->ForestLight("effect\\cloud11.tga", 11); break; case 583: this->TexturedClassChange(7); @@ -24328,7 +24328,7 @@ bool CRagEffect::OnProcess() { this->Snow(); break; case 163: - this->sub_C649E0(); + this->Sakura(); break; case 164: this->StatusIconColumn(); @@ -24725,7 +24725,7 @@ bool CRagEffect::OnProcess() { } break; case 265: - this->sub_C66F60(); + this->TANJI(); break; case 266: for (int index = 0; index < 24; ++index) { @@ -24733,7 +24733,7 @@ bool CRagEffect::OnProcess() { } break; case 267: - this->sub_C47F70(0); + this->CHIMTO(0); break; case 269: case 270: diff --git a/Source/Contents/Effects/RagEffect.h b/Source/Contents/Effects/RagEffect.h index 0638bc5d..6d80720c 100644 --- a/Source/Contents/Effects/RagEffect.h +++ b/Source/Contents/Effects/RagEffect.h @@ -315,12 +315,12 @@ struct CRagEffect : CRenderObject { void Detoxication(); void PoisonAttack(char flag); __declspec(noinline) void StoneSpike(); - void sub_C5CC00(); - void sub_C649E0(); - void sub_C47F70(char flag); - void sub_C66F60(); - void sub_C54420(); - __declspec(noinline) void sub_C51740(const char* name, char flag); + void Maple(); + void Sakura(); + void CHIMTO(char flag); + void TANJI(); + void Gravitation(); + __declspec(noinline) void ForestLight(const char* name, char flag); void SandScatter(); void Sight(); void AlphaCenterRise(); diff --git a/Source/Contents/Effects/ScatterEffect.cpp b/Source/Contents/Effects/ScatterEffect.cpp index 5d3088c4..3dc5156e 100644 --- a/Source/Contents/Effects/ScatterEffect.cpp +++ b/Source/Contents/Effects/ScatterEffect.cpp @@ -94,7 +94,7 @@ void CScatterEffect::Slot03() { void CScatterEffect::Slot04() { for (auto it = this->particles.begin(); it != this->particles.end(); ++it) { if (*it) { - (*it)->sub_B40F30(1); + (*it)->Draw(1); } } } diff --git a/Source/Contents/Effects/SmokeEffect.cpp b/Source/Contents/Effects/SmokeEffect.cpp index 98197a97..2a82b80a 100644 --- a/Source/Contents/Effects/SmokeEffect.cpp +++ b/Source/Contents/Effects/SmokeEffect.cpp @@ -97,7 +97,7 @@ void CSmokeEffect::Slot03() { void CSmokeEffect::Slot04() { for (auto it = this->particles.begin(); it != this->particles.end(); ++it) { if (*it && (*it)->unknown_000C < this->visibleCount) { - (*it)->sub_B40F30(1); + (*it)->Draw(1); } } } diff --git a/Source/Contents/Effects/SpriteEffect.cpp b/Source/Contents/Effects/SpriteEffect.cpp index 1c75557e..71149cfc 100644 --- a/Source/Contents/Effects/SpriteEffect.cpp +++ b/Source/Contents/Effects/SpriteEffect.cpp @@ -385,7 +385,7 @@ void CSpriteEffect::Slot04() { for (auto it = this->particles.begin(); it != this->particles.end(); ++it) { CSpriteParticle* particle = *it; if (particle->unknown_00E8 > 0) { - particle->sub_B40F30(1); + particle->Draw(1); } } } diff --git a/Source/Contents/Effects/SpriteParticle.cpp b/Source/Contents/Effects/SpriteParticle.cpp index 59de60de..f7f26879 100644 --- a/Source/Contents/Effects/SpriteParticle.cpp +++ b/Source/Contents/Effects/SpriteParticle.cpp @@ -89,7 +89,7 @@ void CSpriteParticle::UpdateFrame() { // OFFSET: 0x00B40F30 // FUNCTION: fn_18865 -void CSpriteParticle::sub_B40F30(char mode) { +void CSpriteParticle::Draw(char mode) { if (mode == 1) { this->UpdateFrame(); } diff --git a/Source/Contents/Effects/SpriteParticle.h b/Source/Contents/Effects/SpriteParticle.h index 627fe4e5..0d86759e 100644 --- a/Source/Contents/Effects/SpriteParticle.h +++ b/Source/Contents/Effects/SpriteParticle.h @@ -15,7 +15,7 @@ public: void UpdateFrame(); void SetAction(const char* name); void SetSprite(const char* name); - void sub_B40F30(char mode); + void Draw(char mode); /* 02BC */ unsigned char unknown_02BC; /* 02BD */ unsigned char unknown_02BD; diff --git a/Source/Contents/Effects/StealEffect.cpp b/Source/Contents/Effects/StealEffect.cpp index c21d9ab7..1f9c303d 100644 --- a/Source/Contents/Effects/StealEffect.cpp +++ b/Source/Contents/Effects/StealEffect.cpp @@ -149,6 +149,6 @@ void CSteal::Slot03() { // FUNCTION: fn_18975 void CSteal::Slot04() { for (std::list::iterator it = this->particles.begin(); it != this->particles.end(); ++it) { - (*it)->sub_B40F30(1); + (*it)->Draw(1); } } diff --git a/Source/Contents/EnchantMgr.cpp b/Source/Contents/EnchantMgr.cpp index 225bb56c..458eef1f 100644 --- a/Source/Contents/EnchantMgr.cpp +++ b/Source/Contents/EnchantMgr.cpp @@ -83,7 +83,7 @@ void CEnchantMgr::OpenEnchant(uint64_t group) { } else { CUIEnchantUI* window = static_cast(g_windowMgr.EnsureWindow(10006)); if (window) { - window->sub_A06C40(group); + window->SetEnchantGroup(group); this->m_unknown_0030 = false; } } diff --git a/Source/Contents/Items/ItemNaming.cpp b/Source/Contents/Items/ItemNaming.cpp index 77ca754e..af13ae6e 100644 --- a/Source/Contents/Items/ItemNaming.cpp +++ b/Source/Contents/Items/ItemNaming.cpp @@ -549,7 +549,7 @@ ItemMoveInfo& FindItemMoveInfo(int id) { // OFFSET: 0x006D5150 // FUNCTION: fn_06567 -void __fastcall sub_6D5150(std::uint16_t* value) { +void __fastcall DestroyReplayTaggedRecordHeader(std::uint16_t* value) { *value = 0; *reinterpret_cast(value + 1) = 0; } diff --git a/Source/Contents/TipBoxTitles.cpp b/Source/Contents/TipBoxTitles.cpp index b13dbd53..be00694c 100644 --- a/Source/Contents/TipBoxTitles.cpp +++ b/Source/Contents/TipBoxTitles.cpp @@ -306,11 +306,11 @@ inline void CTipBoxMgr::AddTip(int id, std::string title, double flag, std::stri this->m_entries[id].unknown_001C = text; } -int sub_7AEC00(lua_State* state); -int sub_7AE900(lua_State* state); -int sub_7AE600(lua_State* state); -int sub_7AEAF0(lua_State* state); -int sub_7AEA20(lua_State* state); +int AddTip(lua_State* state); +int AddImgcoord(lua_State* state); +int AddPageEx(lua_State* state); +int AddPage(lua_State* state); +int AddIsTag(lua_State* state); // OFFSET: 0x007AD480 // FUNCTION: fn_09129 @@ -321,11 +321,11 @@ bool CTipBoxMgr::RegisterLuaFunctions() { } luaL_openlibs(state.GetState()); - lua_register(state.GetState(), "AddTip", sub_7AEC00); - lua_register(state.GetState(), "AddImgcoord", sub_7AE900); - lua_register(state.GetState(), "AddPageEx", sub_7AE600); - lua_register(state.GetState(), "AddPage", sub_7AEAF0); - lua_register(state.GetState(), "AddIsTag", sub_7AEA20); + lua_register(state.GetState(), "AddTip", ::AddTip); + lua_register(state.GetState(), "AddImgcoord", AddImgcoord); + lua_register(state.GetState(), "AddPageEx", AddPageEx); + lua_register(state.GetState(), "AddPage", AddPage); + lua_register(state.GetState(), "AddIsTag", AddIsTag); const char source[] = {'\xF4', '\xCA', '\x76', '\xBD', '\xC0', '\x0E', '\xB7', '\x7F', '\xCE', '\xC3', '\x67', '\xA6', '\xDD', '\x4D', '\x87', '\x7E', '\xC6', '\xB3'}; @@ -421,7 +421,7 @@ void CTipBoxMgr::SelectTip(int id) { // OFFSET: 0x007AEAF0 // FUNCTION: fn_09145 -int sub_7AEAF0(lua_State* state) { +int AddPage(lua_State* state) { if (!lua_isnumber(state, -2)) { lua_pushboolean(state, 0); lua_pushstring(state, "2st argment is must number"); @@ -444,7 +444,7 @@ int sub_7AEAF0(lua_State* state) { // OFFSET: 0x007AE900 // FUNCTION: fn_09143 -int sub_7AE900(lua_State* state) { +int AddImgcoord(lua_State* state) { if (!lua_isnumber(state, -1)) { lua_pushboolean(state, 0); lua_pushstring(state, "3nd argment is must number"); return 2; } if (!lua_isnumber(state, -2)) { lua_pushboolean(state, 0); lua_pushstring(state, "2nd argment is must number"); return 2; } if (!lua_isnumber(state, -3)) { lua_pushboolean(state, 0); lua_pushstring(state, "1st argment is must number"); return 2; } @@ -460,7 +460,7 @@ int sub_7AE900(lua_State* state) { // OFFSET: 0x007AEA20 // FUNCTION: fn_09144 -int sub_7AEA20(lua_State* state) { +int AddIsTag(lua_State* state) { if (!lua_isnumber(state, -2)) { lua_pushboolean(state, 0); lua_pushstring(state, "2 argment is must number"); return 2; } if (!lua_isnumber(state, -1)) { lua_pushboolean(state, 0); lua_pushstring(state, "1 argment is must number"); return 2; } @@ -473,7 +473,7 @@ int sub_7AEA20(lua_State* state) { // OFFSET: 0x007AEC00 // FUNCTION: fn_09146 -int sub_7AEC00(lua_State* state) { +int AddTip(lua_State* state) { if (!lua_isstring(state, -1)) { lua_pushboolean(state, 0); lua_pushstring(state, "4th argment is must string"); @@ -507,7 +507,7 @@ int sub_7AEC00(lua_State* state) { // OFFSET: 0x007AE600 // FUNCTION: fn_09142 -int sub_7AE600(lua_State* state) { +int AddPageEx(lua_State* state) { if (!lua_isnumber(state, -1)) { lua_pushboolean(state, 0); lua_pushstring(state, "8nd argment is must number"); diff --git a/Source/Script/NLuaState.cpp b/Source/Script/NLuaState.cpp index 6b8f8ece..aaccf175 100644 --- a/Source/Script/NLuaState.cpp +++ b/Source/Script/NLuaState.cpp @@ -51,7 +51,7 @@ void TreeSubMap::Clear() noexcept { // OFFSET: 0x00CA4B60 // FUNCTION: fn_20940 -void* sub_CA4B60() { +void* GetEntryQueueMgr() { return g_entryQueueMgr; } diff --git a/Source/Security/NProtectGameGuardMgr.cpp b/Source/Security/NProtectGameGuardMgr.cpp index 50280fc9..541a20c0 100644 --- a/Source/Security/NProtectGameGuardMgr.cpp +++ b/Source/Security/NProtectGameGuardMgr.cpp @@ -23,13 +23,13 @@ static const char g_devClientTag[] = "Dev"; static const char g_nprotectSource[] = "C:\\repositories\\RagnarokClient\\RagnarokClient\\Security Solution\\nProtectGameGuard\\CNProtectGameGuardMgr.cpp"; -void sub_E92420(); -void sub_E929B0(const char* name); -int sub_E92820(); -int __stdcall sub_76D910(int code, const int* packet); -void sub_E92E90(int(__stdcall* callback)(int, const int*)); +void CloseNPGameMon(); +void PreInitNPGameMonA(const char* name); +int InitNPGameMon(); +int __stdcall GameGuardCallback(int code, const int* packet); +void SetCallbackToGameMon(int(__stdcall* callback)(int, const int*)); void WriteMyLog(const char* file, int line, const char* format, ...); -void __fastcall sub_76C320(void* tokens); +void __fastcall DestroyAuthTokenVector(void* tokens); namespace { template @@ -181,7 +181,7 @@ void CNProtectGameGuardMgr::Send(const char*) { // OFFSET: 0x0076D910 // FUNCTION: fn_08219 -int __stdcall sub_76D910(int code, const int* packet) { +int __stdcall GameGuardCallback(int code, const int* packet) { switch (code) { case 0x3E9: case 0x3EA: { @@ -229,17 +229,17 @@ int __stdcall sub_76D910(int code, const int* packet) { // OFFSET: 0x0076C9D0 // FUNCTION: fn_08209 -int CNProtectGameGuardMgr::sub_76C9D0() { +int CNProtectGameGuardMgr::Initialize() { void* created = ::operator new(1, std::nothrow); if (created != nullptr) { - sub_E929B0(GameName()); + PreInitNPGameMonA(GameName()); } this->m_gameLib = created; if (created == nullptr) { return 0; } - const int status = sub_E92820(); + const int status = InitNPGameMon(); if (status != 0x755) { char message[0x400]; char title[0x100]; @@ -260,6 +260,6 @@ int CNProtectGameGuardMgr::sub_76C9D0() { WriteMyLog(g_nprotectSource, 0x284, title); } - sub_E92E90(sub_76D910); + SetCallbackToGameMon(GameGuardCallback); return 1; } diff --git a/Source/Security/NProtectGameGuardMgr.h b/Source/Security/NProtectGameGuardMgr.h index 277c4555..86964d26 100644 --- a/Source/Security/NProtectGameGuardMgr.h +++ b/Source/Security/NProtectGameGuardMgr.h @@ -33,8 +33,8 @@ public: int HasError(); std::string ErrorMessage(); void SetHwnd(HWND window); - void sub_76C4C0(unsigned char flags); - int sub_76C9D0(); + void ScalarDeletingDestructor(unsigned char flags); + int Initialize(); void IncrementCounter(); void SetError(const char* file, int line, std::string message); void Send(const char* text); diff --git a/Source/UI/Enchant/EnchantUI.h b/Source/UI/Enchant/EnchantUI.h index 79dbfa00..83818355 100644 --- a/Source/UI/Enchant/EnchantUI.h +++ b/Source/UI/Enchant/EnchantUI.h @@ -50,7 +50,7 @@ public: void Slot16() override; void Slot25(int x, int y) override; virtual void Slot53(); - void sub_A06C40(uint64_t group); + void SetEnchantGroup(uint64_t group); void OnSelectTarget(EnchantUI::CUITargetItem* item, const ITEM_INFO& info); void OnClickClose(); }; diff --git a/Source/UI/Enchant/UIEnchantUI.cpp b/Source/UI/Enchant/UIEnchantUI.cpp index dcd40dbe..941e9d0a 100644 --- a/Source/UI/Enchant/UIEnchantUI.cpp +++ b/Source/UI/Enchant/UIEnchantUI.cpp @@ -1316,7 +1316,7 @@ void CUIEnchantUI::OnSelectTarget(EnchantUI::CUITargetItem* item, const ITEM_INF // OFFSET: 0x00A06C40 // FUNCTION: fn_15008 -void CUIEnchantUI::sub_A06C40(uint64_t group) { +void CUIEnchantUI::SetEnchantGroup(uint64_t group) { this->enchantInfo = CEnchantMgr::GetInstance()->GetEnchantInfo(group); if (!this->enchantInfo) { g_windowMgr.CloseWindow(0x2716); diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index 29f0f74d..06c0e79d 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -167,7 +167,7 @@ int UIListBoxAgitMenu::SendMsg(UIWindow* sender, int message, std::intptr_t a, s UIAgitMessageBox* box = new UIAgitMessageBox(); const char* text = FormatString(LookupMessage(3631), agitName, costZeny, costGuildPoint); - box->sub_956130(text, 310, 130); + box->InitializeMessageBox(text, 310, 130); int x = g_renderer->viewport.centerX - box->geometry.width / 2; int y = g_renderer->viewport.centerY - box->geometry.height / 2; diff --git a/Source/UI/Guild/UIAgitWnd.h b/Source/UI/Guild/UIAgitWnd.h index 4ced57ad..15385ff6 100644 --- a/Source/UI/Guild/UIAgitWnd.h +++ b/Source/UI/Guild/UIAgitWnd.h @@ -11,7 +11,7 @@ public: UIAgitMessageBox(); void Paint() override; int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; - void sub_956130(const char* text, int width, int height); + void InitializeMessageBox(const char* text, int width, int height); /* 00B4 */ std::uint16_t m_agitId; }; diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index a180aeff..ef4732d4 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -1793,7 +1793,7 @@ void UIGuildMemberManageWnd::Slot15(int, int) { // OFFSET: 0x00956130 // FUNCTION: fn_13036 -void UIAgitMessageBox::sub_956130(const char* text, int width, int height) { +void UIAgitMessageBox::InitializeMessageBox(const char* text, int width, int height) { this->SetSize(width, height); this->Slot15(width, height); this->Slot22(width, height); diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index 2e55444b..0a74887b 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -85,12 +85,12 @@ void UIChangeMaterialWnd_List::CreateScrollBar(int width, int height) { this->m_scrollBar->Show(0); this->AddChild(this->m_scrollBar); this->m_pageSize = height / this->unknown_00B4; - this->sub_5E2A70(); + this->UpdateScrollBar(); } // OFFSET: 0x005E1080 // FUNCTION: fn_03871 -void UIChangeMaterialWnd_List::sub_5E1080(int delta) { +void UIChangeMaterialWnd_List::SelectNextItem(int delta) { int64_t newIndex = this->m_selectedIndex + delta; const int count = static_cast(this->m_items.size()); const int maxIndex = count - 1; @@ -109,11 +109,11 @@ void UIChangeMaterialWnd_List::sub_5E1080(int delta) { } this->m_scrollOffset = newOffset; - this->sub_5E2A70(); + this->UpdateScrollBar(); this->m_previousScrollOffset = this->m_scrollOffset; } - this->sub_5E3B80(targetIndex); + this->SetSelectedIndex(targetIndex); } // OFFSET: 0x005E1120 @@ -146,12 +146,12 @@ void UIChangeMaterialWnd_List::Move(int x, int y) { // OFFSET: 0x005E2590 // FUNCTION: fn_03883 -void UIChangeMaterialWnd_List::sub_5E2590(int, int position) { +void UIChangeMaterialWnd_List::SelectItemAtPosition(int, int position) { const int rowHeight = this->unknown_00B4; const unsigned int last = static_cast(this->m_items.size() - 1); unsigned int index = static_cast(position / rowHeight + this->m_scrollOffset); index = std::min(index, last); - this->sub_5E3B80(static_cast(index)); + this->SetSelectedIndex(static_cast(index)); } // OFFSET: 0x005E25D0 @@ -216,7 +216,7 @@ void UIChangeMaterialWnd_List::Slot35(int argument) { // OFFSET: 0x005E2A70 // FUNCTION: fn_03890 -void UIChangeMaterialWnd_List::sub_5E2A70() { +void UIChangeMaterialWnd_List::UpdateScrollBar() { const int count = static_cast(this->m_items.size()); if (count > this->m_pageSize) { this->m_scrollBar->Show(1); @@ -260,7 +260,7 @@ void UIChangeMaterialWnd_List::ApplyFilter(std::string text) { } } - this->sub_5E2A70(); + this->UpdateScrollBar(); this->SortItems(true); } @@ -310,12 +310,12 @@ void UIChangeMaterialWnd_List::RefreshVisibleEntries() { } this->ApplyFilter(std::string()); - this->sub_5E3B80(0); + this->SetSelectedIndex(0); } // OFFSET: 0x005E39A0 // FUNCTION: fn_03893 -void UIChangeMaterialWnd::sub_5E39A0() { +void UIChangeMaterialWnd::SendChangeMaterial() { const std::int16_t count = static_cast(this->m_materials.size()); const int length = count * 4 + 0xC; auto* packet = static_cast(STACK_ALLOC(static_cast(length))); @@ -345,7 +345,7 @@ void UIChangeMaterialWnd::sub_5E39A0() { // OFFSET: 0x005E3B80 // FUNCTION: fn_03894 -void UIChangeMaterialWnd_List::sub_5E3B80(int index) { +void UIChangeMaterialWnd_List::SetSelectedIndex(int index) { this->m_selectedIndex = index; this->m_previousScrollOffset = this->m_scrollOffset; this->Invalidate(); @@ -366,7 +366,7 @@ int UIChangeMaterialWnd::SendMsg( case 6: switch (argument1) { case 0xb8: - this->sub_5E39A0(); + this->SendChangeMaterial(); break; case 0xc9: g_windowMgr.CloseWindow(0x158); @@ -448,13 +448,13 @@ int UIChangeMaterialWnd_List::SendMsg( this->ShiftSelectedIndex(1); break; case 0x13: - this->sub_5E1080(1); + this->SelectNextItem(1); break; case 3: this->ShiftSelectedIndex(this->m_pageSize); break; case 4: - this->sub_5E1080(this->m_pageSize); + this->SelectNextItem(this->m_pageSize); break; case 7: case 9: @@ -468,7 +468,7 @@ int UIChangeMaterialWnd_List::SendMsg( } this->m_scrollOffset = previous + delta; if (previous != this->m_scrollOffset) { - this->sub_5E2A70(); + this->UpdateScrollBar(); } return this->m_scrollOffset - previous; } @@ -511,10 +511,10 @@ void UIChangeMaterialWnd_List::ShiftSelectedIndex(int value) { } this->m_scrollOffset = newOffset; - this->sub_5E2A70(); + this->UpdateScrollBar(); } - this->sub_5E3B80(index); + this->SetSelectedIndex(index); } // OFFSET: 0x005E1C00 diff --git a/Source/UI/UIChangeMaterialWnd.h b/Source/UI/UIChangeMaterialWnd.h index 4bb8d6dc..910776c7 100644 --- a/Source/UI/UIChangeMaterialWnd.h +++ b/Source/UI/UIChangeMaterialWnd.h @@ -75,7 +75,7 @@ public: void Slot28(int x, int y) override; void Slot32(int x, int y) override; ITEM_INFO* GetItemAt(int x, int y); - void sub_5E39A0(); + void SendChangeMaterial(); void UpdateSearchPlaceholder(); int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; @@ -108,10 +108,10 @@ public: void ApplyFilter(std::string text); void SortItems(bool ascending); void RefreshVisibleEntries(); - void sub_5E2A70(); - void sub_5E3B80(int index); - void sub_5E2590(int unknown, int position); - void sub_5E1080(int delta); + void UpdateScrollBar(); + void SetSelectedIndex(int index); + void SelectItemAtPosition(int unknown, int position); + void SelectNextItem(int delta); void ShiftSelectedIndex(int value); void CreateScrollBar(int width, int height); const MaterialListEntry* GetEntry(unsigned int index) const; diff --git a/Source/UI/Window/UINewMakeCharWnd.cpp b/Source/UI/Window/UINewMakeCharWnd.cpp index 40b5bd36..52ca8526 100644 --- a/Source/UI/Window/UINewMakeCharWnd.cpp +++ b/Source/UI/Window/UINewMakeCharWnd.cpp @@ -307,7 +307,7 @@ void UIHairStyleButton::Slot15(int width, int height) { // OFFSET: 0x007DBFD0 // FUNCTION: fn_09626 -void UINewMakeCharWnd::sub_7DBFD0() { +void UINewMakeCharWnd::UpdatePreviewResources() { const std::string bodyAct = GetBodyActionResourceName(this->m_job, this->m_sex, this->m_job, 0); this->m_raceActions[0].assign(bodyAct); @@ -641,7 +641,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } else if (this->m_race == 1) { this->m_job = 0x107A; } - this->sub_7DBFD0(); + this->UpdatePreviewResources(); } } return 0; @@ -655,7 +655,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum if (this->m_headPalette < 0) { this->m_headPalette = 8; } - this->sub_7DBFD0(); + this->UpdatePreviewResources(); } else { this->m_hairColorButtons[index]->SendMsg(this, 13, 0, 0, 0, 0); } @@ -694,7 +694,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum if (this->m_head < 0) { this->m_head = 0; } - this->sub_7DBFD0(); + this->UpdatePreviewResources(); } else { this->m_hairStyleButtons[index]->SendMsg(this, 13, 0, 0, 0, 0); } @@ -725,7 +725,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum this->m_hairStyleButtons[index]->m_sex = this->m_sex; this->m_hairStyleButtons[index]->SendMsg(nullptr, 0x28, 0, 0, 0, 0); } - this->sub_7DBFD0(); + this->UpdatePreviewResources(); return 0; } diff --git a/Source/UI/Window/UINewMakeCharWnd.h b/Source/UI/Window/UINewMakeCharWnd.h index bb0b812d..36575354 100644 --- a/Source/UI/Window/UINewMakeCharWnd.h +++ b/Source/UI/Window/UINewMakeCharWnd.h @@ -71,7 +71,7 @@ public: void Slot15(int width, int height) override; void Paint() override; void Slot19() override; - void sub_7DBFD0(); + void UpdatePreviewResources(); int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; /* 00B4 */ int m_viewX; diff --git a/Source/UI/Window/UINewSelectCharWnd.cpp b/Source/UI/Window/UINewSelectCharWnd.cpp index e7b4143d..a6d156d5 100644 --- a/Source/UI/Window/UINewSelectCharWnd.cpp +++ b/Source/UI/Window/UINewSelectCharWnd.cpp @@ -488,7 +488,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { } } - this->sub_7D9310(); + this->UpdateCharacterInfo(); this->m_message0 = 0xB8; } @@ -718,7 +718,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } } - this->sub_7D9310(); + this->UpdateCharacterInfo(); this->SaveCurrentSlot(); this->Invalidate(); break; @@ -822,7 +822,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } this->InvalidateChildren(); - this->sub_7D9310(); + this->UpdateCharacterInfo(); break; } case 0x13D: { @@ -888,7 +888,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } this->InvalidateChildren(); - this->sub_7D9310(); + this->UpdateCharacterInfo(); break; } case 0x15F: { @@ -1014,7 +1014,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); - this->sub_7D9310(); + this->UpdateCharacterInfo(); this->SaveCurrentSlot(); } break; @@ -1042,7 +1042,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); - this->sub_7D9310(); + this->UpdateCharacterInfo(); this->SaveCurrentSlot(); } break; @@ -1066,7 +1066,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); - this->sub_7D9310(); + this->UpdateCharacterInfo(); this->SaveCurrentSlot(); } break; @@ -1094,7 +1094,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); - this->sub_7D9310(); + this->UpdateCharacterInfo(); this->SaveCurrentSlot(); } break; @@ -1123,7 +1123,7 @@ void UINewSelectCharWnd::EnableButtonById(int id) { // OFFSET: 0x007D90E0 // FUNCTION: fn_09596 -__declspec(noinline) void UINewSelectCharWnd::sub_7D90E0() { +__declspec(noinline) void UINewSelectCharWnd::UpdateDeleteButtons() { const int slot = this->m_slotsPerPage * this->m_page + this->m_pageSlot; if (slot >= this->m_totalSlots) { return; @@ -1159,7 +1159,7 @@ __declspec(noinline) void UINewSelectCharWnd::sub_7D90E0() { // OFFSET: 0x007D9260 // FUNCTION: fn_09597 -void UINewSelectCharWnd::sub_7D9260() { +void UINewSelectCharWnd::UpdateSlotButtons() { for (int index = 0; index < this->m_slotsPerPage; ++index) { const int slot = this->m_page * this->m_slotsPerPage + index; if (slot >= this->m_totalSlots) { @@ -1179,7 +1179,7 @@ void UINewSelectCharWnd::sub_7D9260() { // OFFSET: 0x007D9310 // FUNCTION: fn_09598 -void UINewSelectCharWnd::sub_7D9310() { +void UINewSelectCharWnd::UpdateCharacterInfo() { const int current = this->m_page * this->m_slotsPerPage + this->m_pageSlot; if (current >= this->m_totalSlots) { return; @@ -1213,8 +1213,8 @@ void UINewSelectCharWnd::sub_7D9310() { } button->Invalidate(); - this->sub_7D9260(); - this->sub_7D90E0(); + this->UpdateSlotButtons(); + this->UpdateDeleteButtons(); } // OFFSET: 0x007D97B0 diff --git a/Source/UI/Window/UINewSelectCharWnd.h b/Source/UI/Window/UINewSelectCharWnd.h index 2df7189a..4841d656 100644 --- a/Source/UI/Window/UINewSelectCharWnd.h +++ b/Source/UI/Window/UINewSelectCharWnd.h @@ -54,9 +54,9 @@ public: void Paint() override; int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; - void sub_7D90E0(); - void sub_7D9260(); - void sub_7D9310(); + void UpdateDeleteButtons(); + void UpdateSlotButtons(); + void UpdateCharacterInfo(); protected: /* 00B4 */ UIBmpTextButton* m_textButton; diff --git a/Source/UI/Window/UISecondCostumeWnd.cpp b/Source/UI/Window/UISecondCostumeWnd.cpp index 0129e085..4bd3e8f5 100644 --- a/Source/UI/Window/UISecondCostumeWnd.cpp +++ b/Source/UI/Window/UISecondCostumeWnd.cpp @@ -17,7 +17,7 @@ #include "Script/LuaScript.h" // OFFSET: 0x00948D20 // FUNCTION: fn_12882 -void UISecondCostumeWnd::sub_948D20(int x, int y) { +void UISecondCostumeWnd::DrawCharacterPreview(int x, int y) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); const unsigned char flags = mode->scene->player->unknown_02CC; const std::uint32_t time = this->unknown_0100; @@ -216,7 +216,7 @@ void UISecondCostumeWnd::Paint() { if (bitmap != nullptr) { this->DrawBitmap(x, titleHeight + 3, bitmap, false); } - this->sub_948D20(x + 100, this->geometry.height - 35); + this->DrawCharacterPreview(x + 100, this->geometry.height - 35); } // OFFSET: 0x00951060 diff --git a/Source/UI/Window/UISecondCostumeWnd.h b/Source/UI/Window/UISecondCostumeWnd.h index d0f7d83a..2fc4a9e0 100644 --- a/Source/UI/Window/UISecondCostumeWnd.h +++ b/Source/UI/Window/UISecondCostumeWnd.h @@ -24,7 +24,7 @@ public: void Paint() override; int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; __declspec(noinline) void RefreshList(int tab); - void sub_948D20(int x, int y); + void DrawCharacterPreview(int x, int y); void LoadLists(); void SelectSavedEntries(); diff --git a/Source/Utility/Math/Int64Math.cpp b/Source/Utility/Math/Int64Math.cpp index dd5b4cf3..a43f3ce0 100644 --- a/Source/Utility/Math/Int64Math.cpp +++ b/Source/Utility/Math/Int64Math.cpp @@ -10,6 +10,6 @@ std::int64_t MaxInt64(const std::int64_t& first, const int& second) { // OFFSET: 0x0086BF00 // FUNCTION: fn_11017 -std::int64_t sub_86BF00(const int& value, const std::int64_t& other) { +std::int64_t MaxIntAndInt64(const int& value, const std::int64_t& other) { return std::max(static_cast(value), other); } diff --git a/Source/Utility/Math/Int64Math.h b/Source/Utility/Math/Int64Math.h index bf311843..1e4085f4 100644 --- a/Source/Utility/Math/Int64Math.h +++ b/Source/Utility/Math/Int64Math.h @@ -4,6 +4,6 @@ #include std::int64_t MaxInt64(const std::int64_t& first, const int& second); -std::int64_t sub_86BF00(const int& value, const std::int64_t& other); +std::int64_t MaxIntAndInt64(const int& value, const std::int64_t& other); #endif diff --git a/Source/Utility/ProcessSecurity.cpp b/Source/Utility/ProcessSecurity.cpp index bc91e5c8..cdc2e53f 100644 --- a/Source/Utility/ProcessSecurity.cpp +++ b/Source/Utility/ProcessSecurity.cpp @@ -6,7 +6,7 @@ // OFFSET: 0x00AEA5B0 // FUNCTION: fn_18120 -int __fastcall sub_AEA5B0(const void* self) { +int __fastcall Bad(const void* self) { return *reinterpret_cast(static_cast(self) + 0x20); }