Decompile fn_19755 (EquipmentResourceMgr::GetRobeResourceName)

Batch #2069 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_19755 EquipmentResourceMgr::GetRobeResourceName: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, Yommy
Reviewed-by: ragnarok-clanker
This commit is contained in:
ragnarok-clanker 2026-10-29 08:59:47 +00:00
commit b551c5a670
3 changed files with 54 additions and 0 deletions

View file

@ -8,6 +8,7 @@ public:
std::string GetBodyRacePrefix(int job);
std::string GetBodyResourceName(int type, int job, int sex, int costumeJob, int costume);
std::string GetRobeSprName(int robe, int);
std::string GetRobeResourceName(int type, int job, int sex, int robe, bool riding, int unused, int costumeJob);
std::string GetHeadName(int type, int job, int sex, int* head);
std::string GetHeadPalName(int head, int job, int sex, int palette);
std::string GetWeaponResourceName(int type, int job, int sex, int weapon, int weaponItem, int costume);

View file

@ -1,9 +1,50 @@
#include "Client/Session.h"
#include "Contents/EquipmentResourceMgr.h"
#include "Resource/ResourceMgr.h"
#include "Script/LuaScript.h"
#include "Utility/Text/FormatString.h"
#include <string>
// OFFSET: 0x00BAC050
// FUNCTION: fn_19755
std::string EquipmentResourceMgr::GetRobeResourceName(int type, int job, int sex, int robe, bool riding, int, int costumeJob) {
if (robe < 1) {
return std::string();
}
const int spriteJob = g_session.GetSpriteJob(riding == true ? g_session.GetRidingJob(job) : job, costumeJob, true);
std::string path;
std::string jobName;
std::string sexName;
std::string robeName;
jobName = g_session.GetBodyJobName(spriteJob);
sexName = g_session.GetSexName(sex);
robeName = this->GetRobeSprName(robe, 0);
if (robeName.size() == 0) {
return "";
}
const char* extension = g_equipmentResourceExtensions[type];
if (type == 1) {
path = FormatOwnedString("sprite\\로브\\%s\\%s.%s", robeName.c_str(), robeName.c_str(), extension);
if (g_session.IsDoramJob(job)) {
path = FormatOwnedString("sprite\\로브\\%s\\%s_Doram.%s", robeName.c_str(), robeName.c_str(), g_equipmentResourceExtensions[1]);
}
if (!ResourceMgr::Instance().Exists(path.c_str())) {
path = FormatOwnedString(
"sprite\\로브\\%s\\%s\\%s_%s.%s", robeName.c_str(), sexName.c_str(), jobName.c_str(), sexName.c_str(), g_equipmentResourceExtensions[1]
);
}
} else {
path = FormatOwnedString("sprite\\로브\\%s\\%s\\%s_%s.%s", robeName.c_str(), sexName.c_str(), jobName.c_str(), sexName.c_str(), extension);
}
return path;
}
// OFFSET: 0x00BAC770
// FUNCTION: fn_19756
std::string EquipmentResourceMgr::GetRobeSprName(int robe, int) {

View file

@ -1,12 +1,22 @@
#include "Contents/Actors/SpriteDrawingPolicy.h"
#include "Client/Session.h"
#include "Contents/Camera/Camera.h"
#include "Render/SpriteGeometry.h"
#include "Script/LuaScript.h"
constexpr float robeTopLayerThreshold = 320.0f;
// GLOBAL: gl_24739
float g_cameraDistance = 300.0f;
struct AccessoryLayerDepth {
const int& bottomAccessory;
const int& topAccessory;
const int& middleAccessory;
void OffsetLayerDepth(int layer, SpriteCellQuad& quad, float bottomDepth, float topDepth) const;
};
// OFFSET: 0x0080DAA0
// FUNCTION: fn_10103
void SpriteDrawingPolicy::OffsetLayerDepth(int layer, SpriteCellQuad& quad, float bottomDepth, float topDepth) const {
@ -39,3 +49,5 @@ void SpriteDrawingPolicy::OffsetLayerDepth(int layer, SpriteCellQuad& quad, floa
break;
}
}
// OFFSET: 0x0080E4D0