Decompile 2 functions in Source/Contents/EffectResourceSwitcher.cpp, Source/Contents/EffectResourceSwitcher.h, ...
Batch #1977 by Yommy: 0 byte-identical, 2 confirmed by peer review. - fn_03113 EffectResourceSwitcher::Slot16: logic confirmed by peer review - fn_03115 Singleton<CEZ2STREffectMgr>::GetInstance: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, eAthena Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
ce2aab5af8
commit
88d8e9e378
3 changed files with 83 additions and 0 deletions
|
|
@ -1,8 +1,14 @@
|
|||
#include "Contents/EffectResourceSwitcher.h"
|
||||
#include "Contents/Effects/Effect.h"
|
||||
#include "Contents/Effects/EffectPrimitiveState.h"
|
||||
|
||||
#include <new>
|
||||
#include <string>
|
||||
|
||||
// GLOBAL: gl_24485
|
||||
template <>
|
||||
CEZ2STREffectMgr* Singleton<CEZ2STREffectMgr>::s_instance = nullptr;
|
||||
|
||||
// OFFSET: 0x005A2110
|
||||
// FUNCTION: fn_03083
|
||||
void CEffect::Slot10(int) {
|
||||
|
|
@ -120,7 +126,26 @@ void CEffect::Slot22(int) {
|
|||
void CEffect::Slot13(int) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x005A2520
|
||||
// FUNCTION: fn_03113
|
||||
void EffectResourceSwitcher::Slot16(int argument) {
|
||||
if (this->effect) {
|
||||
this->effect->Slot16(argument);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x005A2540
|
||||
// FUNCTION: fn_03114
|
||||
void CEffect::Slot20(int) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x005A2630
|
||||
// FUNCTION: fn_03115
|
||||
template <>
|
||||
CEZ2STREffectMgr* Singleton<CEZ2STREffectMgr>::GetInstance() {
|
||||
if (!s_instance) {
|
||||
s_instance = new (std::nothrow) CEZ2STREffectMgr;
|
||||
}
|
||||
|
||||
return s_instance;
|
||||
}
|
||||
|
|
|
|||
44
Source/Contents/EffectResourceSwitcher.h
Normal file
44
Source/Contents/EffectResourceSwitcher.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef RAGNAROK_SOURCE_CONTENTS_EFFECTRESOURCESWITCHER_H
|
||||
#define RAGNAROK_SOURCE_CONTENTS_EFFECTRESOURCESWITCHER_H
|
||||
|
||||
#include "Contents/Effects/Effect.h"
|
||||
#include "Utility/Singleton.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
struct EZ2STREffectInfo {
|
||||
/* 0000 */ int id;
|
||||
/* 0004 */ std::string name;
|
||||
/* 001C */ int unknown_001C[3];
|
||||
/* 0028 */ std::string unknown_0028;
|
||||
/* 0040 */ int unknown_0040[2];
|
||||
};
|
||||
|
||||
class CEZ2STREffectMgr : public Singleton<CEZ2STREffectMgr> {
|
||||
public:
|
||||
/* 0004 */ std::map<std::string, EZ2STREffectInfo> effects;
|
||||
};
|
||||
|
||||
class EffectResourceSwitcher : public CEffect {
|
||||
public:
|
||||
/* 00CC */ unsigned char active;
|
||||
/* 00CD */ unsigned char unknown_00CD[3];
|
||||
/* 00D0 */ CEffect* effect;
|
||||
/* 00D4 */ int unknown_00D4[3];
|
||||
/* 00E0 */ std::string sourceName;
|
||||
/* 00F8 */ std::string targetName;
|
||||
|
||||
void Slot16(int argument) override;
|
||||
};
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(EZ2STREffectInfo) == 0x48);
|
||||
static_assert(sizeof(CEZ2STREffectMgr) == 0xC);
|
||||
static_assert(offsetof(EffectResourceSwitcher, effect) == 0xD0);
|
||||
static_assert(offsetof(EffectResourceSwitcher, targetName) == 0xF8);
|
||||
static_assert(sizeof(EffectResourceSwitcher) == 0x110);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
14
Source/Utility/Singleton.h
Normal file
14
Source/Utility/Singleton.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef RAGNAROK_SOURCE_UTILITY_SINGLETON_H
|
||||
#define RAGNAROK_SOURCE_UTILITY_SINGLETON_H
|
||||
|
||||
template <typename T>
|
||||
class Singleton {
|
||||
public:
|
||||
static T* s_instance;
|
||||
|
||||
static T* GetInstance();
|
||||
|
||||
virtual ~Singleton() {}
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue