mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 07:11:16 +00:00
Improvements
This commit is contained in:
parent
2bccf4edd3
commit
956fb35d2e
@ -24,6 +24,7 @@ class LegoNamedPlane {
|
|||||||
void SetDirection(const Mx3DPointFloat& p_direction) { m_direction = p_direction; }
|
void SetDirection(const Mx3DPointFloat& p_direction) { m_direction = p_direction; }
|
||||||
void SetUp(const Mx3DPointFloat& p_up) { m_up = p_up; }
|
void SetUp(const Mx3DPointFloat& p_up) { m_up = p_up; }
|
||||||
|
|
||||||
|
// TODO: Unclear whether this was defined
|
||||||
MxBool IsPresent() { return strcmp(m_name.GetData(), "") != 0; }
|
MxBool IsPresent() { return strcmp(m_name.GetData(), "") != 0; }
|
||||||
void Reset() { m_name = ""; }
|
void Reset() { m_name = ""; }
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ class LegoNamedPlane {
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
// private:
|
||||||
MxString m_name; // 0x00
|
MxString m_name; // 0x00
|
||||||
Mx3DPointFloat m_position; // 0x10
|
Mx3DPointFloat m_position; // 0x10
|
||||||
Mx3DPointFloat m_direction; // 0x24
|
Mx3DPointFloat m_direction; // 0x24
|
||||||
|
|||||||
@ -18,8 +18,7 @@ class LegoState : public MxCore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// SIZE 0x0c
|
// SIZE 0x0c
|
||||||
class Playlist {
|
struct Playlist {
|
||||||
public:
|
|
||||||
enum Mode {
|
enum Mode {
|
||||||
e_loop,
|
e_loop,
|
||||||
e_once,
|
e_once,
|
||||||
@ -60,9 +59,6 @@ class LegoState : public MxCore {
|
|||||||
MxU32 Next();
|
MxU32 Next();
|
||||||
MxBool Contains(MxU32 p_objectId);
|
MxBool Contains(MxU32 p_objectId);
|
||||||
|
|
||||||
void SetNextIndex(MxS16 p_nextIndex) { m_nextIndex = p_nextIndex; }
|
|
||||||
|
|
||||||
// private:
|
|
||||||
MxU32* m_objectIds; // 0x00
|
MxU32* m_objectIds; // 0x00
|
||||||
MxS16 m_length; // 0x04
|
MxS16 m_length; // 0x04
|
||||||
MxS16 m_mode; // 0x06
|
MxS16 m_mode; // 0x06
|
||||||
|
|||||||
@ -209,6 +209,7 @@ void Radio::CreateState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002ce10
|
// FUNCTION: LEGO1 0x1002ce10
|
||||||
|
// FUNCTION: BETA10 0x100f20f6
|
||||||
RadioState::RadioState()
|
RadioState::RadioState()
|
||||||
{
|
{
|
||||||
srand(Timer()->GetTime());
|
srand(Timer()->GetTime());
|
||||||
@ -217,13 +218,13 @@ RadioState::RadioState()
|
|||||||
m_unk0x2c = random % 3;
|
m_unk0x2c = random % 3;
|
||||||
|
|
||||||
m_unk0x08[0] = Playlist((MxU32*) g_unk0x100f3218, sizeOfArray(g_unk0x100f3218), Playlist::e_loop);
|
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] = 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] = 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;
|
m_active = FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1337,74 +1337,75 @@ MxResult Act1State::Serialize(LegoFile* p_file)
|
|||||||
m_racecarPlane.Serialize(p_file);
|
m_racecarPlane.Serialize(p_file);
|
||||||
|
|
||||||
if (p_file->IsWriteMode()) {
|
if (p_file->IsWriteMode()) {
|
||||||
if (m_helicopterPlane.IsPresent()) {
|
// TODO: Seems to match better when using strcmp directly instead of IsPresent
|
||||||
if (m_helicopterWindshield) {
|
if (strcmp(m_helicopterPlane.m_name.GetData(), "")) {
|
||||||
WriteNamedTexture(p_file, m_helicopterWindshield);
|
if (!m_helicopterWindshield) {
|
||||||
}
|
|
||||||
else {
|
|
||||||
WriteDefaultTexture(p_file, "chwind.gif");
|
WriteDefaultTexture(p_file, "chwind.gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_helicopterJetLeft) {
|
|
||||||
WriteNamedTexture(p_file, m_helicopterJetLeft);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_helicopterWindshield);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_helicopterJetLeft) {
|
||||||
WriteDefaultTexture(p_file, "chjetl.gif");
|
WriteDefaultTexture(p_file, "chjetl.gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_helicopterJetRight) {
|
|
||||||
WriteNamedTexture(p_file, m_helicopterJetRight);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_helicopterJetLeft);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_helicopterJetRight) {
|
||||||
WriteDefaultTexture(p_file, "chjetr.gif");
|
WriteDefaultTexture(p_file, "chjetr.gif");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_helicopterJetRight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_jetskiPlane.IsPresent()) {
|
if (strcmp(m_jetskiPlane.m_name.GetData(), "")) {
|
||||||
if (m_jetskiFront) {
|
if (!m_jetskiFront) {
|
||||||
WriteNamedTexture(p_file, m_jetskiFront);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
WriteDefaultTexture(p_file, "jsfrnt.gif");
|
WriteDefaultTexture(p_file, "jsfrnt.gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_jetskiWindshield) {
|
|
||||||
WriteNamedTexture(p_file, m_jetskiWindshield);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_jetskiFront);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_jetskiWindshield) {
|
||||||
WriteDefaultTexture(p_file, "jswnsh.gif");
|
WriteDefaultTexture(p_file, "jswnsh.gif");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_jetskiWindshield);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_dunebuggyPlane.IsPresent()) {
|
if (strcmp(m_dunebuggyPlane.m_name.GetData(), "")) {
|
||||||
if (m_dunebuggyFront) {
|
if (!m_dunebuggyFront) {
|
||||||
WriteNamedTexture(p_file, m_dunebuggyFront);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
WriteDefaultTexture(p_file, "dbfrfn.gif");
|
WriteDefaultTexture(p_file, "dbfrfn.gif");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_dunebuggyFront);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_racecarPlane.IsPresent()) {
|
if (strcmp(m_racecarPlane.m_name.GetData(), "")) {
|
||||||
if (m_racecarFront) {
|
if (!m_racecarFront) {
|
||||||
WriteNamedTexture(p_file, m_racecarFront);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
WriteDefaultTexture(p_file, "rcfrnt.gif");
|
WriteDefaultTexture(p_file, "rcfrnt.gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_racecarBack) {
|
|
||||||
WriteNamedTexture(p_file, m_racecarBack);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_racecarFront);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_racecarBack) {
|
||||||
WriteDefaultTexture(p_file, "rcback.gif");
|
WriteDefaultTexture(p_file, "rcback.gif");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
WriteNamedTexture(p_file, m_racecarBack);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_racecarTail) {
|
if (!m_racecarTail) {
|
||||||
WriteNamedTexture(p_file, m_racecarTail);
|
WriteDefaultTexture(p_file, "rctail.gif");
|
||||||
}
|
}
|
||||||
else {
|
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);
|
p_file->Write(m_unk0x022);
|
||||||
}
|
}
|
||||||
else if (p_file->IsReadMode()) {
|
else if (p_file->IsReadMode()) {
|
||||||
if (m_helicopterPlane.IsPresent()) {
|
if (strcmp(m_helicopterPlane.m_name.GetData(), "")) {
|
||||||
m_helicopterWindshield = ReadNamedTexture(p_file);
|
m_helicopterWindshield = ReadNamedTexture(p_file);
|
||||||
if (m_helicopterWindshield == NULL) {
|
if (m_helicopterWindshield == NULL) {
|
||||||
return FAILURE;
|
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);
|
m_jetskiFront = ReadNamedTexture(p_file);
|
||||||
if (m_jetskiFront == NULL) {
|
if (m_jetskiFront == NULL) {
|
||||||
return FAILURE;
|
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);
|
m_dunebuggyFront = ReadNamedTexture(p_file);
|
||||||
if (m_dunebuggyFront == NULL) {
|
if (m_dunebuggyFront == NULL) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_racecarPlane.IsPresent()) {
|
if (strcmp(m_racecarPlane.m_name.GetData(), "")) {
|
||||||
m_racecarFront = ReadNamedTexture(p_file);
|
m_racecarFront = ReadNamedTexture(p_file);
|
||||||
if (m_racecarFront == NULL) {
|
if (m_racecarFront == NULL) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
@ -1469,7 +1470,6 @@ MxResult Act1State::Serialize(LegoFile* p_file)
|
|||||||
p_file->Read(m_unk0x022);
|
p_file->Read(m_unk0x022);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user