begin implementation of InfoCenter class (#444)

* Push changes

* fixes

* Implement Infocenter::HandleEndAction

* match Infocenter::StopCutScene

* implement Infocenter::HandleKeyPress

* fixes

* Update infocenter.cpp

* Update legoworld.cpp

* use enums

* WIP Fixes

* Fix

* Fix

* Fix

* Rename function

* Change enum

* Update enums

* Refactor another enum

* Refactor MxDSType

* Refactor HashTableOpt

* Fixes

* Refactor tickle enum

* Update other enums

* Add EnumConstantName to ncc

* Move enum to global namespace

* Rename enum

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Misha
2024-01-17 11:53:53 -05:00
committed by GitHub
parent aaa18bc9e2
commit f50b771fff
100 changed files with 1160 additions and 555 deletions

View File

@@ -15,14 +15,14 @@ MxU16 g_sep = TWOCC(',', ' ');
// FUNCTION: LEGO1 0x100ad810
MxDSAction::MxDSAction()
{
this->m_flags = MxDSAction::Flag_Enabled;
this->m_flags = MxDSAction::c_enabled;
this->m_startTime = INT_MIN;
this->m_extraData = NULL;
this->m_extraLength = 0;
this->m_duration = INT_MIN;
this->m_loopCount = -1;
this->SetType(MxDSType_Action);
this->SetType(e_action);
this->m_location.Fill(FLT_MAX);
this->m_direction.Fill(FLT_MAX);
this->m_up.Fill(FLT_MAX);

View File

@@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(MxDSAnim, 0xb8)
// FUNCTION: LEGO1 0x100c8ff0
MxDSAnim::MxDSAnim()
{
this->SetType(MxDSType_Anim);
this->SetType(e_anim);
}
// FUNCTION: LEGO1 0x100c91a0

View File

@@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(MxDSEvent, 0xb8)
// FUNCTION: LEGO1 0x100c95f0
MxDSEvent::MxDSEvent()
{
this->SetType(MxDSType_Event);
this->SetType(e_event);
}
// FUNCTION: LEGO1 0x100c97a0

View File

@@ -15,7 +15,7 @@ MxDSMediaAction::MxDSMediaAction()
this->m_paletteManagement = 1;
this->m_unk0xb4 = -1;
this->m_sustainTime = 0;
this->SetType(MxDSType_MediaAction);
this->SetType(e_mediaAction);
}
// FUNCTION: LEGO1 0x100c8cf0

View File

@@ -7,7 +7,7 @@ DECOMP_SIZE_ASSERT(MxDSActionListCursor, 0x10);
// FUNCTION: LEGO1 0x100c9b90
MxDSMultiAction::MxDSMultiAction()
{
this->SetType(MxDSType_MultiAction);
this->SetType(e_multiAction);
this->m_actions = new MxDSActionList;
this->m_actions->SetDestroy(MxDSActionList::Destroy);
}

View File

@@ -11,7 +11,6 @@
#include "mxdsserialaction.h"
#include "mxdssound.h"
#include "mxdsstill.h"
#include "mxdstypes.h"
#include "mxutil.h"
#include <stdlib.h>
@@ -22,7 +21,7 @@ DECOMP_SIZE_ASSERT(MxDSObject, 0x2c);
// FUNCTION: LEGO1 0x100bf6a0
MxDSObject::MxDSObject()
{
this->SetType(MxDSType_Object);
this->SetType(e_object);
this->m_sourceName = NULL;
this->m_unk0x14 = 0;
this->m_objectName = NULL;
@@ -148,40 +147,40 @@ MxDSObject* DeserializeDSObjectDispatch(MxU8** p_source, MxS16 p_flags)
switch (type) {
default:
return NULL;
case MxDSType_Object:
case MxDSObject::e_object:
obj = new MxDSObject();
break;
case MxDSType_Action:
case MxDSObject::e_action:
obj = new MxDSAction();
break;
case MxDSType_MediaAction:
case MxDSObject::e_mediaAction:
obj = new MxDSMediaAction();
break;
case MxDSType_Anim:
case MxDSObject::e_anim:
obj = new MxDSAnim();
break;
case MxDSType_Sound:
case MxDSObject::e_sound:
obj = new MxDSSound();
break;
case MxDSType_MultiAction:
case MxDSObject::e_multiAction:
obj = new MxDSMultiAction();
break;
case MxDSType_SerialAction:
case MxDSObject::e_serialAction:
obj = new MxDSSerialAction();
break;
case MxDSType_ParallelAction:
case MxDSObject::e_parallelAction:
obj = new MxDSParallelAction();
break;
case MxDSType_Event:
case MxDSObject::e_event:
obj = new MxDSEvent();
break;
case MxDSType_SelectAction:
case MxDSObject::e_selectAction:
obj = new MxDSSelectAction();
break;
case MxDSType_Still:
case MxDSObject::e_still:
obj = new MxDSStill();
break;
case MxDSType_ObjectAction:
case MxDSObject::e_objectAction:
obj = new MxDSObjectAction();
break;
}

View File

@@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(MxDSObjectAction, 0xb8)
// FUNCTION: LEGO1 0x100c8870
MxDSObjectAction::MxDSObjectAction()
{
this->SetType(MxDSType_ObjectAction);
this->SetType(e_objectAction);
}
// FUNCTION: LEGO1 0x100c8a20

View File

@@ -7,7 +7,7 @@ DECOMP_SIZE_ASSERT(MxDSParallelAction, 0x9c)
// FUNCTION: LEGO1 0x100cae80
MxDSParallelAction::MxDSParallelAction()
{
this->SetType(MxDSType_ParallelAction);
this->SetType(e_parallelAction);
}
// FUNCTION: LEGO1 0x100cb040

View File

@@ -12,7 +12,7 @@ DECOMP_SIZE_ASSERT(MxListEntry<MxString>, 0x18)
// FUNCTION: LEGO1 0x100cb2b0
MxDSSelectAction::MxDSSelectAction()
{
this->SetType(MxDSType_SelectAction);
this->SetType(e_selectAction);
this->m_unk0xac = new MxStringList;
}

View File

@@ -7,7 +7,7 @@ DECOMP_SIZE_ASSERT(MxDSSerialAction, 0xa8)
// FUNCTION: LEGO1 0x100ca9d0
MxDSSerialAction::MxDSSerialAction()
{
this->SetType(MxDSType_SerialAction);
this->SetType(e_serialAction);
this->m_cursor = new MxDSActionListCursor(this->m_actions);
this->m_unk0xa0 = 0;
}

View File

@@ -8,7 +8,7 @@ DECOMP_SIZE_ASSERT(MxDSSound, 0xc0)
MxDSSound::MxDSSound()
{
this->m_volume = 0x4f;
this->SetType(MxDSType_Sound);
this->SetType(e_sound);
}
// FUNCTION: LEGO1 0x100c9470

View File

@@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(MxDSStill, 0xb8)
// FUNCTION: LEGO1 0x100c98c0
MxDSStill::MxDSStill()
{
this->SetType(MxDSType_Still);
this->SetType(e_still);
}
// FUNCTION: LEGO1 0x100c9a70

View File

@@ -21,7 +21,7 @@ void MxLoopingMIDIPresenter::StreamingTickle()
}
if (m_chunk->GetTime() + m_action->GetDuration() <= m_action->GetElapsedTime())
ProgressTickleState(TickleState_Done);
ProgressTickleState(e_done);
}
// FUNCTION: LEGO1 0x100c2ae0
@@ -38,7 +38,7 @@ MxResult MxLoopingMIDIPresenter::PutData()
{
m_criticalSection.Enter();
if (m_currentTickleState == TickleState_Streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
if (m_currentTickleState == e_streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
SetVolume(((MxDSSound*) m_action)->GetVolume());
MusicManager()->FUN_100c09c0(m_chunk->GetData(), !m_action->GetLoopCount() ? -1 : m_action->GetLoopCount());
}

View File

@@ -52,7 +52,7 @@ void MxMIDIPresenter::ReadyTickle()
if (chunk) {
m_subscriber->DestroyChunk(chunk);
ParseExtra();
ProgressTickleState(TickleState_Starting);
ProgressTickleState(e_starting);
}
}
@@ -62,14 +62,14 @@ void MxMIDIPresenter::StartingTickle()
MxStreamChunk* chunk = CurrentChunk();
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime())
ProgressTickleState(TickleState_Streaming);
ProgressTickleState(e_streaming);
}
// FUNCTION: LEGO1 0x100c2910
void MxMIDIPresenter::StreamingTickle()
{
if (m_chunk)
ProgressTickleState(TickleState_Done);
ProgressTickleState(e_done);
else
m_chunk = NextChunk();
}
@@ -92,7 +92,7 @@ MxResult MxMIDIPresenter::PutData()
{
m_criticalSection.Enter();
if (m_currentTickleState == TickleState_Streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
if (m_currentTickleState == e_streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
SetVolume(((MxDSSound*) m_action)->GetVolume());
if (MusicManager()->FUN_100c09c0(m_chunk->GetData(), 1))

View File

@@ -86,7 +86,7 @@ void MxWavePresenter::WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length)
}
if (dwStatus != DSBSTATUS_BUFFERLOST) {
if (m_action->GetFlags() & MxDSAction::Flag_Looping) {
if (m_action->GetFlags() & MxDSAction::c_looping) {
m_writtenChunks++;
m_lockSize = p_length;
}
@@ -99,7 +99,7 @@ void MxWavePresenter::WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length)
DS_OK) {
memcpy(pvAudioPtr1, p_audioPtr, p_length);
if (m_lockSize > p_length && !(m_action->GetFlags() & MxDSAction::Flag_Looping)) {
if (m_lockSize > p_length && !(m_action->GetFlags() & MxDSAction::c_looping)) {
memset((MxU8*) pvAudioPtr1 + p_length, m_silenceData, m_lockSize - p_length);
}
@@ -118,7 +118,7 @@ void MxWavePresenter::ReadyTickle()
memcpy(m_waveFormat, chunk->GetData(), chunk->GetLength());
m_subscriber->DestroyChunk(chunk);
ParseExtra();
ProgressTickleState(TickleState_Starting);
ProgressTickleState(e_starting);
}
}
@@ -156,7 +156,7 @@ void MxWavePresenter::StartingTickle()
else
desc.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME;
if (m_action->GetFlags() & MxDSAction::Flag_Looping)
if (m_action->GetFlags() & MxDSAction::c_looping)
desc.dwBufferBytes = m_waveFormat->m_waveFormatEx.nAvgBytesPerSec *
(m_action->GetDuration() / m_action->GetLoopCount()) / 1000;
else
@@ -169,7 +169,7 @@ void MxWavePresenter::StartingTickle()
}
else {
SetVolume(((MxDSSound*) m_action)->GetVolume());
ProgressTickleState(TickleState_Streaming);
ProgressTickleState(e_streaming);
}
}
}
@@ -178,11 +178,11 @@ void MxWavePresenter::StartingTickle()
void MxWavePresenter::StreamingTickle()
{
if (!m_currentChunk) {
if (!(m_action->GetFlags() & MxDSAction::Flag_Looping)) {
if (!(m_action->GetFlags() & MxDSAction::c_looping)) {
MxStreamChunk* chunk = CurrentChunk();
if (chunk && chunk->GetFlags() & MxDSChunk::Flag_End && !(chunk->GetFlags() & MxDSChunk::Flag_Bit16)) {
chunk->SetFlags(chunk->GetFlags() | MxDSChunk::Flag_Bit16);
if (chunk && chunk->GetFlags() & MxDSChunk::c_end && !(chunk->GetFlags() & MxDSChunk::c_bit16)) {
chunk->SetFlags(chunk->GetFlags() | MxDSChunk::c_bit16);
m_currentChunk = new MxStreamChunk;
MxU8* data = new MxU8[m_chunkLength];
@@ -192,7 +192,7 @@ void MxWavePresenter::StreamingTickle()
m_currentChunk->SetLength(m_chunkLength);
m_currentChunk->SetData(data);
m_currentChunk->SetTime(chunk->GetTime() + 1000);
m_currentChunk->SetFlags(MxDSChunk::Flag_Bit1);
m_currentChunk->SetFlags(MxDSChunk::c_bit1);
}
}
@@ -208,7 +208,7 @@ void MxWavePresenter::DoneTickle()
m_dsBuffer->GetCurrentPosition(&dwCurrentPlayCursor, &dwCurrentWriteCursor);
MxS8 playedChunks = dwCurrentPlayCursor / m_chunkLength;
if (m_action->GetFlags() & MxDSAction::Flag_Bit7 || m_action->GetFlags() & MxDSAction::Flag_Looping ||
if (m_action->GetFlags() & MxDSAction::c_bit7 || m_action->GetFlags() & MxDSAction::c_looping ||
m_writtenChunks != playedChunks || m_lockSize + (m_chunkLength * playedChunks) <= dwCurrentPlayCursor)
MxMediaPresenter::DoneTickle();
}
@@ -231,7 +231,7 @@ MxResult MxWavePresenter::PutData()
if (IsEnabled()) {
switch (m_currentTickleState) {
case TickleState_Streaming:
case e_streaming:
if (m_currentChunk && FUN_100b1ba0()) {
WriteToSoundBuffer(m_currentChunk->GetData(), m_currentChunk->GetLength());
m_subscriber->DestroyChunk(m_currentChunk);
@@ -245,7 +245,7 @@ MxResult MxWavePresenter::PutData()
m_started = TRUE;
}
break;
case TickleState_Repeating:
case e_repeating:
if (m_started)
break;
@@ -339,13 +339,13 @@ void MxWavePresenter::Resume()
if (m_paused) {
if (m_dsBuffer && m_started) {
switch (m_currentTickleState) {
case TickleState_Streaming:
case e_streaming:
m_dsBuffer->Play(0, 0, DSBPLAY_LOOPING);
break;
case TickleState_Repeating:
case e_repeating:
m_dsBuffer->Play(0, 0, m_action->GetLoopCount() > 1);
break;
case TickleState_Done:
case e_done:
m_dsBuffer->Play(0, 0, 0);
}
}

View File

@@ -55,7 +55,7 @@ MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId)
Destroy();
if (p_atomId.m_internal && MxOmni::GetInstance() && AtomIdCounterSet()) {
MxAtomIdCounter* counter = GetCounter(p_atomId.m_internal, LookupMode_Exact);
MxAtomIdCounter* counter = GetCounter(p_atomId.m_internal, e_exact);
counter->Inc();
}
@@ -71,11 +71,11 @@ MxAtomIdCounter* MxAtomId::GetCounter(const char* p_str, LookupMode p_mode)
MxAtomIdCounter* counter = new MxAtomIdCounter(p_str);
switch (p_mode) {
case LookupMode_LowerCase:
case LookupMode_LowerCase2:
case e_lowerCase:
case e_lowerCase2:
counter->GetKey()->ToLowerCase();
break;
case LookupMode_UpperCase:
case e_upperCase:
counter->GetKey()->ToUpperCase();
break;
}

View File

@@ -112,7 +112,7 @@ MxLong MxCompositePresenter::Notify(MxParam& p_param)
case c_notificationEndAction:
VTable0x58((MxEndActionNotificationParam&) p_param);
break;
case MXPRESENTER_NOTIFICATION:
case c_notificationPresenter:
VTable0x5c((MxNotificationParam&) p_param);
}
@@ -155,8 +155,8 @@ void MxCompositePresenter::VTable0x58(MxEndActionNotificationParam& p_param)
else {
if (m_action->IsA("MxDSSerialAction") && it != m_list.end()) {
MxPresenter* presenter = *it;
if (presenter->GetCurrentTickleState() == TickleState_Idle)
presenter->SetTickleState(TickleState_Ready);
if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(e_ready);
}
}
}
@@ -171,8 +171,8 @@ void MxCompositePresenter::VTable0x5c(MxNotificationParam& p_param)
if (*it == presenter) {
m_list.erase(it++);
if (presenter->GetCurrentTickleState() == TickleState_Idle)
presenter->SetTickleState(TickleState_Ready);
if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(e_ready);
MxDSActionList* actions = ((MxDSMultiAction*) m_action)->GetActionList();
MxDSActionListCursor cursor(actions);
@@ -186,8 +186,8 @@ void MxCompositePresenter::VTable0x5c(MxNotificationParam& p_param)
else {
if (m_action->IsA("MxDSSerialAction")) {
MxPresenter* presenter = *it;
if (presenter->GetCurrentTickleState() == TickleState_Idle)
presenter->SetTickleState(TickleState_Ready);
if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(e_ready);
}
}
@@ -210,8 +210,8 @@ void MxCompositePresenter::VTable0x60(MxPresenter* p_presenter)
}
else if (m_action->IsA("MxDSSerialAction")) {
MxPresenter* presenter = *it;
if (presenter->GetCurrentTickleState() == TickleState_Idle)
presenter->SetTickleState(TickleState_Ready);
if (presenter->GetCurrentTickleState() == e_idle)
presenter->SetTickleState(e_ready);
}
return;
}
@@ -227,7 +227,7 @@ void MxCompositePresenter::SetTickleState(TickleState p_tickleState)
MxPresenter* presenter = *it;
presenter->SetTickleState(p_tickleState);
if (m_action->IsA("MxDSSerialAction") && p_tickleState == TickleState_Ready)
if (m_action->IsA("MxDSSerialAction") && p_tickleState == e_ready)
return;
}
}

View File

@@ -60,12 +60,12 @@ MxStreamChunk* MxMediaPresenter::CurrentChunk()
if (m_subscriber) {
chunk = m_subscriber->CurrentChunk();
if (chunk && chunk->GetFlags() & MxDSChunk::Flag_Bit3) {
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7);
if (chunk && chunk->GetFlags() & MxDSChunk::c_bit3) {
m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_bit7);
m_subscriber->NextChunk();
m_subscriber->DestroyChunk(chunk);
chunk = NULL;
ProgressTickleState(TickleState_Done);
ProgressTickleState(e_done);
}
}
@@ -80,11 +80,11 @@ MxStreamChunk* MxMediaPresenter::NextChunk()
if (m_subscriber) {
chunk = m_subscriber->NextChunk();
if (chunk && chunk->GetFlags() & MxDSChunk::Flag_Bit3) {
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_Bit7);
if (chunk && chunk->GetFlags() & MxDSChunk::c_bit3) {
m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_bit7);
m_subscriber->DestroyChunk(chunk);
chunk = NULL;
ProgressTickleState(TickleState_Done);
ProgressTickleState(e_done);
}
}
@@ -98,7 +98,7 @@ MxResult MxMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAct
MxAutoLocker lock(&m_criticalSection);
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
if (m_action->GetFlags() & MxDSAction::Flag_Looping) {
if (m_action->GetFlags() & MxDSAction::c_looping) {
m_loopingChunks = new MxStreamChunkList;
m_loopingChunkCursor = new MxStreamChunkListCursor(m_loopingChunks);
@@ -131,10 +131,9 @@ void MxMediaPresenter::EndAction()
m_currentChunk = NULL;
if (m_action->GetFlags() & MxDSAction::Flag_World &&
(!m_compositePresenter || !m_compositePresenter->VTable0x64(2))) {
if (m_action->GetFlags() & MxDSAction::c_world && (!m_compositePresenter || !m_compositePresenter->VTable0x64(2))) {
MxPresenter::Enable(FALSE);
SetTickleState(TickleState_Idle);
SetTickleState(e_idle);
}
else {
MxDSAction* action = m_action;
@@ -178,12 +177,12 @@ void MxMediaPresenter::StreamingTickle()
m_currentChunk = NextChunk();
if (m_currentChunk) {
if (m_currentChunk->GetFlags() & MxDSChunk::Flag_End) {
if (m_currentChunk->GetFlags() & MxDSChunk::c_end) {
m_subscriber->DestroyChunk(m_currentChunk);
m_currentChunk = NULL;
ProgressTickleState(TickleState_Repeating);
ProgressTickleState(e_repeating);
}
else if (m_action->GetFlags() & MxDSAction::Flag_Looping) {
else if (m_action->GetFlags() & MxDSAction::c_looping) {
LoopChunk(m_currentChunk);
if (!IsEnabled()) {
@@ -206,11 +205,11 @@ void MxMediaPresenter::RepeatingTickle()
if (m_currentChunk) {
MxLong time = m_currentChunk->GetTime();
if (time <= m_action->GetElapsedTime() % m_action->GetLoopCount())
ProgressTickleState(TickleState_unk5);
ProgressTickleState(e_unk5);
}
else {
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration())
ProgressTickleState(TickleState_unk5);
ProgressTickleState(e_unk5);
}
}
}
@@ -219,7 +218,7 @@ void MxMediaPresenter::RepeatingTickle()
void MxMediaPresenter::DoneTickle()
{
m_previousTickleStates |= 1 << m_currentTickleState;
m_currentTickleState = TickleState_Idle;
m_currentTickleState = e_idle;
EndAction();
}
@@ -246,13 +245,13 @@ void MxMediaPresenter::Enable(MxBool p_enable)
if (p_enable) {
MxLong time = Timer()->GetTime();
m_action->SetUnknown90(time);
SetTickleState(TickleState_Repeating);
SetTickleState(e_repeating);
}
else {
if (m_loopingChunkCursor)
m_loopingChunkCursor->Reset();
m_currentChunk = NULL;
SetTickleState(TickleState_Done);
SetTickleState(e_done);
}
}
}

View File

@@ -19,7 +19,7 @@ DECOMP_SIZE_ASSERT(MxObjectFactory, 0x38); // 100af1db
// FUNCTION: LEGO1 0x100b0d80
MxObjectFactory::MxObjectFactory()
{
#define X(V) this->m_id##V = MxAtomId(#V, LookupMode_Exact);
#define X(V) this->m_id##V = MxAtomId(#V, e_exact);
FOR_MXOBJECTFACTORY_OBJECTS(X)
#undef X
}
@@ -28,7 +28,7 @@ MxObjectFactory::MxObjectFactory()
MxCore* MxObjectFactory::Create(const char* p_name)
{
MxCore* object = NULL;
MxAtomId atom(p_name, LookupMode_Exact);
MxAtomId atom(p_name, e_exact);
if (0) {
}

View File

@@ -21,7 +21,7 @@ DECOMP_SIZE_ASSERT(MxPresenter, 0x40);
// FUNCTION: LEGO1 0x100b4d50
void MxPresenter::Init()
{
m_currentTickleState = TickleState_Idle;
m_currentTickleState = e_idle;
m_action = NULL;
m_location = MxPoint32(0, 0);
m_displayZ = 0;
@@ -41,7 +41,7 @@ MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
this->m_location = MxPoint32(this->m_action->GetLocation()[0], this->m_action->GetLocation()[1]);
this->m_displayZ = this->m_action->GetLocation()[2];
ProgressTickleState(TickleState_Ready);
ProgressTickleState(e_ready);
return SUCCESS;
}
@@ -70,7 +70,7 @@ void MxPresenter::EndAction()
this->m_action = NULL;
MxS32 previousTickleState = 1 << m_currentTickleState;
this->m_previousTickleStates |= previousTickleState;
this->m_currentTickleState = TickleState_Idle;
this->m_currentTickleState = e_idle;
}
// FUNCTION: LEGO1 0x100b4fc0
@@ -96,7 +96,7 @@ void MxPresenter::ParseExtra()
MxS32 val = token ? atoi(token) : 0;
MxEntity* result = MxOmni::GetInstance()->FindWorld(buf, val, this);
m_action->SetFlags(m_action->GetFlags() | MxDSAction::Flag_World);
m_action->SetFlags(m_action->GetFlags() | MxDSAction::c_world);
if (result)
SendToCompositePresenter(MxOmni::GetInstance());
@@ -112,11 +112,11 @@ void MxPresenter::SendToCompositePresenter(MxOmni* p_omni)
#ifdef COMPAT_MODE
{
MxNotificationParam param(MXPRESENTER_NOTIFICATION, this);
MxNotificationParam param(c_notificationPresenter, this);
NotificationManager()->Send(m_compositePresenter, &param);
}
#else
NotificationManager()->Send(m_compositePresenter, &MxNotificationParam(MXPRESENTER_NOTIFICATION, this));
NotificationManager()->Send(m_compositePresenter, &MxNotificationParam(c_notificationPresenter, this));
#endif
m_action->SetOrigin(p_omni ? p_omni : MxOmni::GetInstance());
@@ -130,32 +130,32 @@ MxResult MxPresenter::Tickle()
MxAutoLocker lock(&this->m_criticalSection);
switch (this->m_currentTickleState) {
case TickleState_Ready:
case e_ready:
this->ReadyTickle();
if (m_currentTickleState != TickleState_Starting)
if (m_currentTickleState != e_starting)
break;
case TickleState_Starting:
case e_starting:
this->StartingTickle();
if (m_currentTickleState != TickleState_Streaming)
if (m_currentTickleState != e_streaming)
break;
case TickleState_Streaming:
case e_streaming:
this->StreamingTickle();
if (m_currentTickleState != TickleState_Repeating)
if (m_currentTickleState != e_repeating)
break;
case TickleState_Repeating:
case e_repeating:
this->RepeatingTickle();
if (m_currentTickleState != TickleState_unk5)
if (m_currentTickleState != e_unk5)
break;
case TickleState_unk5:
case e_unk5:
this->Unk5Tickle();
if (m_currentTickleState != TickleState_Done)
if (m_currentTickleState != e_done)
break;
case TickleState_Done:
case e_done:
this->DoneTickle();
default:
break;
@@ -171,9 +171,9 @@ void MxPresenter::Enable(MxBool p_enable)
MxU32 flags = this->m_action->GetFlags();
if (p_enable)
this->m_action->SetFlags(flags | MxDSAction::Flag_Enabled);
this->m_action->SetFlags(flags | MxDSAction::c_enabled);
else
this->m_action->SetFlags(flags & ~MxDSAction::Flag_Enabled);
this->m_action->SetFlags(flags & ~MxDSAction::c_enabled);
}
}
@@ -185,7 +185,7 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
if (!name || strlen(name) == 0) {
switch (p_action.GetType()) {
case MxDSType_Anim:
case MxDSObject::e_anim:
format = ((MxDSAnim&) p_action).GetMediaFormat();
switch (format) {
case FOURCC(' ', 'F', 'L', 'C'):
@@ -197,7 +197,7 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
}
break;
case MxDSType_Sound:
case MxDSObject::e_sound:
format = ((MxDSSound&) p_action).GetMediaFormat();
switch (format) {
case FOURCC(' ', 'M', 'I', 'D'):
@@ -209,17 +209,17 @@ const char* PresenterNameDispatch(const MxDSAction& p_action)
}
break;
case MxDSType_SerialAction:
case MxDSType_ParallelAction:
case MxDSType_SelectAction:
case MxDSObject::e_serialAction:
case MxDSObject::e_parallelAction:
case MxDSObject::e_selectAction:
name = "MxCompositePresenter";
break;
case MxDSType_Event:
case MxDSObject::e_event:
name = "MxEventPresenter";
break;
case MxDSType_Still:
case MxDSObject::e_still:
name = "MxStillPresenter";
break;
}
@@ -252,5 +252,5 @@ MxEntity* MxPresenter::CreateEntity(const char* p_name)
// FUNCTION: LEGO1 0x100b54c0
MxBool MxPresenter::IsEnabled()
{
return this->m_action && this->m_action->GetFlags() & MxDSAction::Flag_Enabled;
return this->m_action && this->m_action->GetFlags() & MxDSAction::c_enabled;
}

View File

@@ -71,7 +71,7 @@ void MxEventPresenter::ReadyTickle()
CopyData(chunk);
m_subscriber->DestroyChunk(chunk);
ParseExtra();
ProgressTickleState(TickleState_Starting);
ProgressTickleState(e_starting);
}
}
@@ -81,7 +81,7 @@ void MxEventPresenter::StartingTickle()
MxStreamChunk* chunk = CurrentChunk();
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime())
ProgressTickleState(TickleState_Streaming);
ProgressTickleState(e_streaming);
}
// FUNCTION: LEGO1 0x100c2ef0
@@ -90,8 +90,8 @@ MxResult MxEventPresenter::PutData()
MxAutoLocker lock(&m_criticalSection);
if (IsEnabled()) {
if (m_currentTickleState >= TickleState_Streaming &&
(m_currentTickleState <= TickleState_Repeating || m_currentTickleState == TickleState_Done)) {
if (m_currentTickleState >= e_streaming &&
(m_currentTickleState <= e_repeating || m_currentTickleState == e_done)) {
if (m_currentChunk && m_currentChunk->GetLength()) {
if (m_data[12] == 2) {
const char* data = (const char*) m_currentChunk->GetData();
@@ -103,7 +103,7 @@ MxResult MxEventPresenter::PutData()
variableTable->SetVariable(key, value);
}
if (m_currentTickleState == TickleState_Streaming)
if (m_currentTickleState == e_streaming)
m_subscriber->DestroyChunk(m_currentChunk);
m_currentChunk = NULL;
}

View File

@@ -129,7 +129,7 @@ void MxDiskStreamController::FUN_100c7980()
if (m_unk0x3c.size() && m_unk0x8c < m_provider->GetStreamBuffersNum()) {
buffer = new MxDSBuffer();
if (buffer->AllocateBuffer(m_provider->GetFileSize(), MxDSBufferType_Chunk) != SUCCESS) {
if (buffer->AllocateBuffer(m_provider->GetFileSize(), MxDSBuffer::e_chunk) != SUCCESS) {
if (buffer)
delete buffer;
return;
@@ -213,10 +213,10 @@ void MxDiskStreamController::FUN_100c7cb0(MxDSStreamingAction* p_action)
void MxDiskStreamController::FUN_100c7ce0(MxDSBuffer* p_buffer)
{
switch (p_buffer->GetMode()) {
case MxDSBufferType_Chunk:
case MxDSBuffer::e_chunk:
m_unk0x8c--;
case MxDSBufferType_Allocate:
case MxDSBufferType_Unknown:
case MxDSBuffer::e_allocate:
case MxDSBuffer::e_unknown:
delete p_buffer;
break;
}

View File

@@ -174,7 +174,7 @@ MxResult MxDiskStreamProvider::FUN_100d1780(MxDSStreamingAction* p_action)
if (!buffer)
return FAILURE;
if (buffer->AllocateBuffer(GetFileSize(), MxDSBufferType_Allocate) != SUCCESS) {
if (buffer->AllocateBuffer(GetFileSize(), MxDSBuffer::e_allocate) != SUCCESS) {
delete buffer;
return FAILURE;
}
@@ -282,7 +282,7 @@ MxResult MxDiskStreamProvider::FUN_100d1b20(MxDSStreamingAction* p_action)
MxU32 size = p_action->GetUnknowna0()->GetWriteOffset() - p_action->GetUnknown94() + p_action->GetBufferOffset() +
(p_action->GetUnknowna4() ? p_action->GetUnknowna4()->GetWriteOffset() : 0);
if (buffer->AllocateBuffer(size, MxDSBufferType_Allocate) != SUCCESS) {
if (buffer->AllocateBuffer(size, MxDSBuffer::e_allocate) != SUCCESS) {
if (!buffer)
return FAILURE;
@@ -330,12 +330,12 @@ MxResult MxDiskStreamProvider::FUN_100d1b20(MxDSStreamingAction* p_action)
if (!buffer3)
return FAILURE;
if (buffer3->AllocateBuffer(size, MxDSBufferType_Allocate) == SUCCESS) {
if (buffer3->AllocateBuffer(size, MxDSBuffer::e_allocate) == SUCCESS) {
memcpy(buffer3->GetBuffer(), p_action->GetUnknowna4()->GetBuffer(), size);
p_action->GetUnknowna4()->SetMode(MxDSBufferType_Allocate);
p_action->GetUnknowna4()->SetMode(MxDSBuffer::e_allocate);
delete p_action->GetUnknowna4();
buffer3->SetMode(MxDSBufferType_Unknown);
buffer3->SetMode(MxDSBuffer::e_unknown);
p_action->SetUnknowna4(buffer3);
MxDSBuffer* buffer4 = p_action->GetUnknowna0();
MxU32 unk0x14 = buffer4->GetUnknown14();

View File

@@ -22,7 +22,7 @@ MxDSBuffer::MxDSBuffer()
m_unk0x1c = 0;
m_writeOffset = 0;
m_bytesRemaining = 0;
m_mode = MxDSBufferType_Preallocated;
m_mode = e_preallocated;
m_unk0x30 = 0;
}
@@ -31,12 +31,12 @@ MxDSBuffer::~MxDSBuffer()
{
if (m_pBuffer != NULL) {
switch (m_mode) {
case MxDSBufferType_Allocate:
case MxDSBufferType_Unknown:
case e_allocate:
case e_unknown:
delete[] m_pBuffer;
break;
case MxDSBufferType_Chunk: {
case e_chunk: {
MxU32 offset = m_writeOffset / 1024;
MxStreamer* streamer = Streamer();
@@ -77,16 +77,16 @@ MxDSBuffer::~MxDSBuffer()
}
// FUNCTION: LEGO1 0x100c6640
MxResult MxDSBuffer::AllocateBuffer(MxU32 p_bufferSize, MxDSBufferType p_mode)
MxResult MxDSBuffer::AllocateBuffer(MxU32 p_bufferSize, Type p_mode)
{
MxResult result = FAILURE;
switch (p_mode) {
case MxDSBufferType_Allocate:
case e_allocate:
m_pBuffer = new MxU8[p_bufferSize];
break;
case MxDSBufferType_Chunk: {
case e_chunk: {
MxStreamer* streamer = Streamer();
switch (p_bufferSize / 1024) {
@@ -150,7 +150,7 @@ MxResult MxDSBuffer::SetBufferPointer(MxU8* p_buffer, MxU32 p_size)
m_pIntoBuffer2 = p_buffer;
m_bytesRemaining = p_size;
m_writeOffset = p_size;
m_mode = MxDSBufferType_Preallocated;
m_mode = e_preallocated;
return SUCCESS;
}
@@ -291,24 +291,24 @@ MxResult MxDSBuffer::ParseChunk(
{
MxResult result = SUCCESS;
if (m_unk0x30->GetFlags() & MxDSAction::Flag_Bit3 && m_unk0x30->GetUnknowna8() && p_header->GetTime() < 0) {
if (m_unk0x30->GetFlags() & MxDSAction::c_bit3 && m_unk0x30->GetUnknowna8() && p_header->GetTime() < 0) {
delete p_header;
return SUCCESS;
}
p_header->SetTime(p_header->GetTime() + m_unk0x30->GetUnknowna8());
if (p_header->GetFlags() & MxDSChunk::Flag_Split) {
if (p_header->GetFlags() & MxDSChunk::c_split) {
MxU32 length = p_header->GetLength() + MxDSChunk::GetHeaderSize() + 8;
MxDSBuffer* buffer = new MxDSBuffer();
if (buffer && buffer->AllocateBuffer(length, MxDSBufferType_Allocate) == SUCCESS &&
if (buffer && buffer->AllocateBuffer(length, e_allocate) == SUCCESS &&
buffer->CalcBytesRemaining((MxU8*) p_data) == SUCCESS) {
*p_streamingAction = new MxDSStreamingAction((MxDSStreamingAction&) *p_action);
if (*p_streamingAction) {
MxU16* flags = MxStreamChunk::IntoFlags(buffer->GetBuffer());
*flags = p_header->GetFlags() & ~MxDSChunk::Flag_Split;
*flags = p_header->GetFlags() & ~MxDSChunk::c_split;
delete p_header;
(*p_streamingAction)->SetUnknowna0(buffer);
@@ -323,9 +323,9 @@ MxResult MxDSBuffer::ParseChunk(
return FAILURE;
}
else {
if (p_header->GetFlags() & MxDSChunk::Flag_End) {
if (p_header->GetFlags() & MxDSChunk::c_end) {
if (m_unk0x30->HasId(p_header->GetObjectId())) {
if (m_unk0x30->GetFlags() & MxDSAction::Flag_Bit3 &&
if (m_unk0x30->GetFlags() & MxDSAction::c_bit3 &&
(m_unk0x30->GetLoopCount() > 1 || m_unk0x30->GetDuration() == -1)) {
if (p_action->GetObjectId() == p_header->GetObjectId()) {
@@ -456,7 +456,7 @@ MxResult MxDSBuffer::CalcBytesRemaining(MxU8* p_data)
{
MxResult result = FAILURE;
if (m_mode == MxDSBufferType_Allocate && m_bytesRemaining != 0) {
if (m_mode == e_allocate && m_bytesRemaining != 0) {
MxU32 bytesRead;
MxU8* ptr;

View File

@@ -15,7 +15,7 @@ MxDSChunk::MxDSChunk()
// FUNCTION: LEGO1 0x100be170
MxDSChunk::~MxDSChunk()
{
if (m_flags & Flag_Bit1)
if (m_flags & c_bit1)
delete[] m_data;
}

View File

@@ -119,7 +119,7 @@ void MxDSSubscriber::DestroyChunk(MxStreamChunk* p_chunk)
if (p_chunk)
delete p_chunk;
}
else if (p_chunk->GetFlags() & MxDSChunk::Flag_Bit1 && p_chunk)
else if (p_chunk->GetFlags() & MxDSChunk::c_bit1 && p_chunk)
delete p_chunk;
}
}

View File

@@ -124,22 +124,22 @@ MxU32 ReadData(MxU8* p_buffer, MxU32 p_size)
data += MxDSChunk::Size(*psize);
if ((*MxDSChunk::IntoType(data2) == FOURCC('M', 'x', 'C', 'h')) &&
(*MxStreamChunk::IntoFlags(data2) & MxDSChunk::Flag_Split)) {
(*MxStreamChunk::IntoFlags(data2) & MxDSChunk::c_split)) {
if (*MxStreamChunk::IntoObjectId(data2) == *MxStreamChunk::IntoObjectId(data3) &&
(*MxStreamChunk::IntoFlags(data3) & MxDSChunk::Flag_Split) &&
(*MxStreamChunk::IntoFlags(data3) & MxDSChunk::c_split) &&
*MxStreamChunk::IntoTime(data2) == *MxStreamChunk::IntoTime(data3)) {
MxDSBuffer::Append(data2, data3);
continue;
}
else
*MxStreamChunk::IntoFlags(data2) &= ~MxDSChunk::Flag_Split;
*MxStreamChunk::IntoFlags(data2) &= ~MxDSChunk::c_split;
}
data2 += MxDSChunk::Size(*MxDSChunk::IntoLength(data2));
memcpy(data2, data3, MxDSChunk::Size(*psize));
if (*MxStreamChunk::IntoObjectId(data2) == id &&
(*MxStreamChunk::IntoFlags(data2) & MxDSChunk::Flag_End))
(*MxStreamChunk::IntoFlags(data2) & MxDSChunk::c_end))
break;
}
else
@@ -151,6 +151,6 @@ MxU32 ReadData(MxU8* p_buffer, MxU32 p_size)
} while (data < end);
}
*MxStreamChunk::IntoFlags(data2) &= ~MxDSChunk::Flag_Split;
*MxStreamChunk::IntoFlags(data2) &= ~MxDSChunk::c_split;
return MxDSChunk::End(data2) - p_buffer;
}

View File

@@ -54,7 +54,7 @@ MxResult MxStreamChunk::SendChunk(MxStreamListMxDSSubscriber& p_subscriberList,
{
for (MxStreamListMxDSSubscriber::iterator it = p_subscriberList.begin(); it != p_subscriberList.end(); it++) {
if ((*it)->GetObjectId() == m_objectId && (*it)->GetUnknown48() == p_obj24val) {
if (m_flags & MxDSChunk::Flag_End && m_buffer) {
if (m_flags & MxDSChunk::c_end && m_buffer) {
m_buffer->ReleaseRef(this);
m_buffer = NULL;
}

View File

@@ -82,7 +82,7 @@ MxResult MxStreamController::Open(const char* p_filename)
MxAutoLocker lock(&m_criticalSection);
MakeSourceName(sourceName, p_filename);
this->m_atom = MxAtomId(sourceName, LookupMode_LowerCase2);
this->m_atom = MxAtomId(sourceName, e_lowerCase2);
return SUCCESS;
}
@@ -271,7 +271,7 @@ MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action)
if (!chunk)
return FAILURE;
chunk->SetFlags(MxDSChunk::Flag_Bit3);
chunk->SetFlags(MxDSChunk::c_bit3);
chunk->SetObjectId(objectId);
if (chunk->SendChunk(m_subscriberList, FALSE, p_action->GetUnknown24()) != SUCCESS)

View File

@@ -50,7 +50,7 @@ MxStreamController* MxStreamer::Open(const char* p_name, MxU16 p_lookupType)
if (!GetOpenStream(p_name)) {
switch (p_lookupType) {
case e_DiskStream:
case e_diskStream:
stream = new MxDiskStreamController();
break;
case e_RAMStream:
@@ -84,11 +84,11 @@ MxLong MxStreamer::Close(const char* p_name)
else {
#ifdef COMPAT_MODE
{
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
MxStreamerNotification notification(c_notificationStreamer, NULL, c);
NotificationManager()->Send(this, &notification);
}
#else
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
NotificationManager()->Send(this, &MxStreamerNotification(c_notificationStreamer, NULL, c));
#endif
}
@@ -184,7 +184,7 @@ MxBool MxStreamer::FUN_100b9b30(MxDSObject& p_dsObject)
// FUNCTION: LEGO1 0x100b9b60
MxLong MxStreamer::Notify(MxParam& p_param)
{
if (((MxNotificationParam&) p_param).GetNotification() == MXSTREAMER_DELETE_NOTIFY) {
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationStreamer) {
MxDSAction ds;
ds.SetUnknown24(-2);
@@ -196,11 +196,11 @@ MxLong MxStreamer::Notify(MxParam& p_param)
else {
#ifdef COMPAT_MODE
{
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
MxStreamerNotification notification(c_notificationStreamer, NULL, c);
NotificationManager()->Send(this, &notification);
}
#else
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
NotificationManager()->Send(this, &MxStreamerNotification(c_notificationStreamer, NULL, c));
#endif
}
}

View File

@@ -34,7 +34,7 @@ void MxDisplaySurface::Init()
}
// FUNCTION: LEGO1 0x100ba640
void MxDisplaySurface::FUN_100ba640()
void MxDisplaySurface::ClearScreen()
{
MxS32 backBuffers;
DDSURFACEDESC desc;

View File

@@ -12,8 +12,8 @@ DECOMP_SIZE_ASSERT(MxFlcPresenter, 0x68);
MxFlcPresenter::MxFlcPresenter()
{
this->m_flicHeader = NULL;
this->m_flags &= ~Flag_Bit2;
this->m_flags &= ~Flag_Bit3;
this->m_flags &= ~c_bit2;
this->m_flags &= ~c_bit3;
}
// FUNCTION: LEGO1 0x100b3420

View File

@@ -20,8 +20,8 @@ MxLoopingFlcPresenter::~MxLoopingFlcPresenter()
void MxLoopingFlcPresenter::Init()
{
this->m_unk0x68 = 0;
this->m_flags &= ~Flag_Bit2;
this->m_flags &= ~Flag_Bit3;
this->m_flags &= ~c_bit2;
this->m_flags &= ~c_bit3;
}
// FUNCTION: LEGO1 0x100b4430
@@ -40,8 +40,8 @@ void MxLoopingFlcPresenter::NextFrame()
{
MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxDSChunk::Flag_End)
ProgressTickleState(TickleState_Repeating);
if (chunk->GetFlags() & MxDSChunk::c_end)
ProgressTickleState(e_repeating);
else {
LoadFrame(chunk);
LoopChunk(chunk);

View File

@@ -21,8 +21,8 @@ MxLoopingSmkPresenter::~MxLoopingSmkPresenter()
void MxLoopingSmkPresenter::Init()
{
this->m_elapsedDuration = 0;
this->m_flags &= ~Flag_Bit2;
this->m_flags &= ~Flag_Bit3;
this->m_flags &= ~c_bit2;
this->m_flags &= ~c_bit3;
}
// FUNCTION: LEGO1 0x100b49d0
@@ -51,8 +51,8 @@ void MxLoopingSmkPresenter::NextFrame()
{
MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxDSChunk::Flag_End)
ProgressTickleState(TickleState_Repeating);
if (chunk->GetFlags() & MxDSChunk::c_end)
ProgressTickleState(e_repeating);
else {
LoadFrame(chunk);
LoopChunk(chunk);
@@ -66,7 +66,7 @@ void MxLoopingSmkPresenter::NextFrame()
void MxLoopingSmkPresenter::VTable0x8c()
{
if (m_action->GetDuration() < m_elapsedDuration)
ProgressTickleState(TickleState_unk5);
ProgressTickleState(e_unk5);
else {
MxStreamChunk* chunk;
m_loopingChunkCursor->Current(chunk);
@@ -108,7 +108,7 @@ void MxLoopingSmkPresenter::RepeatingTickle()
m_loopingChunkCursor->Next(chunk);
if (m_currentTickleState != TickleState_Repeating)
if (m_currentTickleState != e_repeating)
break;
}
}

View File

@@ -23,8 +23,8 @@ void MxSmkPresenter::Init()
{
m_currentFrame = 0;
memset(&m_mxSmack, 0, sizeof(m_mxSmack));
m_flags &= ~Flag_Bit2;
m_flags &= ~Flag_Bit3;
m_flags &= ~c_bit2;
m_flags &= ~c_bit3;
}
// FUNCTION: LEGO1 0x100b3900

View File

@@ -75,13 +75,13 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
MxRect32 rect(x, y, width + x, height + y);
MVideoManager()->InvalidateRect(rect);
if (m_flags & Flag_Bit2) {
if (m_flags & c_bit2) {
undefined4 und = 0;
m_unk0x58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->VTable0x44(
m_bitmap,
&und,
(m_flags & Flag_Bit4) / 8,
m_action->GetFlags() & MxDSAction::Flag_Bit4
(m_flags & c_bit4) / 8,
m_action->GetFlags() & MxDSAction::c_bit4
);
delete m_alpha;
@@ -91,9 +91,9 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
m_bitmap = NULL;
if (m_unk0x58 && und)
m_flags |= Flag_Bit3;
m_flags |= c_bit3;
else
m_flags &= ~Flag_Bit3;
m_flags &= ~c_bit3;
}
}
@@ -110,7 +110,7 @@ void MxStillPresenter::StartingTickle()
{
MxVideoPresenter::StartingTickle();
if (m_currentTickleState == TickleState_Streaming && ((MxDSMediaAction*) m_action)->GetPaletteManagement())
if (m_currentTickleState == e_streaming && ((MxDSMediaAction*) m_action)->GetPaletteManagement())
RealizePalette();
}
@@ -122,7 +122,7 @@ void MxStillPresenter::StreamingTickle()
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
m_chunkTime = chunk->GetTime();
NextFrame();
ProgressTickleState(TickleState_Repeating);
ProgressTickleState(e_repeating);
if (m_action->GetDuration() == -1 && m_compositePresenter)
m_compositePresenter->VTable0x60(this);
@@ -134,7 +134,7 @@ void MxStillPresenter::RepeatingTickle()
{
if (m_action->GetDuration() != -1) {
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration())
ProgressTickleState(TickleState_unk5);
ProgressTickleState(e_unk5);
}
}
@@ -185,8 +185,8 @@ void MxStillPresenter::ParseExtra()
{
MxPresenter::ParseExtra();
if (m_action->GetFlags() & MxDSAction::Flag_Bit5)
m_flags |= Flag_Bit4;
if (m_action->GetFlags() & MxDSAction::c_bit5)
m_flags |= c_bit4;
MxU32 len = m_action->GetExtraLength();
@@ -207,9 +207,9 @@ void MxStillPresenter::ParseExtra()
}
if (KeyValueStringParse(output, g_strBmpIsmap, buf)) {
m_flags |= Flag_Bit5;
m_flags &= ~Flag_Bit2;
m_flags &= ~Flag_Bit3;
m_flags |= c_bit5;
m_flags &= ~c_bit2;
m_flags &= ~c_bit3;
}
}

View File

@@ -117,16 +117,16 @@ void MxVideoPresenter::Init()
m_unk0x5c = 1;
m_unk0x58 = NULL;
m_unk0x60 = -1;
m_flags &= ~Flag_Bit1;
m_flags &= ~c_bit1;
if (MVideoManager() != NULL) {
MVideoManager();
m_flags |= Flag_Bit2;
m_flags &= ~Flag_Bit3;
m_flags |= c_bit2;
m_flags &= ~c_bit3;
}
m_flags &= ~Flag_Bit4;
m_flags &= ~Flag_Bit5;
m_flags &= ~c_bit4;
m_flags &= ~c_bit5;
}
// FUNCTION: LEGO1 0x100b27b0
@@ -138,8 +138,8 @@ void MxVideoPresenter::Destroy(MxBool p_fromDestructor)
if (m_unk0x58) {
m_unk0x58->Release();
m_unk0x58 = NULL;
m_flags &= ~Flag_Bit2;
m_flags &= ~Flag_Bit3;
m_flags &= ~c_bit2;
m_flags &= ~c_bit3;
}
if (MVideoManager() && (m_alpha || m_bitmap)) {
@@ -168,9 +168,9 @@ void MxVideoPresenter::NextFrame()
{
MxStreamChunk* chunk = NextChunk();
if (chunk->GetFlags() & MxDSChunk::Flag_End) {
if (chunk->GetFlags() & MxDSChunk::c_end) {
m_subscriber->DestroyChunk(chunk);
ProgressTickleState(TickleState_Repeating);
ProgressTickleState(e_repeating);
}
else {
LoadFrame(chunk);
@@ -182,7 +182,7 @@ void MxVideoPresenter::NextFrame()
MxBool MxVideoPresenter::IsHit(MxS32 p_x, MxS32 p_y)
{
MxDSAction* action = GetAction();
if ((action == NULL) || (((action->GetFlags() & MxDSAction::Flag_Bit11) == 0) && !IsEnabled()) ||
if ((action == NULL) || (((action->GetFlags() & MxDSAction::c_bit11) == 0) && !IsEnabled()) ||
(!m_bitmap && !m_alpha))
return FALSE;
@@ -234,7 +234,7 @@ MxBool MxVideoPresenter::IsHit(MxS32 p_x, MxS32 p_y)
if (m_flags & 0x10)
return (MxBool) *pixel;
if ((GetAction()->GetFlags() & MxDSAction::Flag_Bit4) && *pixel == 0)
if ((GetAction()->GetFlags() & MxDSAction::c_bit4) && *pixel == 0)
return FALSE;
return TRUE;
@@ -284,7 +284,7 @@ void MxVideoPresenter::PutFrame()
LPDIRECTDRAWSURFACE ddSurface = displaySurface->GetDirectDrawSurface2();
MxRect32 rectSrc, rectDest;
if (m_action->GetFlags() & MxDSAction::Flag_Bit5) {
if (m_action->GetFlags() & MxDSAction::c_bit5) {
if (m_unk0x58) {
// TODO: Match
rectSrc.SetPoint(MxPoint32(0, 0));
@@ -340,7 +340,7 @@ void MxVideoPresenter::PutFrame()
rectDest.SetBottom(rectDest.GetTop() + regionRect->GetHeight());
}
if (m_action->GetFlags() & MxDSAction::Flag_Bit4) {
if (m_action->GetFlags() & MxDSAction::c_bit4) {
if (m_unk0x58) {
if (PrepareRects(rectDest, rectSrc) >= 0)
ddSurface->Blt((LPRECT) &rectDest, m_unk0x58, (LPRECT) &rectSrc, DDBLT_KEYSRC, NULL);
@@ -387,7 +387,7 @@ void MxVideoPresenter::ReadyTickle()
LoadHeader(chunk);
m_subscriber->DestroyChunk(chunk);
ParseExtra();
ProgressTickleState(TickleState_Starting);
ProgressTickleState(e_starting);
}
}
@@ -398,14 +398,14 @@ void MxVideoPresenter::StartingTickle()
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
CreateBitmap();
ProgressTickleState(TickleState_Streaming);
ProgressTickleState(e_streaming);
}
}
// FUNCTION: LEGO1 0x100b2fe0
void MxVideoPresenter::StreamingTickle()
{
if (m_action->GetFlags() & MxDSAction::Flag_Bit10) {
if (m_action->GetFlags() & MxDSAction::c_bit10) {
if (!m_currentChunk)
MxMediaPresenter::StreamingTickle();
@@ -429,13 +429,13 @@ void MxVideoPresenter::StreamingTickle()
LoadFrame(m_currentChunk);
m_subscriber->DestroyChunk(m_currentChunk);
m_currentChunk = NULL;
m_flags |= Flag_Bit1;
m_flags |= c_bit1;
if (m_currentTickleState != TickleState_Streaming)
if (m_currentTickleState != e_streaming)
break;
}
if (m_flags & Flag_Bit1)
if (m_flags & c_bit1)
m_unk0x5c = 5;
}
}
@@ -444,7 +444,7 @@ void MxVideoPresenter::StreamingTickle()
void MxVideoPresenter::RepeatingTickle()
{
if (IsEnabled()) {
if (m_action->GetFlags() & MxDSAction::Flag_Bit10) {
if (m_action->GetFlags() & MxDSAction::c_bit10) {
if (!m_currentChunk)
MxMediaPresenter::RepeatingTickle();
@@ -467,13 +467,13 @@ void MxVideoPresenter::RepeatingTickle()
LoadFrame(m_currentChunk);
m_currentChunk = NULL;
m_flags |= Flag_Bit1;
m_flags |= c_bit1;
if (m_currentTickleState != TickleState_Repeating)
if (m_currentTickleState != e_repeating)
break;
}
if (m_flags & Flag_Bit1)
if (m_flags & c_bit1)
m_unk0x5c = 5;
}
}
@@ -490,10 +490,10 @@ void MxVideoPresenter::Unk5Tickle()
m_unk0x60 = m_action->GetElapsedTime();
if (m_action->GetElapsedTime() >= m_unk0x60 + ((MxDSMediaAction*) m_action)->GetSustainTime())
ProgressTickleState(TickleState_Done);
ProgressTickleState(e_done);
}
else
ProgressTickleState(TickleState_Done);
ProgressTickleState(e_done);
}
}
@@ -535,7 +535,7 @@ MxResult MxVideoPresenter::PutData()
{
MxAutoLocker lock(&m_criticalSection);
if (IsEnabled() && m_currentTickleState >= TickleState_Streaming && m_currentTickleState <= TickleState_unk5)
if (IsEnabled() && m_currentTickleState >= e_streaming && m_currentTickleState <= e_unk5)
PutFrame();
return SUCCESS;