isle-portable/LEGO1/lego/legoomni/include/legocachesoundmanager.h
Christian Semmler d62054db2e
Updates from isledecomp/isle (#1)
* Implement/match LegoAnimationManager::FUN_10064b50 (#926)

* Implement/match LegoAnimationManager::FUN_10063d10 (#927)

* Implement/match LegoAnimationManager::FUN_10064380 (#928)

* Implement/match LegoAnimationManager::FUN_10064380

* Fix naming

* Revert

* Implement/matche LegoAnimationManager::FUN_10064740 and FUN_10064670 (#929)

* Implement/match FUN_1003ef00 and related (#931)

* Implement/match LegoAnimationManager::FUN_10064120 (#932)

* Implement/match LegoAnimationManager::FUN_10064120

* Fix naming

* Fix parentheses

* Implement LegoAnimationManager::FUN_10064010 (#933)

* Implement/match ViewManager::FUN_100a6150 (#934)

* Implement/match PlayCamAnim and CameraTriggerFire (#935)

* Implement/match PlayCamAnim and CameraTriggerFire

* Fix type

* Name var

* Implement/match LegoAnimationManager::FUN_10063fb0 (#936)

* basic name improvements (#930)

* basic name improvements

* clang-format

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>

* Implement/match LegoPathBoundary::Intersect (#937)

* Implement LegoPathActor::VTable0x68 (#938)

* Implement LegoPathActor::VTable0x68

* Fix naming

* Implement/match LegoPathBoundary::FUN_100575b0 (#939)

* Implement LegoUnknown::FUN_1009a1e0 (#940)

* Implement/match LegoPathController::FUN_1004a240 (#941)

* Implement LegoPathActor::VTable0x9c (#942)

* Implement LegoPathActor::VTable0x9c

* Add annotation

* Implement/match LegoPathActor::SwitchBoundary (#943)

* Implement/match LegoPathActor::SwitchBoundary

* Rename var

* Implement/match LegoPathStruct (#944)

* Implement/match LegoPathStruct

* Rename some nums

* Consistent naming

* Naming

* relax regex

* Name some functions

* Improve naming

* Rename

* Implement/match LegoPathActor::VTable0xa4 and VTable0xa8 (#945)

* Implement/match LegoPathActor::VTable0xa4

* Implement/match LegoPathActor::VTable0xa8

* Name enum constants

---------

Co-authored-by: Cameron <25990062+crtdll@users.noreply.github.com>
2024-05-23 18:09:49 +02:00

121 lines
5.3 KiB
C++

#ifndef LEGOCACHESOUNDMANAGER_H
#define LEGOCACHESOUNDMANAGER_H
#include "decomp.h"
#include "legocachsound.h"
#include "mxstl/stlcompat.h"
#include "mxtypes.h"
#pragma warning(disable : 4237)
// SIZE 0x08
struct LegoCacheSoundEntry {
LegoCacheSoundEntry() : m_sound(NULL), m_name(NULL) {}
LegoCacheSoundEntry(LegoCacheSound* p_sound, const char* p_name) : m_sound(p_sound), m_name(p_name) {}
LegoCacheSoundEntry(LegoCacheSound* p_sound) : m_sound(p_sound), m_name(p_sound->GetString0x48().GetData()) {}
// FUNCTION: LEGO1 0x1003d030
~LegoCacheSoundEntry()
{
if (m_sound == NULL && m_name != NULL) {
delete[] const_cast<char*>(m_name);
}
}
bool operator==(LegoCacheSoundEntry) const { return 0; }
bool operator<(LegoCacheSoundEntry) 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 LegoCacheSoundEntry& p_a, const LegoCacheSoundEntry& p_b) const
{
return strcmpi(p_a.m_name, p_b.m_name) > 0;
}
};
typedef set<LegoCacheSoundEntry, Set100d6b4cComparator> Set100d6b4c;
typedef list<LegoCacheSoundEntry> List100d6b4c;
// VTABLE: LEGO1 0x100d6b4c
// SIZE 0x20
class LegoCacheSoundManager {
public:
LegoCacheSoundManager() {}
~LegoCacheSoundManager();
virtual MxResult Tickle(); // vtable+0x00
LegoCacheSound* FindSoundByKey(const char* p_key);
LegoCacheSound* ManageSoundEntry(LegoCacheSound* p_sound);
LegoCacheSound* FUN_1003dae0(const char* p_one, const char* p_two, MxBool p_three);
LegoCacheSound* FUN_1003db10(LegoCacheSound* p_one, const char* p_two, MxBool p_three);
void FUN_1003dc40(LegoCacheSound** p_und);
private:
Set100d6b4c m_set; // 0x04
List100d6b4c m_list; // 0x14
};
// TODO: Function names subject to change.
// clang-format off
// TEMPLATE: LEGO1 0x10029c30
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::~_Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >
// TEMPLATE: LEGO1 0x10029d10
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::iterator::_Inc
// TEMPLATE: LEGO1 0x10029d50
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::erase
// TEMPLATE: LEGO1 0x1002a1b0
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Erase
// TEMPLATE: LEGO1 0x1002a210
// list<LegoCacheSoundEntry,allocator<LegoCacheSoundEntry> >::~list<LegoCacheSoundEntry,allocator<LegoCacheSoundEntry> >
// TEMPLATE: LEGO1 0x1002a2a0
// set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::~set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >
// TEMPLATE: LEGO1 0x1002a2f0
// Set<LegoCacheSoundEntry,Set100d6b4cComparator>::~Set<LegoCacheSoundEntry,Set100d6b4cComparator>
// TEMPLATE: LEGO1 0x1002a340
// List<LegoCacheSoundEntry>::~List<LegoCacheSoundEntry>
// TEMPLATE: LEGO1 0x1003dab0
// list<LegoCacheSoundEntry,allocator<LegoCacheSoundEntry> >::_Buynode
// TEMPLATE: LEGO1 0x1003d450
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::insert
// TEMPLATE: LEGO1 0x1003d6f0
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::iterator::_Dec
// TEMPLATE: LEGO1 0x1003d740
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Buynode
// TEMPLATE: LEGO1 0x1003d760
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Insert
// TEMPLATE: LEGO1 0x1003d9f0
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Lrotate
// TEMPLATE: LEGO1 0x1003da50
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Rrotate
// GLOBAL: LEGO1 0x100f31cc
// _Tree<LegoCacheSoundEntry,LegoCacheSoundEntry,set<LegoCacheSoundEntry,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Kfn,Set100d6b4cComparator,allocator<LegoCacheSoundEntry> >::_Nil
// clang-format on
#endif // LEGOCACHESOUNDMANAGER_H