Merge pull request #50 from foxtacles/isle-merge3

Merge from isledecomp/isle
This commit is contained in:
Christian Semmler 2024-12-29 09:29:32 -07:00 committed by GitHub
commit 34bfa1b345
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 267 additions and 223 deletions

View File

@ -292,7 +292,7 @@ add_lego1_static_library(omni
LEGO1/omni/src/video/mxpalette.cpp LEGO1/omni/src/video/mxpalette.cpp
LEGO1/omni/src/video/mxregion.cpp LEGO1/omni/src/video/mxregion.cpp
LEGO1/omni/src/video/mxregioncursor.cpp LEGO1/omni/src/video/mxregioncursor.cpp
LEGO1/omni/src/video/mxsmack.cpp LEGO1/omni/src/video/mxsmk.cpp
LEGO1/omni/src/video/mxsmkpresenter.cpp LEGO1/omni/src/video/mxsmkpresenter.cpp
LEGO1/omni/src/video/mxstillpresenter.cpp LEGO1/omni/src/video/mxstillpresenter.cpp
LEGO1/omni/src/video/mxvideomanager.cpp LEGO1/omni/src/video/mxvideomanager.cpp

View File

@ -69,9 +69,9 @@ struct InfocenterMapEntry {
// FUNCTION: LEGO1 0x1006ec80 // FUNCTION: LEGO1 0x1006ec80
InfocenterMapEntry() {} InfocenterMapEntry() {}
MxStillPresenter* m_presenter; // 0x00 MxStillPresenter* m_destCtl; // 0x00
undefined4 m_unk0x04; // 0x04 undefined4 m_unk0x04; // 0x04
MxRect32 m_area; // 0x08 MxRect32 m_area; // 0x08
}; };
// VTABLE: LEGO1 0x100d9338 // VTABLE: LEGO1 0x100d9338
@ -161,9 +161,9 @@ private:
Cutscene m_currentCutscene; // 0x108 Cutscene m_currentCutscene; // 0x108
Radio m_radio; // 0x10c Radio m_radio; // 0x10c
MxStillPresenter* m_unk0x11c; // 0x11c MxStillPresenter* m_unk0x11c; // 0x11c
InfocenterMapEntry m_mapAreas[7]; // 0x120 InfocenterMapEntry m_glowInfo[7]; // 0x120
MxS16 m_unk0x1c8; // 0x1c8 MxS16 m_unk0x1c8; // 0x1c8
MxStillPresenter* m_frameHotBitmap; // 0x1cc MxStillPresenter* m_frame; // 0x1cc
MxS16 m_infoManDialogueTimer; // 0x1d0 MxS16 m_infoManDialogueTimer; // 0x1d0
MxS16 m_bookAnimationTimer; // 0x1d2 MxS16 m_bookAnimationTimer; // 0x1d2
MxU16 m_unk0x1d4; // 0x1d4 MxU16 m_unk0x1d4; // 0x1d4

View File

@ -1206,7 +1206,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param)
assert(destWorld); assert(destWorld);
m_buildState->m_animationState = LegoVehicleBuildState::e_exiting; m_buildState->m_animationState = LegoVehicleBuildState::e_exiting;
if (m_unk0x258->AllPartsPlaced()) { if (!m_unk0x258->AllPartsPlaced()) {
FUN_100243a0(); FUN_100243a0();
} }
else { else {
@ -1214,8 +1214,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param)
} }
} }
else { else {
MxNotificationParam param; NotificationManager()->Send(this, MxNotificationParam());
NotificationManager()->Send(this, param);
} }
break; break;
case 2: case 2:
@ -1242,9 +1241,8 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param)
FUN_10024ef0(); FUN_10024ef0();
} }
else { else {
MxNotificationParam p;
// In BETA10, NotificationManager->Send() also takes __FILE__ and __LINE__ arguments // In BETA10, NotificationManager->Send() also takes __FILE__ and __LINE__ arguments
NotificationManager()->Send(this, p); NotificationManager()->Send(this, MxNotificationParam());
} }
break; break;
} }

View File

