2023-06-29 04:10:08 -04:00
|
|
|
#include "legoanimpresenter.h"
|
|
|
|
|
2024-01-15 14:37:50 -05:00
|
|
|
#include "legoomni.h"
|
|
|
|
#include "legoworld.h"
|
|
|
|
#include "mxcompositepresenter.h"
|
|
|
|
#include "mxdsanim.h"
|
|
|
|
#include "mxstreamchunk.h"
|
2024-01-21 09:58:15 -05:00
|
|
|
#include "mxvideomanager.h"
|
2024-01-15 14:37:50 -05:00
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(LegoAnimPresenter, 0xc0)
|
|
|
|
DECOMP_SIZE_ASSERT(LegoAnimClass, 0x18)
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10068420
|
2023-06-29 04:10:08 -04:00
|
|
|
LegoAnimPresenter::LegoAnimPresenter()
|
|
|
|
{
|
2024-01-15 14:37:50 -05:00
|
|
|
Init();
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-01-15 14:37:50 -05:00
|
|
|
// FUNCTION: LEGO1 0x10068670
|
2024-01-14 16:28:46 -05:00
|
|
|
LegoAnimPresenter::~LegoAnimPresenter()
|
|
|
|
{
|
2024-01-15 14:37:50 -05:00
|
|
|
Destroy(TRUE);
|
2024-01-14 16:28:46 -05:00
|
|
|
}
|
|
|
|
|
2024-01-15 14:37:50 -05:00
|
|
|
// FUNCTION: LEGO1 0x100686f0
|
2023-06-29 04:10:08 -04:00
|
|
|
void LegoAnimPresenter::Init()
|
2024-01-15 14:37:50 -05:00
|
|
|
{
|
|
|
|
m_unk0x64 = NULL;
|
|
|
|
m_unk0x68 = 0;
|
|
|
|
m_unk0x6c = 0;
|
|
|
|
m_unk0x74 = 0;
|
|
|
|
m_unk0x70 = 0;
|
|
|
|
m_unk0x78 = 0;
|
|
|
|
m_unk0x7c = 0;
|
|
|
|
m_unk0xa8.Clear();
|
|
|
|
m_unk0xa4 = 0;
|
|
|
|
m_currentWorld = NULL;
|
|
|
|
m_unk0x95 = 0;
|
|
|
|
m_unk0x88 = -1;
|
|
|
|
m_unk0x98 = 0;
|
|
|
|
m_animAtom.Clear();
|
|
|
|
m_unk0x9c = 0;
|
|
|
|
m_unk0x8c = 0;
|
|
|
|
m_unk0x90 = 0;
|
|
|
|
m_unk0x94 = 0;
|
|
|
|
m_unk0x96 = 1;
|
|
|
|
m_unk0xa0 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10068770
|
|
|
|
void LegoAnimPresenter::Destroy(MxBool p_fromDestructor)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
MxVideoPresenter::Destroy(p_fromDestructor);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10068fb0
|
|
|
|
MxResult LegoAnimPresenter::VTable0x88(MxStreamChunk* p_chunk)
|
|
|
|
{
|
|
|
|
MxResult result = FAILURE;
|
2024-01-24 12:12:57 -05:00
|
|
|
LegoMemory stream((char*) p_chunk->GetData());
|
2024-01-15 14:37:50 -05:00
|
|
|
|
|
|
|
MxS32 magicSig;
|
|
|
|
MxS32 val2 = 0;
|
|
|
|
MxS32 val3;
|
|
|
|
|
|
|
|
if (stream.Read(&magicSig, sizeof(MxS32)) == SUCCESS && magicSig == 0x11) {
|
|
|
|
if (stream.Read(&m_unk0xa4, sizeof(MxU32)) == SUCCESS) {
|
|
|
|
if (stream.Read(&m_unk0xa8[0], sizeof(float)) == SUCCESS) {
|
|
|
|
if (stream.Read(&m_unk0xa8[1], sizeof(float)) == SUCCESS) {
|
|
|
|
if (stream.Read(&m_unk0xa8[2], sizeof(float)) == SUCCESS) {
|
|
|
|
if (stream.Read(&val2, sizeof(MxS32)) == SUCCESS) {
|
|
|
|
if (stream.Read(&val3, sizeof(MxS32)) == SUCCESS) {
|
|
|
|
m_unk0x64 = new LegoAnimClass();
|
|
|
|
if (m_unk0x64) {
|
|
|
|
if (m_unk0x64->VTable0x10(&stream, val2) == SUCCESS) {
|
|
|
|
result = SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result != SUCCESS) {
|
|
|
|
delete m_unk0x64;
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1006ad30
|
|
|
|
void LegoAnimPresenter::PutFrame()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006b550
|
|
|
|
void LegoAnimPresenter::ReadyTickle()
|
|
|
|
{
|
|
|
|
m_currentWorld = GetCurrentWorld();
|
|
|
|
|
|
|
|
if (m_currentWorld) {
|
|
|
|
MxStreamChunk* chunk = m_subscriber->CurrentChunk();
|
|
|
|
|
|
|
|
if (chunk && chunk->GetTime() + m_action->GetStartTime() <= m_action->GetElapsedTime()) {
|
|
|
|
chunk = m_subscriber->NextChunk();
|
|
|
|
MxResult result = VTable0x88(chunk);
|
|
|
|
m_subscriber->DestroyChunk(chunk);
|
|
|
|
|
|
|
|
if (result == SUCCESS) {
|
2024-01-17 11:53:53 -05:00
|
|
|
ProgressTickleState(e_starting);
|
2024-01-15 14:37:50 -05:00
|
|
|
ParseExtra();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
EndAction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1006b5e0
|
|
|
|
void LegoAnimPresenter::StartingTickle()
|
|
|
|
{
|
|
|
|
// TODO
|
2024-01-17 11:53:53 -05:00
|
|
|
ProgressTickleState(e_streaming);
|
2024-01-15 14:37:50 -05:00
|
|
|
EndAction(); // Allow game to start
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006b840
|
|
|
|
void LegoAnimPresenter::StreamingTickle()
|
|
|
|
{
|
|
|
|
if (m_subscriber->CurrentChunk()) {
|
|
|
|
MxStreamChunk* chunk = m_subscriber->NextChunk();
|
|
|
|
m_subscriber->DestroyChunk(chunk);
|
|
|
|
}
|
|
|
|
|
2024-01-28 11:45:49 -05:00
|
|
|
if (m_unk0x95) {
|
2024-01-17 11:53:53 -05:00
|
|
|
ProgressTickleState(e_done);
|
2024-01-15 14:37:50 -05:00
|
|
|
if (m_compositePresenter) {
|
|
|
|
if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
|
|
|
|
m_compositePresenter->VTable0x60(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-28 11:45:49 -05:00
|
|
|
else {
|
|
|
|
if (m_action->GetElapsedTime() > m_unk0x64->GetUnknown0x8() + m_action->GetStartTime()) {
|
|
|
|
m_unk0x95 = 1;
|
|
|
|
}
|
|
|
|
}
|
2024-01-15 14:37:50 -05:00
|
|
|
}
|
|
|
|
|
2024-01-20 18:04:46 -05:00
|
|
|
// STUB: LEGO1 0x1006b8c0
|
|
|
|
void LegoAnimPresenter::DoneTickle()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2024-01-21 09:58:15 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006b8d0
|
2024-01-20 18:04:46 -05:00
|
|
|
MxResult LegoAnimPresenter::AddToManager()
|
|
|
|
{
|
2024-01-21 09:58:15 -05:00
|
|
|
return MxVideoPresenter::AddToManager();
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
2024-01-15 14:37:50 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006b8e0
|
|
|
|
void LegoAnimPresenter::Destroy()
|
|
|
|
{
|
|
|
|
Destroy(FALSE);
|
|
|
|
}
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006b8f0
|
|
|
|
const char* LegoAnimPresenter::GetActionObjectName()
|
|
|
|
{
|
|
|
|
return m_action->GetObjectName();
|
|
|
|
}
|
|
|
|
|
2024-01-15 14:37:50 -05:00
|
|
|
// STUB: LEGO1 0x1006bac0
|
|
|
|
void LegoAnimPresenter::ParseExtra()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006c620
|
|
|
|
MxResult LegoAnimPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
|
|
|
|
{
|
|
|
|
MxResult result = MxVideoPresenter::StartAction(p_controller, p_action);
|
|
|
|
m_displayZ = 0;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1006c640
|
|
|
|
void LegoAnimPresenter::EndAction()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
MxVideoPresenter::EndAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100a0b30
|
|
|
|
LegoAnimClass::LegoAnimClass()
|
|
|
|
{
|
2024-01-29 16:17:17 -05:00
|
|
|
m_unk0x08 = 0;
|
|
|
|
m_unk0x0c = 0;
|
2024-01-15 14:37:50 -05:00
|
|
|
m_unk0x10 = 0;
|
|
|
|
m_unk0x14 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x100a0bc0
|
|
|
|
LegoAnimClass::~LegoAnimClass()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x100a0c70
|
2024-01-24 12:12:57 -05:00
|
|
|
MxResult LegoAnimClass::VTable0x10(LegoMemory* p_stream, MxS32)
|
2024-01-15 14:37:50 -05:00
|
|
|
{
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x100a0e30
|
2024-01-28 11:45:49 -05:00
|
|
|
LegoResult LegoAnimClass::Write(LegoStorage* p_storage)
|
2024-01-15 14:37:50 -05:00
|
|
|
{
|
|
|
|
// TODO
|
2024-01-28 11:45:49 -05:00
|
|
|
return SUCCESS;
|
2024-01-15 14:37:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x100a1040
|
2024-01-28 11:45:49 -05:00
|
|
|
LegoTreeNodeData* LegoAnimClass::CreateData()
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2024-01-28 11:45:49 -05:00
|
|
|
return NULL;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|