LegoCacheSound and related STL (#560)

* LegoCacheSound and related STL

* Changes/annotations

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
MS
2024-02-13 18:34:14 -05:00
committed by GitHub
parent 6d3ce3b5cb
commit 971ac8b6e7
14 changed files with 564 additions and 18 deletions

View File

@@ -1,6 +1,8 @@
#ifndef LEGO3DWAVEPRESENTER_H
#define LEGO3DWAVEPRESENTER_H
#include "decomp.h"
#include "legounknown100d5778.h"
#include "mxwavepresenter.h"
// VTABLE: LEGO1 0x100d52b0
@@ -27,6 +29,10 @@ public:
// SYNTHETIC: LEGO1 0x1000f4b0
// Lego3DWavePresenter::`scalar deleting destructor'
private:
undefined m_unk0x6c[4]; // 0x6c
LegoUnknown100d5778 m_unk0x70; // 0x70
};
#endif // LEGO3DWAVEPRESENTER_H

View File

@@ -2,7 +2,9 @@
#define LEGOCACHESOUND_H
#include "decomp.h"
#include "legounknown100d5778.h"
#include "mxcore.h"
#include "mxstring.h"
// VTABLE: LEGO1 0x100d4718
// SIZE 0x88
@@ -24,13 +26,38 @@ public:
return !strcmp(p_name, LegoCacheSound::ClassName()) || MxCore::IsA(p_name);
}
virtual MxResult FUN_10006710(); // vtable+0x14
virtual void Destroy(); // vtable+0x18
virtual void FUN_10006cd0(undefined4, undefined4); // vtable+0x1c
inline const MxString& GetString0x48() const { return m_string0x48; }
inline const undefined GetUnk0x58() const { return m_unk0x58; }
LegoCacheSound* FUN_10006960();
MxResult FUN_10006a30(char* p_str, MxBool);
void FUN_10006b80();
void FUN_10006be0();
// SYNTHETIC: LEGO1 0x10006610
// LegoCacheSound::`scalar deleting destructor'
private:
void Init();
undefined m_padding0x08[0x80]; // 0x08
LPDIRECTSOUNDBUFFER m_dsBuffer; // 0x08
undefined m_unk0xc[4]; // 0x0c
LegoUnknown100d5778 m_unk0x10; // 0x10
undefined* m_unk0x40; // 0x40
undefined4 m_unk0x44; // 0x44
MxString m_string0x48; // 0x48
undefined m_unk0x58; // 0x58
PCMWAVEFORMAT m_unk0x59; // 0x59
MxBool m_isLooping; // 0x69
MxBool m_unk0x6a; // 0x6a
undefined4 m_unk0x6c; // 0x6c
undefined m_unk0x70; // 0x70
MxString m_string0x74; // 0x74
undefined m_unk0x84; // 0x84
};
#endif // LEGOCACHESOUND_H

View File

@@ -0,0 +1,38 @@
#ifndef LEGOUNKNOWN100D5778_H
#define LEGOUNKNOWN100D5778_H
#include "decomp.h"
#include "mxtypes.h"
#include "roi/legoroi.h"
#include <dsound.h>
// VTABLE: LEGO1 0x100d5778
// SIZE 0x30
class LegoUnknown100d5778 {
public:
LegoUnknown100d5778();
virtual ~LegoUnknown100d5778();
void Init();
MxResult FUN_100116a0(LPDIRECTSOUND p_dsound, undefined4, undefined4 p_unk0x2c);
void Destroy();
undefined4 FUN_100118e0(LPDIRECTSOUNDBUFFER p_dsBuffer);
void FUN_10011ca0();
// SYNTHETIC: LEGO1 0x10011650
// LegoUnknown100d5778::`scalar deleting destructor'
private:
undefined m_unk0x4[4]; // 0x04
LPDIRECTSOUNDBUFFER m_dsBuffer; // 0x08
LegoROI* m_unk0xc; // 0x0c
undefined4 m_unk0x10; // 0x10
MxBool m_unk0x14; // 0x14
MxBool m_unk0x15; // 0x15
undefined4 m_unk0x18; // 0x18
undefined m_unk0x1c[0x10]; // 0x1c
undefined4 m_unk0x2c; // 0x2c
};
#endif // LEGOUNKNOWN100D5778_H

View File