@ -2345,11 +2345,11 @@ MxBool LegoAnimationManager::FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_
{ {
const char** cycles = g_cycles[g_characters[p_characterId].m_unk0x16]; const char** cycles = g_cycles[g_characters[p_characterId].m_unk0x16];
const char* vehicleWC; const char* vehicleWC;
LegoLocomotionAnimPresenter* presenter;
if (g_characters[p_characterId].m_vehicleId >= 0 && g_vehicles[g_characters[p_characterId].m_vehicleId].m_unk0x04 && if (g_characters[p_characterId].m_vehicleId >= 0 && g_vehicles[g_characters[p_characterId].m_vehicleId].m_unk0x04 &&
(vehicleWC = cycles[10]) != NULL) { (vehicleWC = cycles[10]) != NULL) {
LegoLocomotionAnimPresenter* presenter = presenter = (LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
if (presenter != NULL) { if (presenter != NULL) {
presenter->FUN_1006d680(p_actor, 1.7f); presenter->FUN_1006d680(p_actor, 1.7f);
@ -2362,8 +2362,7 @@ MxBool LegoAnimationManager::FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_
else { else {
vehicleWC = cycles[p_mood]; vehicleWC = cycles[p_mood];
if (vehicleWC != NULL) { if (vehicleWC != NULL) {
LegoLocomotionAnimPresenter* presenter = presenter = (LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
if (presenter != NULL) { if (presenter != NULL) {
presenter->FUN_1006d680(p_actor, 0.7f); presenter->FUN_1006d680(p_actor, 0.7f);
@ -2376,8 +2375,7 @@ MxBool LegoAnimationManager::FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_
vehicleWC = cycles[p_mood + 4]; vehicleWC = cycles[p_mood + 4];
if (vehicleWC != NULL) { if (vehicleWC != NULL) {
LegoLocomotionAnimPresenter* presenter = presenter = (LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
if (presenter != NULL) { if (presenter != NULL) {
presenter->FUN_1006d680(p_actor, 4.0f); presenter->FUN_1006d680(p_actor, 4.0f);
@ -2390,8 +2388,7 @@ MxBool LegoAnimationManager::FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_
vehicleWC = cycles[p_mood + 7]; vehicleWC = cycles[p_mood + 7];
if (vehicleWC != NULL) { if (vehicleWC != NULL) {
LegoLocomotionAnimPresenter* presenter = presenter = (LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
(LegoLocomotionAnimPresenter*) p_world->Find("LegoAnimPresenter", vehicleWC);
if (presenter != NULL) { if (presenter != NULL) {
presenter->FUN_1006d680(p_actor, 0.0f); presenter->FUN_1006d680(p_actor, 0.0f);
@ -2484,6 +2481,8 @@ MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnkn
Vector3* v1 = p_edge->CWVertex(*p_boundary); Vector3* v1 = p_edge->CWVertex(*p_boundary);
Vector3* v2 = p_edge->CCWVertex(*p_boundary); Vector3* v2 = p_edge->CCWVertex(*p_boundary);
assert(v1 && v2);
p1 = *v2; p1 = *v2;
p1 -= *v1; p1 -= *v1;
p1 *= p_destScale; p1 *= p_destScale;
@ -2496,7 +2495,12 @@ MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnkn
boundingBox.Min() -= vec; boundingBox.Min() -= vec;
boundingBox.Max() = p1; boundingBox.Max() = p1;
boundingBox.Max() += vec; boundingBox.Max() += vec;
return GetViewManager()->IsBoundingBoxInFrustum(boundingBox) == FALSE;
if (GetViewManager()->IsBoundingBoxInFrustum(boundingBox) == FALSE) {
return TRUE;
}
return FALSE;
} }
// FUNCTION: LEGO1 0x10064120 // FUNCTION: LEGO1 0x10064120

View File

@ -129,7 +129,7 @@ void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
if (p_roi) { if (p_roi) {
const char* name = p_roi->GetName(); const char* name = p_roi->GetName();
for (MxU32 i = 1; i <= sizeOfArray(g_actorNames) - 1; i++) { for (MxU32 i = 1; i <= sizeOfArray(g_actorNames) - 2; i++) {
if (!SDL_strcasecmp(name, g_actorNames[i])) { if (!SDL_strcasecmp(name, g_actorNames[i])) {
m_type = e_actor; m_type = e_actor;
m_actorId = i; m_actorId = i;

View File

@ -31,6 +31,11 @@
DECOMP_SIZE_ASSERT(LegoNavController, 0x70) DECOMP_SIZE_ASSERT(LegoNavController, 0x70)
// MSVC 4.20 didn't define a macro for this key
#ifndef VK_OEM_MINUS
#define VK_OEM_MINUS 0xBD
#endif
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#ifndef M_PI #ifndef M_PI
@ -110,7 +115,7 @@ char g_debugPassword[] = "OGEL";
char* g_currentInput = g_debugPassword; char* g_currentInput = g_debugPassword;
// GLOBAL: LEGO1 0x100f66cc // GLOBAL: LEGO1 0x100f66cc
MxS32 g_unk0x100f66cc = -1; MxS32 g_nextCharacter = -1;
// GLOBAL: LEGO1 0x100f66d0 // GLOBAL: LEGO1 0x100f66d0
MxBool g_enableMusic = TRUE; MxBool g_enableMusic = TRUE;
@ -581,29 +586,33 @@ MxResult LegoNavController::ProcessKeyboardInput()
m_unk0x6c = TRUE; m_unk0x6c = TRUE;
MxS32 hMax; MxS32 hMax;
if ((keyFlags & LegoInputManager::c_leftOrRight) == LegoInputManager::c_left) { switch (keyFlags & LegoInputManager::c_leftOrRight) {
case LegoInputManager::c_left:
hMax = 0; hMax = 0;
} break;
else if ((keyFlags & LegoInputManager::c_leftOrRight) == LegoInputManager::c_right) { case LegoInputManager::c_right:
hMax = m_hMax; hMax = m_hMax;
} break;
else { default:
m_targetRotationalVel = 0.0; m_targetRotationalVel = 0.0;
m_rotationalAccel = m_maxRotationalDeccel; m_rotationalAccel = m_maxRotationalDeccel;
bool1 = TRUE; bool1 = TRUE;
break;
} }
MxS32 vMax; MxS32 vMax;
if ((keyFlags & LegoInputManager::c_upOrDown) == LegoInputManager::c_up) { switch (keyFlags & LegoInputManager::c_upOrDown) {
case LegoInputManager::c_up:
vMax = 0; vMax = 0;
} break;
else if ((keyFlags & LegoInputManager::c_upOrDown) == LegoInputManager::c_down) { case LegoInputManager::c_down:
vMax = m_vMax; vMax = m_vMax;
} break;
else { default:
m_targetLinearVel = 0.0; m_targetLinearVel = 0.0;
m_linearAccel = m_maxLinearDeccel; m_linearAccel = m_maxLinearDeccel;
bool2 = TRUE; bool2 = TRUE;
break;
} }
MxFloat val = keyFlags & LegoInputManager::c_bit5 ? 1.0f : 4.0f; MxFloat val = keyFlags & LegoInputManager::c_bit5 ? 1.0f : 4.0f;
@ -692,29 +701,29 @@ MxLong LegoNavController::Notify(MxParam& p_param)
} }
break; break;
} }
case 'k': case VK_ADD:
case 'm': { // Keys need to be uppercased to trigger this code, but seems dysfunctional case VK_SUBTRACT: { // Cycles through characters and puts them in front of you
if (g_unk0x100f66cc == -1) { if (g_nextCharacter == -1) {
g_unk0x100f66cc = 0; g_nextCharacter = 0;
} }
else { else {
CharacterManager()->ReleaseActor(CharacterManager()->GetActorName(g_unk0x100f66cc)); CharacterManager()->ReleaseActor(CharacterManager()->GetActorName(g_nextCharacter));
if (key == 'k') { if (key == VK_ADD) {
g_unk0x100f66cc++; g_nextCharacter++;
if (g_unk0x100f66cc >= CharacterManager()->GetNumActors()) { if (g_nextCharacter >= CharacterManager()->GetNumActors()) {
g_unk0x100f66cc = 0; g_nextCharacter = 0;
} }
} }
else { else {
g_unk0x100f66cc--; g_nextCharacter--;
if (g_unk0x100f66cc < 0) { if (g_nextCharacter < 0) {
g_unk0x100f66cc = CharacterManager()->GetNumActors() - 1; g_nextCharacter = CharacterManager()->GetNumActors() - 1;
} }
} }
} }
LegoROI* roi = CharacterManager()->GetActorROI(CharacterManager()->GetActorName(g_unk0x100f66cc), TRUE); LegoROI* roi = CharacterManager()->GetActorROI(CharacterManager()->GetActorName(g_nextCharacter), TRUE);
if (roi != NULL) { if (roi != NULL) {
MxMatrix mat; MxMatrix mat;
ViewROI* viewRoi = LegoOmni::GetInstance()->GetVideoManager()->GetViewROI(); ViewROI* viewRoi = LegoOmni::GetInstance()->GetVideoManager()->GetViewROI();
@ -727,7 +736,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
} }
break; break;
} }
case '{': { // Saves the game. Can't actually be triggered case VK_F12: { // Saves the game
InfocenterState* state = (InfocenterState*) GameState()->GetState("InfocenterState"); InfocenterState* state = (InfocenterState*) GameState()->GetState("InfocenterState");
if (state && state->HasRegistered()) { if (state && state->HasRegistered()) {
GameState()->Save(0); GameState()->Save(0);
@ -993,7 +1002,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
case 'X': case 'X':
RealtimeView::SetUserMaxLOD(3.6); RealtimeView::SetUserMaxLOD(3.6);
break; break;
case 'j': { case VK_MULTIPLY: {
MxU8 newActor = GameState()->GetActorId() + 1; MxU8 newActor = GameState()->GetActorId() + 1;
if (newActor > LegoActor::c_laura) { if (newActor > LegoActor::c_laura) {
@ -1003,10 +1012,10 @@ MxLong LegoNavController::Notify(MxParam& p_param)
GameState()->SetActorId(newActor); GameState()->SetActorId(newActor);
break; break;
} }
case 'o': case VK_DIVIDE:
GameState()->SetActorId(LegoActor::c_brickster); GameState()->SetActorId(LegoActor::c_brickster);
break; break;
case 'z': case VK_F11:
if (GameState()->m_isDirty) { if (GameState()->m_isDirty) {
GameState()->m_isDirty = FALSE; GameState()->m_isDirty = FALSE;
} }
@ -1014,7 +1023,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
GameState()->m_isDirty = TRUE; GameState()->m_isDirty = TRUE;
} }
break; break;
case 0xbd: case VK_OEM_MINUS:
g_unk0x100f66bc = LegoAnimationManager::e_unk1; g_unk0x100f66bc = LegoAnimationManager::e_unk1;
break; break;
} }

View File

@ -556,15 +556,15 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
MxPresenter* presenter; MxPresenter* presenter;
while (cursor.Next(presenter)) { while (cursor.Next(presenter)) {
MxDSAction* action = presenter->GetAction(); if (!strcmp(presenter->GetAction()->GetObjectName(), p_name)) {
if (!strcmp(action->GetObjectName(), p_name)) {
return presenter; return presenter;
} }
} }
return NULL; return NULL;
} }
else if (!strcmp(p_class, "MxEntity")) {
if (!strcmp(p_class, "MxEntity")) {
LegoEntityListCursor cursor(m_entityList); LegoEntityListCursor cursor(m_entityList);
LegoEntity* entity; LegoEntity* entity;
@ -581,7 +581,8 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
return NULL; return NULL;
} }
else if (!strcmp(p_class, "LegoAnimPresenter")) {
if (!strcmp(p_class, "LegoAnimPresenter")) {
MxPresenterListCursor cursor(&m_animPresenters); MxPresenterListCursor cursor(&m_animPresenters);
MxPresenter* presenter; MxPresenter* presenter;
@ -593,20 +594,18 @@ MxCore* LegoWorld::Find(const char* p_class, const char* p_name)
return NULL; return NULL;
} }
else {
for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) {
if ((*it)->IsA(p_class) && (*it)->IsA("MxPresenter")) {
MxPresenter* presenter = (MxPresenter*) *it;
MxDSAction* action = presenter->GetAction();
if (!strcmp(action->GetObjectName(), p_name)) { for (MxCoreSet::iterator i = m_set0xa8.begin(); i != m_set0xa8.end(); i++) {
return *it; if ((*i)->IsA(p_class) && (*i)->IsA("MxPresenter")) {
} assert(((MxPresenter*) (*i))->GetAction());
if (!strcmp(((MxPresenter*) (*i))->GetAction()->GetObjectName(), p_name)) {
return *i;
} }
} }
return NULL;
} }
return NULL;
} }
// FUNCTION: LEGO1 0x10021790 // FUNCTION: LEGO1 0x10021790
@ -785,7 +784,7 @@ MxResult LegoWorld::Tickle()
ReadyWorld(); ReadyWorld();
return TRUE; return TRUE;
case e_two: case e_two:
if (PresentersPending()) { if (PresentersPending() == TRUE) {
break; break;
} }
default: default:

View File

@ -408,7 +408,7 @@ MxBool LegoInputManager::ProcessOneEvent(LegoEventNotificationParam& p_param)
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY()); LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
p_param.SetROI(roi); p_param.SetROI(roi);
if (roi && roi->GetVisibility()) { if (roi && roi->GetVisibility() == TRUE) {
for (OrientableROI* parent = roi->GetParentROI(); parent; parent = parent->GetParentROI()) { for (OrientableROI* parent = roi->GetParentROI(); parent; parent = parent->GetParentROI()) {
roi = (LegoROI*) parent; roi = (LegoROI*) parent;
} }

View File

@ -132,12 +132,12 @@ Infocenter::Infocenter()
m_selectedCharacter = e_noCharacter; m_selectedCharacter = e_noCharacter;
m_unk0x11c = NULL; m_unk0x11c = NULL;
m_infocenterState = NULL; m_infocenterState = NULL;
m_frameHotBitmap = NULL; m_frame = NULL;
m_destLocation = LegoGameState::e_undefined; m_destLocation = LegoGameState::e_undefined;
m_currentInfomainScript = InfomainScript::c_noneInfomain; m_currentInfomainScript = InfomainScript::c_noneInfomain;
m_currentCutscene = e_noIntro; m_currentCutscene = e_noIntro;
memset(&m_mapAreas, 0, sizeof(m_mapAreas)); memset(&m_glowInfo, 0, sizeof(m_glowInfo));
m_unk0x1c8 = -1; m_unk0x1c8 = -1;
SetAppCursor(e_cursorBusy); SetAppCursor(e_cursorBusy);
@ -612,6 +612,7 @@ void Infocenter::ReadyWorld()
} }
// FUNCTION: LEGO1 0x1006f9a0 // FUNCTION: LEGO1 0x1006f9a0
// FUNCTION: BETA10 0x1002ef2f
void Infocenter::InitializeBitmaps() void Infocenter::InitializeBitmaps()
{ {
m_radio.Initialize(TRUE); m_radio.Initialize(TRUE);
@ -632,56 +633,64 @@ void Infocenter::InitializeBitmaps()
((MxPresenter*) Find(m_atomId, InfomainScript::c_Laura_Ctl))->Enable(TRUE); ((MxPresenter*) Find(m_atomId, InfomainScript::c_Laura_Ctl))->Enable(TRUE);
((MxPresenter*) Find(m_atomId, InfomainScript::c_Radio_Ctl))->Enable(TRUE); ((MxPresenter*) Find(m_atomId, InfomainScript::c_Radio_Ctl))->Enable(TRUE);
m_mapAreas[0].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap"); m_glowInfo[0].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap");
m_mapAreas[0].m_area.SetLeft(391); assert(m_glowInfo[0].m_destCtl);
m_mapAreas[0].m_area.SetTop(182); m_glowInfo[0].m_area.SetLeft(391);
m_mapAreas[0].m_area.SetRight(427); m_glowInfo[0].m_area.SetTop(182);
m_mapAreas[0].m_area.SetBottom(230); m_glowInfo[0].m_area.SetRight(427);
m_mapAreas[0].m_unk0x04 = 3; m_glowInfo[0].m_area.SetBottom(230);
m_glowInfo[0].m_unk0x04 = 3;
m_mapAreas[1].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap"); m_glowInfo[1].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap");
m_mapAreas[1].m_area.SetLeft(304); assert(m_glowInfo[1].m_destCtl);
m_mapAreas[1].m_area.SetTop(225); m_glowInfo[1].m_area.SetLeft(304);
m_mapAreas[1].m_area.SetRight(350); m_glowInfo[1].m_area.SetTop(225);
m_mapAreas[1].m_area.SetBottom(268); m_glowInfo[1].m_area.SetRight(350);
m_mapAreas[1].m_unk0x04 = 10; m_glowInfo[1].m_area.SetBottom(268);
m_glowInfo[1].m_unk0x04 = 10;
m_mapAreas[2].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap"); m_glowInfo[2].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap");
m_mapAreas[2].m_area.SetLeft(301); assert(m_glowInfo[1].m_destCtl); // DECOMP: intentional typo
m_mapAreas[2].m_area.SetTop(133); m_glowInfo[2].m_area.SetLeft(301);
m_mapAreas[2].m_area.SetRight(347); m_glowInfo[2].m_area.SetTop(133);
m_mapAreas[2].m_area.SetBottom(181); m_glowInfo[2].m_area.SetRight(347);
m_mapAreas[2].m_unk0x04 = 11; m_glowInfo[2].m_area.SetBottom(181);
m_glowInfo[2].m_unk0x04 = 11;
m_mapAreas[3].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap"); m_glowInfo[3].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap");
m_mapAreas[3].m_area.SetLeft(289); assert(m_glowInfo[3].m_destCtl);
m_mapAreas[3].m_area.SetTop(182); m_glowInfo[3].m_area.SetLeft(289);
m_mapAreas[3].m_area.SetRight(335); m_glowInfo[3].m_area.SetTop(182);
m_mapAreas[3].m_area.SetBottom(225); m_glowInfo[3].m_area.SetRight(335);
m_mapAreas[3].m_unk0x04 = 12; m_glowInfo[3].m_area.SetBottom(225);
m_glowInfo[3].m_unk0x04 = 12;
m_mapAreas[4].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap"); m_glowInfo[4].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap");
m_mapAreas[4].m_area.SetLeft(350); assert(m_glowInfo[4].m_destCtl);
m_mapAreas[4].m_area.SetTop(161); m_glowInfo[4].m_area.SetLeft(350);
m_mapAreas[4].m_area.SetRight(391); m_glowInfo[4].m_area.SetTop(161);
m_mapAreas[4].m_area.SetBottom(209); m_glowInfo[4].m_area.SetRight(391);
m_mapAreas[4].m_unk0x04 = 13; m_glowInfo[4].m_area.SetBottom(209);
m_glowInfo[4].m_unk0x04 = 13;
m_mapAreas[5].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap"); m_glowInfo[5].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap");
m_mapAreas[5].m_area.SetLeft(392); assert(m_glowInfo[5].m_destCtl);
m_mapAreas[5].m_area.SetTop(130); m_glowInfo[5].m_area.SetLeft(392);
m_mapAreas[5].m_area.SetRight(438); m_glowInfo[5].m_area.SetTop(130);
m_mapAreas[5].m_area.SetBottom(176); m_glowInfo[5].m_area.SetRight(438);
m_mapAreas[5].m_unk0x04 = 14; m_glowInfo[5].m_area.SetBottom(176);
m_glowInfo[5].m_unk0x04 = 14;
m_mapAreas[6].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap"); m_glowInfo[6].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap");
m_mapAreas[6].m_area.SetLeft(396); assert(m_glowInfo[6].m_destCtl);
m_mapAreas[6].m_area.SetTop(229); m_glowInfo[6].m_area.SetLeft(396);
m_mapAreas[6].m_area.SetRight(442); m_glowInfo[6].m_area.SetTop(229);
m_mapAreas[6].m_area.SetBottom(272); m_glowInfo[6].m_area.SetRight(442);
m_mapAreas[6].m_unk0x04 = 15; m_glowInfo[6].m_area.SetBottom(272);
m_glowInfo[6].m_unk0x04 = 15;
m_frameHotBitmap = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap"); m_frame = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap");
assert(m_frame);
UpdateFrameHot(TRUE); UpdateFrameHot(TRUE);
} }
@ -831,7 +840,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
if (m_unk0x1c8 != -1) { if (m_unk0x1c8 != -1) {
m_infoManDialogueTimer = 0; m_infoManDialogueTimer = 0;
switch (m_mapAreas[m_unk0x1c8].m_unk0x04) { switch (m_glowInfo[m_unk0x1c8].m_unk0x04) {
case 3: case 3:
GameState()->SetActor(m_selectedCharacter); GameState()->SetActor(m_selectedCharacter);
@ -1304,11 +1313,11 @@ MxBool Infocenter::VTable0x5c()
void Infocenter::FUN_10070d10(MxS32 p_x, MxS32 p_y) void Infocenter::FUN_10070d10(MxS32 p_x, MxS32 p_y)
{ {
MxS16 i; MxS16 i;
for (i = 0; i < (MxS32) (sizeof(m_mapAreas) / sizeof(m_mapAreas[0])); i++) { for (i = 0; i < (MxS32) (sizeof(m_glowInfo) / sizeof(m_glowInfo[0])); i++) {
MxS32 right = m_mapAreas[i].m_area.GetRight(); MxS32 right = m_glowInfo[i].m_area.GetRight();
MxS32 bottom = m_mapAreas[i].m_area.GetBottom(); MxS32 bottom = m_glowInfo[i].m_area.GetBottom();
MxS32 left = m_mapAreas[i].m_area.GetLeft(); MxS32 left = m_glowInfo[i].m_area.GetLeft();
MxS32 top = m_mapAreas[i].m_area.GetTop(); MxS32 top = m_glowInfo[i].m_area.GetTop();
if (left <= p_x && p_x <= right && top <= p_y && p_y <= bottom) { if (left <= p_x && p_x <= right && top <= p_y && p_y <= bottom) {
break; break;
@ -1321,12 +1330,12 @@ void Infocenter::FUN_10070d10(MxS32 p_x, MxS32 p_y)
if (i != m_unk0x1c8) { if (i != m_unk0x1c8) {
if (m_unk0x1c8 != -1) { if (m_unk0x1c8 != -1) {
m_mapAreas[m_unk0x1c8].m_presenter->Enable(FALSE); m_glowInfo[m_unk0x1c8].m_destCtl->Enable(FALSE);
} }
m_unk0x1c8 = i; m_unk0x1c8 = i;
if (i != -1) { if (i != -1) {
m_mapAreas[i].m_presenter->Enable(TRUE); m_glowInfo[i].m_destCtl->Enable(TRUE);
} }
} }
} }
@ -1362,18 +1371,18 @@ void Infocenter::UpdateFrameHot(MxBool p_display)
return; return;
} }
MxS32 originalDisplayZ = m_frameHotBitmap->GetDisplayZ(); MxS32 originalDisplayZ = m_frame->GetDisplayZ();
m_frameHotBitmap->SetDisplayZ(1000); m_frame->SetDisplayZ(1000);
VideoManager()->SortPresenterList(); VideoManager()->SortPresenterList();
m_frameHotBitmap->Enable(TRUE); m_frame->Enable(TRUE);
m_frameHotBitmap->SetPosition(x, y); m_frame->SetPosition(x, y);
m_frameHotBitmap->SetDisplayZ(originalDisplayZ); m_frame->SetDisplayZ(originalDisplayZ);
} }
else { else {
if (m_frameHotBitmap) { if (m_frame) {
m_frameHotBitmap->Enable(FALSE); m_frame->Enable(FALSE);
} }
} }
} }

View File

@ -91,7 +91,7 @@ public:
// DECOMP: This could be a free function. It is static here because it has no // DECOMP: This could be a free function. It is static here because it has no
// reference to "this". In the beta it is called in two places: // reference to "this". In the beta it is called in two places:
// 1. GetBmiHeightAbs // 1. GetBmiHeightAbs
// 2. MxSmack::LoadFrame // 2. MxSmk::LoadFrame
// FUNCTION: BETA10 0x1002c690 // FUNCTION: BETA10 0x1002c690
static MxLong HeightAbs(MxLong p_value) { return p_value > 0 ? p_value : -p_value; } static MxLong HeightAbs(MxLong p_value) { return p_value > 0 ? p_value : -p_value; }

View File

@ -97,4 +97,7 @@ private:
// TEMPLATE: BETA10 0x10150e60 // TEMPLATE: BETA10 0x10150e60
// MxUtilityList<MxNextActionDataStart *>::PushBack // MxUtilityList<MxNextActionDataStart *>::PushBack
// TEMPLATE: BETA10 0x10150ff0
// MxUtilityList<MxDSObject *>::PushBack
#endif // MXDISKSTREAMCONTROLLER_H #endif // MXDISKSTREAMCONTROLLER_H

View File

@ -1,5 +1,5 @@
#ifndef MXSMACK_H #ifndef MXSMK_H
#define MXSMACK_H #define MXSMK_H
#include "decomp.h" #include "decomp.h"
#include "mxrectlist.h" #include "mxrectlist.h"
@ -10,15 +10,15 @@
struct MxBITMAPINFO; struct MxBITMAPINFO;
// SIZE 0x6b8 // SIZE 0x6b8
struct MxSmack { struct MxSmk {
smk m_smk; smk m_smk;
static MxResult LoadHeader(MxU8* p_data, MxU32 p_length, MxSmack* p_mxSmack); static MxResult LoadHeader(MxU8* p_data, MxU32 p_length, MxSmk* p_mxSmk);
static void Destroy(MxSmack* p_mxSmack); static void Destroy(MxSmk* p_mxSmk);
static MxResult LoadFrame( static MxResult LoadFrame(
MxBITMAPINFO* p_bitmapInfo, MxBITMAPINFO* p_bitmapInfo,
MxU8* p_bitmapData, MxU8* p_bitmapData,
MxSmack* p_mxSmack, MxSmk* p_mxSmk,
MxU8* p_chunkData, MxU8* p_chunkData,
MxBool& p_paletteChanged, MxBool& p_paletteChanged,
MxU32 p_currentFrame, MxU32 p_currentFrame,
@ -26,4 +26,4 @@ struct MxSmack {
); );
}; };
#endif // MXSMACK_H #endif // MXSMK_H

View File

@ -2,7 +2,7 @@
#define MXSMKPRESENTER_H #define MXSMKPRESENTER_H
#include "decomp.h" #include "decomp.h"
#include "mxsmack.h" #include "mxsmk.h"
#include "mxvideopresenter.h" #include "mxvideopresenter.h"
// VTABLE: LEGO1 0x100dc348 // VTABLE: LEGO1 0x100dc348
@ -48,7 +48,7 @@ private:
void Destroy(MxBool p_fromDestructor); void Destroy(MxBool p_fromDestructor);
protected: protected:
MxSmack m_mxSmack; // 0x64 MxSmk m_mxSmk; // 0x64
MxU32 m_currentFrame; // 0x71c MxU32 m_currentFrame; // 0x71c
}; };

View File

@ -74,14 +74,14 @@ public:
MxStreamProvider* GetProvider() { return m_provider; } MxStreamProvider* GetProvider() { return m_provider; }
MxDSObjectList& GetUnk0x3c() { return m_unk0x3c; } MxDSObjectList& GetUnk0x3c() { return m_unk0x3c; }
MxDSObjectList& GetUnk0x54() { return m_unk0x54; } MxDSObjectList& GetUnk0x54() { return m_unk0x54; }
MxDSSubscriberList& GetSubscriberList() { return m_subscriberList; } MxDSSubscriberList& GetSubscriberList() { return m_subscribers; }
protected: protected:
MxCriticalSection m_criticalSection; // 0x08 MxCriticalSection m_criticalSection; // 0x08
MxAtomId m_atom; // 0x24 MxAtomId m_atom; // 0x24
MxStreamProvider* m_provider; // 0x28 MxStreamProvider* m_provider; // 0x28
undefined4* m_unk0x2c; // 0x2c undefined4* m_unk0x2c; // 0x2c
MxDSSubscriberList m_subscriberList; // 0x30 MxDSSubscriberList m_subscribers; // 0x30
MxDSObjectList m_unk0x3c; // 0x3c MxDSObjectList m_unk0x3c; // 0x3c
MxNextActionDataStartList m_nextActionList; // 0x48 MxNextActionDataStartList m_nextActionList; // 0x48
MxDSObjectList m_unk0x54; // 0x54 MxDSObjectList m_unk0x54; // 0x54

View File

@ -39,17 +39,15 @@ void MxPresenter::Init()
} }
// FUNCTION: LEGO1 0x100b4d80 // FUNCTION: LEGO1 0x100b4d80
// FUNCTION: BETA10 0x1012e120
MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action) MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
this->m_action = p_action; m_action = p_action;
m_location = MxPoint32(m_action->GetLocation()[0], m_action->GetLocation()[1]);
m_displayZ = m_action->GetLocation()[2];
const Mx3DPointFloat& location = this->m_action->GetLocation();
MxS32 previousTickleState = this->m_currentTickleState;
this->m_location = MxPoint32(this->m_action->GetLocation()[0], this->m_action->GetLocation()[1]);
this->m_displayZ = this->m_action->GetLocation()[2];
ProgressTickleState(e_ready); ProgressTickleState(e_ready);
return SUCCESS; return SUCCESS;
@ -58,22 +56,22 @@ MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
// FUNCTION: LEGO1 0x100b4e40 // FUNCTION: LEGO1 0x100b4e40
void MxPresenter::EndAction() void MxPresenter::EndAction()
{ {
if (this->m_action == NULL) { if (m_action == NULL) {
return; return;
} }
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
if (!this->m_compositePresenter) { if (!m_compositePresenter) {
MxOmni::GetInstance()->NotifyCurrentEntity( MxOmni::GetInstance()->NotifyCurrentEntity(
MxEndActionNotificationParam(c_notificationEndAction, NULL, this->m_action, TRUE) MxEndActionNotificationParam(c_notificationEndAction, NULL, m_action, TRUE)
); );
} }
this->m_action = NULL; m_action = NULL;
MxS32 previousTickleState = 1 << m_currentTickleState; MxS32 previousTickleState = 1 << m_currentTickleState;
this->m_previousTickleStates |= previousTickleState; m_previousTickleStates |= previousTickleState;
this->m_currentTickleState = e_idle; m_currentTickleState = e_idle;
} }
// FUNCTION: LEGO1 0x100b4fc0 // FUNCTION: LEGO1 0x100b4fc0
@ -127,39 +125,39 @@ MxResult MxPresenter::Tickle()
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
switch (this->m_currentTickleState) { switch (m_currentTickleState) {
case e_ready: case e_ready:
this->ReadyTickle(); ReadyTickle();
if (m_currentTickleState != e_starting) { if (m_currentTickleState != e_starting) {
break; break;
} }
case e_starting: case e_starting:
this->StartingTickle(); StartingTickle();
if (m_currentTickleState != e_streaming) { if (m_currentTickleState != e_streaming) {
break; break;
} }
case e_streaming: case e_streaming:
this->StreamingTickle(); StreamingTickle();
if (m_currentTickleState != e_repeating) { if (m_currentTickleState != e_repeating) {
break; break;
} }
case e_repeating: case e_repeating:
this->RepeatingTickle(); RepeatingTickle();
if (m_currentTickleState != e_freezing) { if (m_currentTickleState != e_freezing) {
break; break;
} }
case e_freezing: case e_freezing:
this->FreezingTickle(); FreezingTickle();
if (m_currentTickleState != e_done) { if (m_currentTickleState != e_done) {
break; break;
} }
case e_done: case e_done:
this->DoneTickle(); DoneTickle();
default: default:
break; break;
} }
@ -170,14 +168,14 @@ MxResult MxPresenter::Tickle()
// FUNCTION: LEGO1 0x100b52d0 // FUNCTION: LEGO1 0x100b52d0
void MxPresenter::Enable(MxBool p_enable) void MxPresenter::Enable(MxBool p_enable)
{ {
if (this->m_action && this->IsEnabled() != p_enable) { if (m_action && IsEnabled() != p_enable) {
MxU32 flags = this->m_action->GetFlags(); MxU32 flags = m_action->GetFlags();
if (p_enable) { if (p_enable) {
this->m_action->SetFlags(flags | MxDSAction::c_enabled); m_action->SetFlags(flags | MxDSAction::c_enabled);
} }
else { else {
this->m_action->SetFlags(flags & ~MxDSAction::c_enabled); m_action->SetFlags(flags & ~MxDSAction::c_enabled);
} }
} }
} }
@ -264,5 +262,5 @@ MxEntity* MxPresenter::CreateEntity(const char* p_defaultName)
// FUNCTION: BETA10 0x1012ebaf // FUNCTION: BETA10 0x1012ebaf
MxBool MxPresenter::IsEnabled() MxBool MxPresenter::IsEnabled()
{ {
return this->m_action && this->m_action->GetFlags() & MxDSAction::c_enabled; return m_action && m_action->GetFlags() & MxDSAction::c_enabled;
} }

View File

@ -8,6 +8,8 @@
#include "mxomni.h" #include "mxomni.h"
#include "mxticklemanager.h" #include "mxticklemanager.h"
#include <assert.h>
DECOMP_SIZE_ASSERT(MxDiskStreamController, 0xc8); DECOMP_SIZE_ASSERT(MxDiskStreamController, 0xc8);
// FUNCTION: LEGO1 0x100c7120 // FUNCTION: LEGO1 0x100c7120
@ -17,6 +19,7 @@ MxDiskStreamController::MxDiskStreamController()
} }
// FUNCTION: LEGO1 0x100c7530 // FUNCTION: LEGO1 0x100c7530
// FUNCTION: BETA10 0x10153a2d
MxDiskStreamController::~MxDiskStreamController() MxDiskStreamController::~MxDiskStreamController()
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
@ -35,6 +38,8 @@ MxDiskStreamController::~MxDiskStreamController()
#endif #endif
} }
assert(m_subscribers.size() == 0);
MxDSObject* object; MxDSObject* object;
while (m_unk0x3c.PopFront(object)) { while (m_unk0x3c.PopFront(object)) {
delete object; delete object;
@ -65,28 +70,32 @@ MxDiskStreamController::~MxDiskStreamController()
} }
// FUNCTION: LEGO1 0x100c7790 // FUNCTION: LEGO1 0x100c7790
// FUNCTION: BETA10 0x10153ea8
MxResult MxDiskStreamController::Open(const char* p_filename) MxResult MxDiskStreamController::Open(const char* p_filename)
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
MxResult result = MxStreamController::Open(p_filename); MxResult result = MxStreamController::Open(p_filename);
if (result == SUCCESS) { if (result != SUCCESS) {
m_provider = new MxDiskStreamProvider(); goto done;
if (m_provider == NULL) {
result = FAILURE;
}
else {
result = m_provider->SetResourceToGet(this);
if (result != SUCCESS) {
delete m_provider;
m_provider = NULL;
}
else {
TickleManager()->RegisterClient(this, 10);
}
}
} }
m_provider = new MxDiskStreamProvider();
if (m_provider == NULL) {
result = FAILURE;
goto done;
}
result = m_provider->SetResourceToGet(this);
if (result != SUCCESS) {
delete m_provider;
m_provider = NULL;
goto done;
}
TickleManager()->RegisterClient(this, 10);
done:
return result; return result;
} }
@ -97,6 +106,7 @@ MxResult MxDiskStreamController::VTable0x18(undefined4, undefined4)
} }
// FUNCTION: LEGO1 0x100c7890 // FUNCTION: LEGO1 0x100c7890
// FUNCTION: BETA10 0x101543bb
MxResult MxDiskStreamController::FUN_100c7890(MxDSStreamingAction* p_action) MxResult MxDiskStreamController::FUN_100c7890(MxDSStreamingAction* p_action)
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
@ -104,7 +114,7 @@ MxResult MxDiskStreamController::FUN_100c7890(MxDSStreamingAction* p_action)
return FAILURE; return FAILURE;
} }
m_list0x80.push_back(p_action); m_list0x80.PushBack(p_action);
FUN_100c7970(); FUN_100c7970();
return SUCCESS; return SUCCESS;
} }
@ -122,6 +132,7 @@ void MxDiskStreamController::FUN_100c7970()
} }
// FUNCTION: LEGO1 0x100c7980 // FUNCTION: LEGO1 0x100c7980
// FUNCTION: BETA10 0x10154848
void MxDiskStreamController::FUN_100c7980() void MxDiskStreamController::FUN_100c7980()
{ {
MxDSBuffer* buffer; MxDSBuffer* buffer;
@ -159,24 +170,33 @@ void MxDiskStreamController::FUN_100c7980()
} }
// FUNCTION: LEGO1 0x100c7ac0 // FUNCTION: LEGO1 0x100c7ac0
// FUNCTION: BETA10 0x10154abb
MxDSStreamingAction* MxDiskStreamController::VTable0x28() MxDSStreamingAction* MxDiskStreamController::VTable0x28()
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
MxDSObject* oldAction; MxDSObject* oldAction;
MxDSStreamingAction* result = NULL;
assert(m_provider);
MxDSStreamingAction* request = NULL;
MxU32 filesize = m_provider->GetFileSize(); MxU32 filesize = m_provider->GetFileSize();
if (m_unk0x3c.PopFront(oldAction)) { if (!m_unk0x3c.PopFront(oldAction)) {
result = new MxDSStreamingAction((MxDSStreamingAction&) *oldAction); goto done;
if (result) {
MxU32 offset = result->GetBufferOffset() + filesize;
((MxDSStreamingAction*) oldAction)->SetUnknown94(offset);
((MxDSStreamingAction*) oldAction)->SetBufferOffset(offset);
m_unk0x3c.push_back(oldAction);
}
} }
return result; request = new MxDSStreamingAction((MxDSStreamingAction&) *oldAction);
assert(request);
if (!request) {
goto done;
}
((MxDSStreamingAction*) oldAction)->SetUnknown94(request->GetBufferOffset() + filesize);
((MxDSStreamingAction*) oldAction)->SetBufferOffset(((MxDSStreamingAction*) oldAction)->GetUnknown94());
m_unk0x3c.PushBack(oldAction);
done:
return request;
} }
// FUNCTION: LEGO1 0x100c7c00 // FUNCTION: LEGO1 0x100c7c00
@ -277,15 +297,17 @@ MxDSStreamingAction* MxDiskStreamController::FUN_100c7db0()
} }
// FUNCTION: LEGO1 0x100c7f40 // FUNCTION: LEGO1 0x100c7f40
// FUNCTION: BETA10 0x101553e0
void MxDiskStreamController::FUN_100c7f40(MxDSStreamingAction* p_streamingaction) void MxDiskStreamController::FUN_100c7f40(MxDSStreamingAction* p_streamingaction)
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
if (p_streamingaction) { if (p_streamingaction) {
m_list0x64.push_back(p_streamingaction); m_list0x64.PushBack(p_streamingaction);
} }
} }
// FUNCTION: LEGO1 0x100c7ff0 // FUNCTION: LEGO1 0x100c7ff0
// FUNCTION: BETA10 0x10155471
MxResult MxDiskStreamController::VTable0x20(MxDSAction* p_action) MxResult MxDiskStreamController::VTable0x20(MxDSAction* p_action)
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
@ -389,7 +411,7 @@ MxResult MxDiskStreamController::FUN_100c8360(MxDSStreamingAction* p_action)
action2->SetObjectId(p_action->GetObjectId()); action2->SetObjectId(p_action->GetObjectId());
} }
m_list0x90.push_back(action2); m_list0x90.PushBack(action2);
} }
} }
@ -405,6 +427,7 @@ void MxDiskStreamController::InsertToList74(MxDSBuffer* p_buffer)
} }
// FUNCTION: LEGO1 0x100c8540 // FUNCTION: LEGO1 0x100c8540
// FUNCTION: BETA10 0x10155a05
void MxDiskStreamController::FUN_100c8540() void MxDiskStreamController::FUN_100c8540()
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
@ -429,6 +452,7 @@ void MxDiskStreamController::FUN_100c8540()
} }
// FUNCTION: LEGO1 0x100c8640 // FUNCTION: LEGO1 0x100c8640
// FUNCTION: BETA10 0x10155ba0
MxResult MxDiskStreamController::Tickle() MxResult MxDiskStreamController::Tickle()
{ {
if (m_unk0xc4) { if (m_unk0xc4) {
@ -461,7 +485,6 @@ void MxDiskStreamController::FUN_100c8720()
while (!m_list0xb8.empty()) { while (!m_list0xb8.empty()) {
action = (MxDSStreamingAction*) m_list0xb8.front(); action = (MxDSStreamingAction*) m_list0xb8.front();
m_list0xb8.pop_front(); m_list0xb8.pop_front();
FUN_100c7cb0(action); FUN_100c7cb0(action);
} }
} }

View File

@ -201,7 +201,7 @@ MxResult MxDiskStreamProvider::FUN_100d1780(MxDSStreamingAction* p_action)
{ {
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
m_list.push_back(p_action); m_list.PushBack(p_action);
} }
m_unk0x35 = TRUE; m_unk0x35 = TRUE;

View File

@ -32,7 +32,7 @@ MxStreamController::~MxStreamController()
AUTOLOCK(m_criticalSection); AUTOLOCK(m_criticalSection);
MxDSSubscriber* subscriber; MxDSSubscriber* subscriber;
while (m_subscriberList.PopFront(subscriber)) { while (m_subscribers.PopFront(subscriber)) {
delete subscriber; delete subscriber;
} }
@ -80,14 +80,14 @@ MxResult MxStreamController::Open(const char* p_filename)
// FUNCTION: BETA10 0x1014e730 // FUNCTION: BETA10 0x1014e730
void MxStreamController::AddSubscriber(MxDSSubscriber* p_subscriber) void MxStreamController::AddSubscriber(MxDSSubscriber* p_subscriber)
{ {
m_subscriberList.PushBack(p_subscriber); m_subscribers.PushBack(p_subscriber);
} }
// FUNCTION: LEGO1 0x100c1620 // FUNCTION: LEGO1 0x100c1620
// FUNCTION: BETA10 0x1014e7b4 // FUNCTION: BETA10 0x1014e7b4
void MxStreamController::RemoveSubscriber(MxDSSubscriber* p_subscriber) void MxStreamController::RemoveSubscriber(MxDSSubscriber* p_subscriber)
{ {
m_subscriberList.Remove(p_subscriber); m_subscribers.Remove(p_subscriber);
} }
// FUNCTION: LEGO1 0x100c1690 // FUNCTION: LEGO1 0x100c1690
@ -173,7 +173,7 @@ MxResult MxStreamController::FUN_100c1a00(MxDSAction* p_action, MxU32 p_offset)
} }
if (newUnknown24 == -1) { if (newUnknown24 == -1) {
for (MxDSSubscriberList::iterator it = m_subscriberList.begin(); it != m_subscriberList.end(); it++) { for (MxDSSubscriberList::iterator it = m_subscribers.begin(); it != m_subscribers.end(); it++) {
MxDSSubscriber* subscriber = *it; MxDSSubscriber* subscriber = *it;
if (subscriber->GetObjectId() == p_action->GetObjectId()) { if (subscriber->GetObjectId() == p_action->GetObjectId()) {
@ -288,7 +288,7 @@ MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action)
chunk->SetChunkFlags(DS_CHUNK_BIT3); chunk->SetChunkFlags(DS_CHUNK_BIT3);
chunk->SetObjectId(objectId); chunk->SetObjectId(objectId);
if (chunk->SendChunk(m_subscriberList, FALSE, p_action->GetUnknown24()) != SUCCESS) { if (chunk->SendChunk(m_subscribers, FALSE, p_action->GetUnknown24()) != SUCCESS) {
delete chunk; delete chunk;
} }
@ -318,7 +318,7 @@ MxNextActionDataStart* MxStreamController::FindNextActionDataStartFromStreamingA
// FUNCTION: BETA10 0x1014f3b5 // FUNCTION: BETA10 0x1014f3b5
MxBool MxStreamController::IsStoped(MxDSObject* p_obj) MxBool MxStreamController::IsStoped(MxDSObject* p_obj)
{ {
MxDSSubscriber* subscriber = m_subscriberList.Find(p_obj); MxDSSubscriber* subscriber = m_subscribers.Find(p_obj);
if (subscriber) { if (subscriber) {
MxTrace( MxTrace(

View File

@ -1,41 +1,41 @@
#include "mxsmack.h" #include "mxsmk.h"
#include "mxbitmap.h" #include "mxbitmap.h"
#include <string.h> #include <string.h>
DECOMP_SIZE_ASSERT(SmackTag, 0x390); DECOMP_SIZE_ASSERT(SmackTag, 0x390);
DECOMP_SIZE_ASSERT(MxSmack, 0x6b8); DECOMP_SIZE_ASSERT(MxSmk, 0x6b8);
// FUNCTION: LEGO1 0x100c5a90 // FUNCTION: LEGO1 0x100c5a90
// FUNCTION: BETA10 0x10151e70 // FUNCTION: BETA10 0x10151e70
MxResult MxSmack::LoadHeader(MxU8* p_data, MxU32 p_length, MxSmack* p_mxSmack) MxResult MxSmk::LoadHeader(MxU8* p_data, MxU32 p_length, MxSmk* p_mxSmk)
{ {
p_mxSmack->m_smk = smk_open_memory_stream(p_data, p_length); p_mxSmk->m_smk = smk_open_memory_stream(p_data, p_length);
if (p_mxSmack->m_smk == NULL) { if (p_mxSmk->m_smk == NULL) {
return FAILURE; return FAILURE;
} }
smk_enable_video(p_mxSmack->m_smk, TRUE); smk_enable_video(p_mxSmk->m_smk, TRUE);
return SUCCESS; return SUCCESS;
} }
// FUNCTION: LEGO1 0x100c5d40 // FUNCTION: LEGO1 0x100c5d40
// FUNCTION: BETA10 0x10152298 // FUNCTION: BETA10 0x10152298
void MxSmack::Destroy(MxSmack* p_mxSmack) void MxSmk::Destroy(MxSmk* p_mxSmk)
{ {
if (p_mxSmack->m_smk != NULL) { if (p_mxSmk->m_smk != NULL) {
smk_close(p_mxSmack->m_smk); smk_close(p_mxSmk->m_smk);
} }
} }
// FUNCTION: LEGO1 0x100c5db0 // FUNCTION: LEGO1 0x100c5db0
// FUNCTION: BETA10 0x10152391 // FUNCTION: BETA10 0x10152391
MxResult MxSmack::LoadFrame( MxResult MxSmk::LoadFrame(
MxBITMAPINFO* p_bitmapInfo, MxBITMAPINFO* p_bitmapInfo,
MxU8* p_bitmapData, MxU8* p_bitmapData,
MxSmack* p_mxSmack, MxSmk* p_mxSmk,
MxU8* p_chunkData, MxU8* p_chunkData,
MxBool& p_paletteChanged, MxBool& p_paletteChanged,
MxU32 p_currentFrame, MxU32 p_currentFrame,
@ -45,24 +45,24 @@ MxResult MxSmack::LoadFrame(
p_bitmapInfo->m_bmiHeader.biHeight = -MxBitmap::HeightAbs(p_bitmapInfo->m_bmiHeader.biHeight); p_bitmapInfo->m_bmiHeader.biHeight = -MxBitmap::HeightAbs(p_bitmapInfo->m_bmiHeader.biHeight);
unsigned long w, h; unsigned long w, h;
smk_info_video(p_mxSmack->m_smk, &w, &h, NULL); smk_info_video(p_mxSmk->m_smk, &w, &h, NULL);
smk_set_chunk(p_mxSmack->m_smk, p_currentFrame, p_chunkData); smk_set_chunk(p_mxSmk->m_smk, p_currentFrame, p_chunkData);
if (p_currentFrame == 0) { if (p_currentFrame == 0) {
smk_first(p_mxSmack->m_smk); smk_first(p_mxSmk->m_smk);
} }
else { else {
smk_next(p_mxSmack->m_smk); smk_next(p_mxSmk->m_smk);
} }
memcpy(p_bitmapData, smk_get_video(p_mxSmack->m_smk), w * h); memcpy(p_bitmapData, smk_get_video(p_mxSmk->m_smk), w * h);
unsigned char frameType; unsigned char frameType;
smk_info_all(p_mxSmack->m_smk, NULL, NULL, &frameType, NULL); smk_info_all(p_mxSmk->m_smk, NULL, NULL, &frameType, NULL);
p_paletteChanged = frameType & 1; p_paletteChanged = frameType & 1;
if (p_paletteChanged) { if (p_paletteChanged) {
const unsigned char* palette = smk_get_palette(p_mxSmack->m_smk); const unsigned char* palette = smk_get_palette(p_mxSmk->m_smk);
for (MxU32 i = 0; i < 256; i++) { for (MxU32 i = 0; i < 256; i++) {
p_bitmapInfo->m_bmiColors[i].rgbBlue = palette[i * 3 + 2]; p_bitmapInfo->m_bmiColors[i].rgbBlue = palette[i * 3 + 2];

View File

@ -26,7 +26,7 @@ MxSmkPresenter::~MxSmkPresenter()
void MxSmkPresenter::Init() void MxSmkPresenter::Init()
{ {
m_currentFrame = 0; m_currentFrame = 0;
memset(&m_mxSmack, 0, sizeof(m_mxSmack)); memset(&m_mxSmk, 0, sizeof(m_mxSmk));
SetBit1(FALSE); SetBit1(FALSE);
SetBit2(FALSE); SetBit2(FALSE);
} }
@ -36,7 +36,7 @@ void MxSmkPresenter::Destroy(MxBool p_fromDestructor)
{ {
m_criticalSection.Enter(); m_criticalSection.Enter();
MxSmack::Destroy(&m_mxSmack); MxSmk::Destroy(&m_mxSmk);
Init(); Init();
m_criticalSection.Leave(); m_criticalSection.Leave();
@ -49,7 +49,7 @@ void MxSmkPresenter::Destroy(MxBool p_fromDestructor)
// FUNCTION: LEGO1 0x100b3940 // FUNCTION: LEGO1 0x100b3940
void MxSmkPresenter::LoadHeader(MxStreamChunk* p_chunk) void MxSmkPresenter::LoadHeader(MxStreamChunk* p_chunk)
{ {
MxSmack::LoadHeader(p_chunk->GetData(), p_chunk->GetLength(), &m_mxSmack); MxSmk::LoadHeader(p_chunk->GetData(), p_chunk->GetLength(), &m_mxSmk);
} }
// FUNCTION: LEGO1 0x100b3960 // FUNCTION: LEGO1 0x100b3960
@ -60,7 +60,7 @@ void MxSmkPresenter::CreateBitmap()
} }
unsigned long w, h; unsigned long w, h;
smk_info_video(m_mxSmack.m_smk, &w, &h, NULL); smk_info_video(m_mxSmk.m_smk, &w, &h, NULL);
m_frameBitmap = new MxBitmap; m_frameBitmap = new MxBitmap;
m_frameBitmap->SetSize(w, h, NULL, FALSE); m_frameBitmap->SetSize(w, h, NULL, FALSE);
@ -78,7 +78,7 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk)
VTable0x88(); VTable0x88();
MxRectList rects(TRUE); MxRectList rects(TRUE);
MxSmack::LoadFrame(bitmapInfo, bitmapData, &m_mxSmack, chunkData, paletteChanged, m_currentFrame - 1, &rects); MxSmk::LoadFrame(bitmapInfo, bitmapData, &m_mxSmk, chunkData, paletteChanged, m_currentFrame - 1, &rects);
if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && paletteChanged) { if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && paletteChanged) {
RealizePalette(); RealizePalette();

View File

@ -411,7 +411,7 @@ public:
Result CreateBuffer(int width, int height, int depth, void* pBuffer, int useBuffer); Result CreateBuffer(int width, int height, int depth, void* pBuffer, int useBuffer);
void Destroy(); void Destroy();
void FillRowsOfTexture(int y, int height, char* content); Result FillRowsOfTexture(int y, int height, char* content);
Result InitializePalette(int paletteSize, PaletteEntry* pEntries); Result InitializePalette(int paletteSize, PaletteEntry* pEntries);
D3DRMIMAGE m_image; D3DRMIMAGE m_image;

View File

@ -129,10 +129,11 @@ Result TglD3DRMIMAGE::CreateBuffer(int width, int height, int depth, void* pBuff
} }
// FUNCTION: LEGO1 0x100a1510 // FUNCTION: LEGO1 0x100a1510
void TglD3DRMIMAGE::FillRowsOfTexture(int y, int height, char* pContent) Result TglD3DRMIMAGE::FillRowsOfTexture(int y, int height, char* pContent)
{ {
// The purpose is clearly this but I can't get the assembly to line up. // The purpose is clearly this but I can't get the assembly to line up.
memcpy((char*) m_image.buffer1 + (y * m_image.bytes_per_line), pContent, height * m_image.bytes_per_line); memcpy((char*) m_image.buffer1 + (y * m_image.bytes_per_line), pContent, height * m_image.bytes_per_line);
return Success;
} }
// FUNCTION: LEGO1 0x100a1550 // FUNCTION: LEGO1 0x100a1550