2023-06-29 04:10:08 -04:00
|
|
|
#ifndef LEGOSTATE_H
|
|
|
|
#define LEGOSTATE_H
|
|
|
|
|
2023-10-16 14:17:23 -04:00
|
|
|
#include "decomp.h"
|
2024-01-24 12:12:57 -05:00
|
|
|
#include "lego/sources/misc/legostorage.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
#include "mxcore.h"
|
2023-10-16 16:18:35 -04:00
|
|
|
#include "mxstring.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d46c0
|
2024-01-29 13:54:47 -05:00
|
|
|
// SIZE 0x08
|
2023-10-24 19:38:27 -04:00
|
|
|
class LegoState : public MxCore {
|
2023-06-29 04:10:08 -04:00
|
|
|
public:
|
2024-01-29 13:54:47 -05:00
|
|
|
// FUNCTION: LEGO1 0x10005f40
|
2024-02-01 15:42:10 -05:00
|
|
|
~LegoState() override {}
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100060d0
|
2024-02-01 15:42:10 -05:00
|
|
|
inline const char* ClassName() const override // vtable+0x0c
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-27 15:59:42 -05:00
|
|
|
// STRING: LEGO1 0x100f01b8
|
2023-10-24 19:38:27 -04:00
|
|
|
return "LegoState";
|
|
|
|
}
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100060e0
|
2024-02-01 15:42:10 -05:00
|
|
|
inline MxBool IsA(const char* p_name) const override // vtable+0x10
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
return !strcmp(p_name, LegoState::ClassName()) || MxCore::IsA(p_name);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2024-01-29 13:54:47 -05:00
|
|
|
// FUNCTION: LEGO1 0x10005f90
|
|
|
|
virtual MxBool VTable0x14() { return TRUE; } // vtable+0x14
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10005fa0
|
|
|
|
virtual MxBool SetFlag() { return FALSE; } // vtable+0x18
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10005fb0
|
|
|
|
virtual MxResult VTable0x1c(LegoFile* p_legoFile)
|
|
|
|
{
|
|
|
|
if (p_legoFile->IsWriteMode()) {
|
|
|
|
p_legoFile->FUN_10006030(this->ClassName());
|
|
|
|
}
|
|
|
|
return SUCCESS;
|
|
|
|
} // vtable+0x1c
|
2024-01-18 08:34:14 -05:00
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10006160
|
|
|
|
// LegoState::`scalar deleting destructor'
|
2024-01-30 13:57:20 -05:00
|
|
|
|
|
|
|
// SIZE 0x0c
|
2024-02-02 14:09:45 -05:00
|
|
|
class Playlist {
|
2024-02-01 18:08:56 -05:00
|
|
|
public:
|
2024-02-02 14:09:45 -05:00
|
|
|
enum Mode {
|
|
|
|
e_loop,
|
|
|
|
e_once,
|
|
|
|
e_random,
|
|
|
|
e_loopSkipFirst
|
|
|
|
};
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
// FUNCTION: LEGO1 0x10017c00
|
2024-02-02 14:09:45 -05:00
|
|
|
Playlist()
|
2024-02-01 18:08:56 -05:00
|
|
|
{
|
|
|
|
m_objectIds = NULL;
|
|
|
|
m_length = 0;
|
2024-02-02 14:09:45 -05:00
|
|
|
m_mode = e_loop;
|
|
|
|
m_nextIndex = 0;
|
2024-02-01 18:08:56 -05:00
|
|
|
}
|
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
Playlist(MxU32* p_objectIds, MxS16 p_length)
|
2024-01-31 09:47:15 -05:00
|
|
|
{
|
2024-02-01 18:08:56 -05:00
|
|
|
m_objectIds = p_objectIds;
|
|
|
|
m_length = p_length;
|
2024-02-02 14:09:45 -05:00
|
|
|
m_mode = e_loop;
|
|
|
|
m_nextIndex = 0;
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
2024-01-30 13:57:20 -05:00
|
|
|
|
2024-02-01 18:08:56 -05:00
|
|
|
// FUNCTION: LEGO1 0x10071800
|
2024-02-02 14:09:45 -05:00
|
|
|
Playlist& operator=(const Playlist& p_shuffle)
|
2024-02-01 18:08:56 -05:00
|
|
|
{
|
|
|
|
m_objectIds = p_shuffle.m_objectIds;
|
|
|
|
m_length = p_shuffle.m_length;
|
2024-02-02 14:09:45 -05:00
|
|
|
m_nextIndex = p_shuffle.m_nextIndex;
|
|
|
|
m_mode = p_shuffle.m_mode;
|
2024-02-01 18:08:56 -05:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
MxU32 Next();
|
|
|
|
MxBool Contains(MxU32 p_objectId);
|
2024-02-01 18:08:56 -05:00
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
inline void SetUnknown0x08(MxS16 p_unk0x08) { m_nextIndex = p_unk0x08; }
|
2024-02-01 18:08:56 -05:00
|
|
|
|
|
|
|
private:
|
2024-02-02 14:09:45 -05:00
|
|
|
MxU32* m_objectIds; // 0x00
|
|
|
|
MxS16 m_length; // 0x04
|
|
|
|
MxS16 m_mode; // 0x06
|
|
|
|
MxS16 m_nextIndex; // 0x08
|
2024-01-30 13:57:20 -05:00
|
|
|
};
|
2023-06-29 04:10:08 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LEGOSTATE_H
|