diff --git a/LEGO1/lego/legoomni/include/legonamedplane.h b/LEGO1/lego/legoomni/include/legonamedplane.h index e86f418c..df91828a 100644 --- a/LEGO1/lego/legoomni/include/legonamedplane.h +++ b/LEGO1/lego/legoomni/include/legonamedplane.h @@ -24,6 +24,7 @@ class LegoNamedPlane { void SetDirection(const Mx3DPointFloat& p_direction) { m_direction = p_direction; } void SetUp(const Mx3DPointFloat& p_up) { m_up = p_up; } + // TODO: Unclear whether this was defined MxBool IsPresent() { return strcmp(m_name.GetData(), "") != 0; } void Reset() { m_name = ""; } @@ -46,7 +47,7 @@ class LegoNamedPlane { return SUCCESS; } -private: + // private: MxString m_name; // 0x00 Mx3DPointFloat m_position; // 0x10 Mx3DPointFloat m_direction; // 0x24 diff --git a/LEGO1/lego/legoomni/include/legostate.h b/LEGO1/lego/legoomni/include/legostate.h index 93dbca72..940abe72 100644 --- a/LEGO1/lego/legoomni/include/legostate.h +++ b/LEGO1/lego/legoomni/include/legostate.h @@ -18,8 +18,7 @@ class LegoState : public MxCore { }; // SIZE 0x0c - class Playlist { - public: + struct Playlist { enum Mode { e_loop, e_once, @@ -60,9 +59,6 @@ class LegoState : public MxCore { MxU32 Next(); MxBool Contains(MxU32 p_objectId); - void SetNextIndex(MxS16 p_nextIndex) { m_nextIndex = p_nextIndex; } - - // private: MxU32* m_objectIds; // 0x00 MxS16 m_length; // 0x04 MxS16 m_mode; // 0x06 diff --git a/LEGO1/lego/legoomni/src/actors/radio.cpp b/LEGO1/lego/legoomni/src/actors/radio.cpp index 0291c18c..71fbf2bc 100644 --- a/LEGO1/lego/legoomni/src/actors/radio.cpp +++ b/LEGO1/lego/legoomni/src/actors/radio.cpp @@ -209,6 +209,7 @@ void Radio::CreateState() } // FUNCTION: LEGO1 0x1002ce10 +// FUNCTION: BETA10 0x100f20f6 RadioState::RadioState() { srand(Timer()->GetTime()); @@ -217,13 +218,13 @@ RadioState::RadioState() m_unk0x2c = random % 3; m_unk0x08[0] = Playlist((MxU32*) g_unk0x100f3218, sizeOfArray(g_unk0x100f3218), Playlist::e_loop); - m_unk0x08[0].SetNextIndex(rand() % sizeOfArray(g_unk0x100f3218)); + m_unk0x08[0].m_nextIndex = (rand() % sizeOfArray(g_unk0x100f3218)); m_unk0x08[1] = Playlist((MxU32*) g_unk0x100f3230, sizeOfArray(g_unk0x100f3230), Playlist::e_loop); - m_unk0x08[1].SetNextIndex(rand() % sizeOfArray(g_unk0x100f3230)); + m_unk0x08[1].m_nextIndex = (rand() % sizeOfArray(g_unk0x100f3230)); m_unk0x08[2] = Playlist((MxU32*) g_unk0x100f3268, sizeOfArray(g_unk0x100f3268), Playlist::e_loop); - m_unk0x08[2].SetNextIndex(rand() % sizeOfArray(g_unk0x100f3268)); + m_unk0x08[2].m_nextIndex = (rand() % sizeOfArray(g_unk0x100f3268)); m_active = FALSE; } diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index bfc3faa1..6c3b0859 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -1337,74 +1337,75 @@ MxResult Act1State::Serialize(LegoFile* p_file) m_racecarPlane.Serialize(p_file); if (p_file->IsWriteMode()) { - if (m_helicopterPlane.IsPresent()) { - if (m_helicopterWindshield) { - WriteNamedTexture(p_file, m_helicopterWindshield); - } - else { + // TODO: Seems to match better when using strcmp directly instead of IsPresent + if (strcmp(m_helicopterPlane.m_name.GetData(), "")) { + if (!m_helicopterWindshield) { WriteDefaultTexture(p_file, "chwind.gif"); } - - if (m_helicopterJetLeft) { - WriteNamedTexture(p_file, m_helicopterJetLeft); - } else { + WriteNamedTexture(p_file, m_helicopterWindshield); + } + + if (!m_helicopterJetLeft) { WriteDefaultTexture(p_file, "chjetl.gif"); } - - if (m_helicopterJetRight) { - WriteNamedTexture(p_file, m_helicopterJetRight); - } else { + WriteNamedTexture(p_file, m_helicopterJetLeft); + } + + if (!m_helicopterJetRight) { WriteDefaultTexture(p_file, "chjetr.gif"); } + else { + WriteNamedTexture(p_file, m_helicopterJetRight); + } } - if (m_jetskiPlane.IsPresent()) { - if (m_jetskiFront) { - WriteNamedTexture(p_file, m_jetskiFront); - } - else { + if (strcmp(m_jetskiPlane.m_name.GetData(), "")) { + if (!m_jetskiFront) { WriteDefaultTexture(p_file, "jsfrnt.gif"); } - - if (m_jetskiWindshield) { - WriteNamedTexture(p_file, m_jetskiWindshield); - } else { + WriteNamedTexture(p_file, m_jetskiFront); + } + + if (!m_jetskiWindshield) { WriteDefaultTexture(p_file, "jswnsh.gif"); } + else { + WriteNamedTexture(p_file, m_jetskiWindshield); + } } - if (m_dunebuggyPlane.IsPresent()) { - if (m_dunebuggyFront) { - WriteNamedTexture(p_file, m_dunebuggyFront); - } - else { + if (strcmp(m_dunebuggyPlane.m_name.GetData(), "")) { + if (!m_dunebuggyFront) { WriteDefaultTexture(p_file, "dbfrfn.gif"); } + else { + WriteNamedTexture(p_file, m_dunebuggyFront); + } } - if (m_racecarPlane.IsPresent()) { - if (m_racecarFront) { - WriteNamedTexture(p_file, m_racecarFront); - } - else { + if (strcmp(m_racecarPlane.m_name.GetData(), "")) { + if (!m_racecarFront) { WriteDefaultTexture(p_file, "rcfrnt.gif"); } - - if (m_racecarBack) { - WriteNamedTexture(p_file, m_racecarBack); - } else { + WriteNamedTexture(p_file, m_racecarFront); + } + + if (!m_racecarBack) { WriteDefaultTexture(p_file, "rcback.gif"); } + else { + WriteNamedTexture(p_file, m_racecarBack); + } - if (m_racecarTail) { - WriteNamedTexture(p_file, m_racecarTail); + if (!m_racecarTail) { + WriteDefaultTexture(p_file, "rctail.gif"); } else { - WriteDefaultTexture(p_file, "rctail.gif"); + WriteNamedTexture(p_file, m_racecarTail); } } @@ -1412,7 +1413,7 @@ MxResult Act1State::Serialize(LegoFile* p_file) p_file->Write(m_unk0x022); } else if (p_file->IsReadMode()) { - if (m_helicopterPlane.IsPresent()) { + if (strcmp(m_helicopterPlane.m_name.GetData(), "")) { m_helicopterWindshield = ReadNamedTexture(p_file); if (m_helicopterWindshield == NULL) { return FAILURE; @@ -1429,7 +1430,7 @@ MxResult Act1State::Serialize(LegoFile* p_file) } } - if (m_jetskiPlane.IsPresent()) { + if (strcmp(m_jetskiPlane.m_name.GetData(), "")) { m_jetskiFront = ReadNamedTexture(p_file); if (m_jetskiFront == NULL) { return FAILURE; @@ -1441,14 +1442,14 @@ MxResult Act1State::Serialize(LegoFile* p_file) } } - if (m_dunebuggyPlane.IsPresent()) { + if (strcmp(m_dunebuggyPlane.m_name.GetData(), "")) { m_dunebuggyFront = ReadNamedTexture(p_file); if (m_dunebuggyFront == NULL) { return FAILURE; } } - if (m_racecarPlane.IsPresent()) { + if (strcmp(m_racecarPlane.m_name.GetData(), "")) { m_racecarFront = ReadNamedTexture(p_file); if (m_racecarFront == NULL) { return FAILURE; @@ -1469,7 +1470,6 @@ MxResult Act1State::Serialize(LegoFile* p_file) p_file->Read(m_unk0x022); } - // TODO return SUCCESS; }