LegoPalettePresenter - destroy function and destructor (#288)

* LegoPalettePresenter - destroy function and destructor

* Update legopalettepresenter.h

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Joshua Peisach 2023-11-17 15:01:27 -05:00 committed by GitHub
parent d8bf4aebf4
commit eee80250c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 5 deletions

View file

@ -8,14 +8,34 @@ LegoPalettePresenter::LegoPalettePresenter()
Init();
}
// OFFSET: LEGO1 0x1007a070 STUB
// OFFSET: LEGO1 0x1007a070
LegoPalettePresenter::~LegoPalettePresenter()
{
// TODO
Destroy(TRUE);
}
// OFFSET: LEGO1 0x1007a0d0
void LegoPalettePresenter::Init()
{
this->m_unk64 = 0;
m_palette = NULL;
}
// OFFSET: LEGO1 0x1007a0e0
void LegoPalettePresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
if (m_palette) {
delete m_palette;
}
Init();
m_criticalSection.Leave();
if (!p_fromDestructor) {
MxVideoPresenter::Destroy(FALSE);
}
}
// OFFSET: LEGO1 0x1007a120
void LegoPalettePresenter::Destroy()
{
Destroy(FALSE);
}

View file

@ -2,6 +2,7 @@
#define LEGOPALETTEPRESENTER_H
#include "decomp.h"
#include "mxpalette.h"
#include "mxvideopresenter.h"
// VTABLE 0x100d9aa0
@ -9,7 +10,7 @@
class LegoPalettePresenter : public MxVideoPresenter {
public:
LegoPalettePresenter();
virtual ~LegoPalettePresenter(); // vtable+0x0
virtual ~LegoPalettePresenter() override; // vtable+0x0
// OFFSET: LEGO1 0x10079f30
inline const char* ClassName() const override // vtable+0xc
@ -24,10 +25,12 @@ class LegoPalettePresenter : public MxVideoPresenter {
return !strcmp(name, ClassName()) || MxVideoPresenter::IsA(name);
}
virtual void Destroy() override; // vtable+0x38
private:
void Init();
void Destroy(MxBool p_fromDestructor);
undefined4 m_unk64;
MxPalette* m_palette;
};
#endif // LEGOPALETTEPRESENTER_H