@@ -2,23 +2,117 @@
#define LEGOUNKNOWN100D6B4C_H
#include "decomp.h"
#include "legocachesound.h"
#include "mxstl/stlcompat.h"
#include "mxtypes.h"
class LegoCacheSound;
// SIZE 0x08
struct Element100d6b4c {
Element100d6b4c() : m_sound(NULL), m_name(NULL) {}
Element100d6b4c(LegoCacheSound* p_sound, const char* p_name) : m_sound(p_sound), m_name(p_name) {}
Element100d6b4c(LegoCacheSound* p_sound) : m_sound(p_sound), m_name(p_sound->GetString0x48().GetData()) {}
// FUNCTION: LEGO1 0x1003d030
~Element100d6b4c()
{
if (m_sound == NULL && m_name != NULL) {
delete[] const_cast<char*>(m_name);
}
}
bool operator==(Element100d6b4c) const { return 0; }
bool operator<(Element100d6b4c) const { return 0; }
inline LegoCacheSound* GetSound() const { return m_sound; }
inline const char* GetName() const { return m_name; }
friend struct Set100d6b4cComparator;
private:
LegoCacheSound* m_sound; // 0x00
const char* m_name; // 0x04
};
struct Set100d6b4cComparator {
bool operator()(const Element100d6b4c& p_a, const Element100d6b4c& p_b) const
{
return strcmpi(p_a.m_name, p_b.m_name) > 0;
}
};
typedef set<Element100d6b4c, Set100d6b4cComparator> Set100d6b4c;
typedef list<Element100d6b4c> List100d6b4c;
// VTABLE: LEGO1 0x100d6b4c
// SIZE 0x20
class LegoUnknown100d6b4c {
public:
LegoUnknown100d6b4c();
LegoUnknown100d6b4c() {}
~LegoUnknown100d6b4c();
virtual MxResult Tickle(); // vtable+0x00
LegoCacheSound* FUN_1003d170(const char* p_key);
LegoCacheSound* FUN_1003d290(LegoCacheSound* p_sound);
void FUN_1003dae0(char* p_one, char* p_two, MxBool p_three);
LegoCacheSound* FUN_1003db10(LegoCacheSound* p_one, char* p_two, MxBool p_three);
void FUN_1003dc40(LegoCacheSound** p_und);
private:
undefined m_pad[0x1c];
Set100d6b4c m_set; // 0x04
List100d6b4c m_list; // 0x14
};
// TODO: Function names subject to change.
// clang-format off
// TEMPLATE: LEGO1 0x10029c30
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::~_Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >
// TEMPLATE: LEGO1 0x10029d10
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::iterator::_Inc
// TEMPLATE: LEGO1 0x10029d50
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::erase
// TEMPLATE: LEGO1 0x1002a1b0
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Erase
// TEMPLATE: LEGO1 0x1002a210
// list<Element100d6b4c,allocator<Element100d6b4c> >::~list<Element100d6b4c,allocator<Element100d6b4c> >
// TEMPLATE: LEGO1 0x1002a2a0
// set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::~set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >
// TEMPLATE: LEGO1 0x1002a2f0
// Set<Element100d6b4c,Set100d6b4cComparator>::~Set<Element100d6b4c,Set100d6b4cComparator>
// TEMPLATE: LEGO1 0x1002a340
// List<Element100d6b4c>::~List<Element100d6b4c>
// TEMPLATE: LEGO1 0x1003dab0
// list<Element100d6b4c,allocator<Element100d6b4c> >::_Buynode
// TEMPLATE: LEGO1 0x1003d450
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::insert
// TEMPLATE: LEGO1 0x1003d6f0
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::iterator::_Dec
// TEMPLATE: LEGO1 0x1003d740
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::_BuyNode
// TEMPLATE: LEGO1 0x1003d760
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Insert
// TEMPLATE: LEGO1 0x1003d9f0
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Lrotate
// TEMPLATE: LEGO1 0x1003da50
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Rrotate
// GLOBAL: LEGO1 0x100f31cc
// _Tree<Element100d6b4c,Element100d6b4c,set<Element100d6b4c,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Kfn,Set100d6b4cComparator,allocator<Element100d6b4c> >::_Nil
// clang-format on
#endif // LEGOUNKNOWN100D6B4C_H

View File

@@ -42,6 +42,7 @@ public:
AutoROI* FUN_10083500(char*, undefined4);
void FUN_100832a0();
void FUN_10083db0(LegoROI* p_roi);
void FUN_10083f10(LegoROI* p_roi);
private:
undefined m_unk0x00[0x08]; // 0x00