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

@@ -114,7 +114,7 @@ void LegoAnimPresenter::ReadyTickle()
m_subscriber->DestroyChunk(chunk);
if (result == SUCCESS) {
ProgressTickleState(TickleState_Starting);
ProgressTickleState(e_starting);
ParseExtra();
}
else {
@@ -128,7 +128,7 @@ void LegoAnimPresenter::ReadyTickle()
void LegoAnimPresenter::StartingTickle()
{
// TODO
ProgressTickleState(TickleState_Streaming);
ProgressTickleState(e_streaming);
EndAction(); // Allow game to start
}
@@ -146,7 +146,7 @@ void LegoAnimPresenter::StreamingTickle()
}
}
else {
ProgressTickleState(TickleState_Done);
ProgressTickleState(e_done);
if (m_compositePresenter) {
if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
m_compositePresenter->VTable0x60(this);

View File

@@ -41,7 +41,7 @@ LegoMeterPresenter::LegoMeterPresenter()
m_unk0x6c = 0;
m_unk0x84 = 0;
m_type = 1;
m_flags &= ~Flag_Bit2;
m_flags &= ~c_bit2;
}
// FUNCTION: LEGO1 0x10043780

View File

@@ -31,7 +31,7 @@ void LegoModelPresenter::Destroy(MxBool p_fromDestructor)
void LegoModelPresenter::ReadyTickle()
{
// TODO
SetTickleState(TickleState_Starting);
SetTickleState(e_starting);
}
// STUB: LEGO1 0x100801b0

View File

@@ -77,7 +77,7 @@ void LegoPalettePresenter::ReadyTickle()
if (chunk) {
if (chunk->GetTime() <= m_action->GetElapsedTime()) {
ParseExtra();
ProgressTickleState(TickleState_Starting);
ProgressTickleState(e_starting);
chunk = m_subscriber->NextChunk();
MxResult result = ParsePalette(chunk);

View File

@@ -28,7 +28,7 @@ MxResult LegoTexturePresenter::PutData()
void LegoTexturePresenter::DoneTickle()
{
if (this->m_compositePresenter && !this->m_compositePresenter->VTable0x64(2)) {
SetTickleState(TickleState_Idle);
SetTickleState(e_idle);
return;
}

View File

@@ -230,7 +230,7 @@ void LegoVideoManager::MoveCursor(MxS32 p_cursorX, MxS32 p_cursorY)
MxResult LegoVideoManager::Tickle()
{
if (m_unk0x554 && !m_videoParam.Flags().GetFlipSurfaces() &&
TransitionManager()->GetTransitionType() == MxTransitionManager::NOT_TRANSITIONING)
TransitionManager()->GetTransitionType() == MxTransitionManager::e_notTransitioning)
Sleep(30);
m_stopWatch->Stop();
@@ -369,7 +369,7 @@ void LegoVideoManager::EnableFullScreenMovie(MxBool p_enable, MxBool p_scale)
m_fullScreenMovie = TRUE;
}
else {
m_displaySurface->FUN_100ba640();
m_displaySurface->ClearScreen();
m_displaySurface->GetVideoParam().Flags().SetF1bit3(FALSE);
// restore previous pallete
@@ -462,7 +462,7 @@ MxResult LegoVideoManager::ConfigureD3DRM()
MxAssignedDevice* assignedDevice = m_direct3d->GetAssignedDevice();
if (assignedDevice && assignedDevice->GetFlags() & MxAssignedDevice::Flag_HardwareMode) {
if (assignedDevice && assignedDevice->GetFlags() & MxAssignedDevice::c_hardwareMode) {
if (assignedDevice->GetDesc().dpcTriCaps.dwTextureFilterCaps & D3DPTFILTERCAPS_LINEAR)
d3drm->SetTextureQuality(D3DRMTEXTURE_LINEAR);

View File

@@ -17,7 +17,7 @@ RECT g_fullScreenRect = {0, 0, 640, 480};
MxTransitionManager::MxTransitionManager()
{
m_animationTimer = 0;
m_transitionType = NOT_TRANSITIONING;
m_transitionType = e_notTransitioning;
m_ddSurface = NULL;
m_waitIndicator = NULL;
m_copyBuffer = NULL;
@@ -57,22 +57,22 @@ MxResult MxTransitionManager::Tickle()
this->m_systemTime = timeGetTime();
switch (this->m_transitionType) {
case NO_ANIMATION:
case e_noAnimation:
TransitionNone();
break;
case DISSOLVE:
case e_dissolve:
TransitionDissolve();
break;
case PIXELATION:
case e_pixelation:
TransitionPixelation();
break;
case SCREEN_WIPE:
case e_screenWipe:
TransitionWipe();
break;
case WINDOWS:
case e_windows:
TransitionWindows();
break;
case BROKEN:
case e_broken:
TransitionBroken();
break;
}
@@ -87,7 +87,7 @@ MxResult MxTransitionManager::StartTransition(
MxBool p_playMusicInAnim
)
{
if (this->m_transitionType == NOT_TRANSITIONING) {
if (this->m_transitionType == e_notTransitioning) {
if (!p_playMusicInAnim) {
MxBackgroundAudioManager* backgroundAudioManager = BackgroundAudioManager();
backgroundAudioManager->Stop();
@@ -102,7 +102,7 @@ MxResult MxTransitionManager::StartTransition(
MxDSAction* action = m_waitIndicator->GetAction();
action->SetLoopCount(10000);
action->SetFlags(action->GetFlags() | MxDSAction::Flag_Bit10);
action->SetFlags(action->GetFlags() | MxDSAction::c_bit10);
}
MxU32 time = timeGetTime();
@@ -129,8 +129,8 @@ MxResult MxTransitionManager::StartTransition(
// FUNCTION: LEGO1 0x1004bc30
void MxTransitionManager::EndTransition(MxBool p_notifyWorld)
{
if (m_transitionType != NOT_TRANSITIONING) {
m_transitionType = NOT_TRANSITIONING;
if (m_transitionType != e_notTransitioning) {
m_transitionType = e_notTransitioning;
m_copyFlags.m_bit0 = FALSE;
@@ -142,11 +142,11 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld)
if (world) {
#ifdef COMPAT_MODE
{
MxNotificationParam param(MXTRANSITIONMANAGER_TRANSITIONENDED, this);
MxNotificationParam param(c_notificationTransitioned, this);
world->Notify(param);
}
#else
world->Notify(MxNotificationParam(MXTRANSITIONMANAGER_TRANSITIONENDED, this));
world->Notify(MxNotificationParam(c_notificationTransitioned, this));
#endif
}
}
@@ -157,7 +157,7 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld)
void MxTransitionManager::TransitionNone()
{
LegoVideoManager* videoManager = VideoManager();
videoManager->GetDisplaySurface()->FUN_100ba640();
videoManager->GetDisplaySurface()->ClearScreen();
EndTransition(TRUE);
}
@@ -475,7 +475,7 @@ void MxTransitionManager::SetWaitIndicator(MxVideoPresenter* p_waitIndicator)
{
// End current wait indicator
if (m_waitIndicator != NULL) {
m_waitIndicator->GetAction()->SetFlags(m_waitIndicator->GetAction()->GetFlags() & ~MxDSAction::Flag_World);
m_waitIndicator->GetAction()->SetFlags(m_waitIndicator->GetAction()->GetFlags() & ~MxDSAction::c_world);
m_waitIndicator->EndAction();
m_waitIndicator = NULL;
}
@@ -488,7 +488,7 @@ void MxTransitionManager::SetWaitIndicator(MxVideoPresenter* p_waitIndicator)
LegoVideoManager* videoManager = VideoManager();
videoManager->UnregisterPresenter(*m_waitIndicator);
if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::TickleState_Streaming) {
if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::e_streaming) {
m_waitIndicator->Tickle();
}
}
@@ -542,7 +542,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC p_ddsc)
m_waitIndicator->Tickle();
// Check if wait indicator has started
if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::TickleState_Streaming) {
if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::e_streaming) {
// Setup the copy rect
MxU32 copyPitch = (p_ddsc->ddpfPixelFormat.dwRGBBitCount / 8) *
(m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously
@@ -576,7 +576,7 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC p_ddsc)
}
// Setup display surface
if ((m_waitIndicator->GetAction()->GetFlags() & MxDSAction::Flag_Bit5) != 0) {
if ((m_waitIndicator->GetAction()->GetFlags() & MxDSAction::c_bit5) != 0) {
MxDisplaySurface* displaySurface = VideoManager()->GetDisplaySurface();
MxBool und = FALSE;
displaySurface->VTable0x2c(