rodecomp/Source/Contents/Actors/RenderObjectState.cpp
ragnarok-clanker e4be8f4190 Decompile 18 functions in Source/Client/Application/UnhandledExceptionHandler.cpp, Source/Client/Session.h, ...
Batch #2077 by ragnarok-clanker: 0 byte-identical, 18 confirmed by peer review.

- fn_04709 TopLevelExceptionFilter: logic confirmed by peer review (already on main)
- fn_08004 C3dGrannyModelRes::PlayAnimation: logic confirmed by peer review
- fn_09315 UIRequestJoinPartyWnd::SendMsg: logic confirmed by peer review
- fn_19761 EffectParticle::EffectParticle: logic confirmed by peer review
- fn_19768 EffectParticle::InitializeRecords: logic confirmed by peer review
- fn_20007 AttachedEffect::AttachedEffect: logic confirmed by peer review
- fn_20076 CreateEffectParticle: logic confirmed by peer review
- fn_20088 UpdatePartyEffect: logic confirmed by peer review
- fn_20991 CRenderObject::CRenderObject: logic confirmed by peer review
- fn_21069 ?CreatePartyEffect@?A0xba063134@@YAPAUAttachedEffect@@AAUEffectActor@@AAUPartyEffectMode@@@Z: logic confirmed by peer review
- fn_21086 RenderObjectState::Reset: logic confirmed by peer review
- fn_23396 CSession::GetJobName: logic confirmed by peer review
- fn_23495 CSession::InitJobNameTable: logic confirmed by peer review
- fn_23788 CSession::GetMonsterActName: logic confirmed by peer review
- fn_23791 CSession::GetMonsterTalkText: logic confirmed by peer review
- fn_20987 EffectActor::EffectActor: logic confirmed by peer review
- fn_22363 CSoundMaker::CSoundMaker: logic confirmed by peer review
- fn_24251 CEffectMaker::CEffectMaker: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
2026-10-29 09:48:08 +00:00

112 lines
2.6 KiB
C++

#include "Client/Session.h"
#include "Contents/Actors/RenderObjectState.h"
#include "Resource/Sprites/ActionResource.h"
#include "Resource/ResourceMgr.h"
#include "Resource/Sprites/SpriteResource.h"
#include <cstdio>
#include <windows.h>
#include <timeapi.h>
// INLINED
RenderObjectState::RenderObjectState() : sprite(nullptr), action(nullptr) {
this->Reset();
}
// INLINED
RenderObjectState::~RenderObjectState() {
if (this->sprite) {
this->sprite->Release();
}
if (this->action) {
this->action->Release();
}
}
// OFFSET: 0x00CAF990
// FUNCTION: fn_21086
void RenderObjectState::Reset() {
this->position.x = 0;
this->position.y = 0;
this->position.z = 0;
this->animation = 0;
this->previousAnimation = 0;
this->unknown_0040 = 0;
this->curMotion = 0;
this->unknown_0044 = 0;
this->angle = 0;
this->scale = 1;
this->unknown_0054 = 1;
this->unknown_006C = 0;
this->speed = 1;
this->unknown_0070 = 0;
this->visible = 1;
this->enabled = 1;
this->color = 0xFFFFFFFFu;
this->unknown_00A2 = 0;
this->unknown_00A4 = 0;
this->isMotionFinished = 0;
this->isMotionFreezed = 0;
this->unknown_0078 = 0;
this->unknown_007C = 0;
this->started = timeGetTime();
this->isSingleColor = 0;
this->isLieOnGround = 0;
this->unknown_00A3 = 0;
this->overrideColor = 0xFFFF0000u;
this->unknown_0080 = 0;
this->unknown_0048 = 0;
this->unknown_005C = 1;
this->unknown_0060 = 1;
this->unknown_0064 = 1;
this->unknown_00A8 = 0;
char spriteName[128];
char actionName[128];
std::sprintf(spriteName, "NPC\\%s.spr", g_session.GetJobName(46, -1));
std::sprintf(actionName, "NPC\\%s.act", g_session.GetJobName(46, -1));
if (this->sprite) {
this->sprite->Release();
}
this->sprite = static_cast<CSprRes*>(ResourceMgr::Instance().Load(spriteName));
if (this->sprite) {
++this->sprite->references;
}
if (this->action) {
this->action->Release();
}
this->action = static_cast<CActRes*>(ResourceMgr::Instance().Load(actionName));
if (this->action) {
++this->action->references;
}
this->unknown_0090 = 0;
this->unknown_00F4 = 0;
this->unknown_00F6 = 0;
this->unknown_00F8 = 0;
this->unknown_00FA = 0;
this->unknown_00FC = 0;
this->unknown_0100 = 0;
this->accountId = 0;
this->unknown_0114 = 0;
this->unknown_00C8 = 0;
this->unknown_00D8 = 0;
this->unknown_00DC = 0;
this->unknown_00C2 = 10;
this->unknown_00EC = 1;
this->flags = 0;
this->unknown_00F0 = 0;
this->unknown_00F2 = 0;
this->unknown_00B4 = 1;
this->instant.Clear();
this->unknown_0124 = 0;
this->unknown_0128 = 0;
this->unknown_012C = 0;
}