mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 17:04:17 +00:00
Improve order until legomain.cpp (#1350)
* Fix `LegoBackgroundColor` order * Order * Improve order in Act3Actors * Improve order * Add BETA annotation * Order more * More order * More order * Order * Match/order * Remove blank line * Modern compiler fix * vtable annotation
This commit is contained in:
committed by
GitHub
parent
e1ce96c473
commit
fc03e7a682
@@ -29,7 +29,7 @@ DECOMP_SIZE_ASSERT(Act3Shark, 0x1a8)
|
||||
// name verified by BETA10 0x10018776
|
||||
// GLOBAL: LEGO1 0x100f4120
|
||||
// GLOBAL: BETA10 0x101dcdc8
|
||||
Act3Actor::Act3CopDest g_copDest[5] = {
|
||||
Act3Cop::Act3CopDest g_copDest[5] = {
|
||||
{"INT38", NULL, {3.69, -1.31251, -59.231}, {-0.99601698, 0.0, -0.089166}},
|
||||
{
|
||||
"EDG02_08",
|
||||
@@ -1012,9 +1012,6 @@ MxResult Act3Brickster::FUN_100417c0()
|
||||
// FUNCTION: BETA10 0x1001b017
|
||||
MxS32 Act3Brickster::FUN_10042300()
|
||||
{
|
||||
// TODO: Has poor inlining, can be fixed by changing the assignment operator in vector.h
|
||||
// See extended comment in vector.h for operator=
|
||||
|
||||
Act3* a3 = (Act3*) m_world;
|
||||
|
||||
assert(a3 && a3->m_cop1 && a3->m_cop2);
|
||||
|
||||
@@ -607,37 +607,3 @@ TowTrackMissionState::TowTrackMissionState()
|
||||
m_niHighScore = 0;
|
||||
m_laHighScore = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1004dde0
|
||||
// FUNCTION: BETA10 0x100f8720
|
||||
MxResult TowTrackMissionState::Serialize(LegoStorage* p_storage)
|
||||
{
|
||||
LegoState::Serialize(p_storage);
|
||||
|
||||
if (p_storage->IsReadMode()) {
|
||||
p_storage->ReadS16(m_peScore);
|
||||
p_storage->ReadS16(m_maScore);
|
||||
p_storage->ReadS16(m_paScore);
|
||||
p_storage->ReadS16(m_niScore);
|
||||
p_storage->ReadS16(m_laScore);
|
||||
p_storage->ReadS16(m_peHighScore);
|
||||
p_storage->ReadS16(m_maHighScore);
|
||||
p_storage->ReadS16(m_paHighScore);
|
||||
p_storage->ReadS16(m_niHighScore);
|
||||
p_storage->ReadS16(m_laHighScore);
|
||||
}
|
||||
else if (p_storage->IsWriteMode()) {
|
||||
p_storage->WriteS16(m_peScore);
|
||||
p_storage->WriteS16(m_maScore);
|
||||
p_storage->WriteS16(m_paScore);
|
||||
p_storage->WriteS16(m_niScore);
|
||||
p_storage->WriteS16(m_laScore);
|
||||
p_storage->WriteS16(m_peHighScore);
|
||||
p_storage->WriteS16(m_maHighScore);
|
||||
p_storage->WriteS16(m_paHighScore);
|
||||
p_storage->WriteS16(m_niHighScore);
|
||||
p_storage->WriteS16(m_laHighScore);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ LegoCacheSoundManager::~LegoCacheSoundManager()
|
||||
|
||||
while (!m_list.empty()) {
|
||||
sound = (*m_list.begin()).GetSound();
|
||||
// TODO: LegoCacheSoundEntry::~LegoCacheSoundEntry should not be inlined here
|
||||
m_list.erase(m_list.begin());
|
||||
sound->Stop();
|
||||
// DECOMP: delete should not be inlined here
|
||||
delete sound;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1084,6 +1084,7 @@ LegoState* LegoGameState::CreateState(const char* p_stateName)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003bc30
|
||||
// FUNCTION: BETA10 0x1008636e
|
||||
void LegoGameState::RegisterState(LegoState* p_state)
|
||||
{
|
||||
MxS32 targetIndex;
|
||||
@@ -1164,7 +1165,16 @@ void LegoGameState::Init()
|
||||
m_unk0x42c = e_undefined;
|
||||
}
|
||||
|
||||
// FUNCTION: BETA10 0x10086510
|
||||
LegoBackgroundColor::LegoBackgroundColor()
|
||||
{
|
||||
m_h = 0.0f;
|
||||
m_s = 0.0f;
|
||||
m_v = 0.0f;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003bfb0
|
||||
// FUNCTION: BETA10 0x1008659d
|
||||
LegoBackgroundColor::LegoBackgroundColor(const char* p_key, const char* p_value)
|
||||
{
|
||||
m_key = p_key;
|
||||
@@ -1173,6 +1183,7 @@ LegoBackgroundColor::LegoBackgroundColor(const char* p_key, const char* p_value)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003c070
|
||||
// FUNCTION: BETA10 0x10086634
|
||||
void LegoBackgroundColor::SetValue(const char* p_colorString)
|
||||
{
|
||||
m_value = p_colorString;
|
||||
@@ -1213,6 +1224,7 @@ void LegoBackgroundColor::SetValue(const char* p_colorString)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003c230
|
||||
// FUNCTION: BETA10 0x100867f9
|
||||
void LegoBackgroundColor::ToggleDayNight(MxBool p_sun)
|
||||
{
|
||||
char buffer[30];
|
||||
@@ -1240,6 +1252,7 @@ void LegoBackgroundColor::ToggleDayNight(MxBool p_sun)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003c330
|
||||
// FUNCTION: BETA10 0x100868de
|
||||
void LegoBackgroundColor::ToggleSkyColor()
|
||||
{
|
||||
char buffer[30];
|
||||
@@ -1259,6 +1272,7 @@ void LegoBackgroundColor::ToggleSkyColor()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003c400
|
||||
// FUNCTION: BETA10 0x10086984
|
||||
void LegoBackgroundColor::SetLightColor(float p_r, float p_g, float p_b)
|
||||
{
|
||||
if (!VideoManager()->GetVideoParam().Flags().GetF2bit0()) {
|
||||
@@ -1293,6 +1307,7 @@ void LegoBackgroundColor::SetLightColor()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003c500
|
||||
// FUNCTION: BETA10 0x10086af6
|
||||
LegoFullScreenMovie::LegoFullScreenMovie(const char* p_key, const char* p_value)
|
||||
{
|
||||
m_key = p_key;
|
||||
@@ -1301,6 +1316,7 @@ LegoFullScreenMovie::LegoFullScreenMovie(const char* p_key, const char* p_value)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003c5c0
|
||||
// FUNCTION: BETA10 0x10086b8d
|
||||
void LegoFullScreenMovie::SetValue(const char* p_option)
|
||||
{
|
||||
m_value = p_option;
|
||||
@@ -1310,12 +1326,9 @@ void LegoFullScreenMovie::SetValue(const char* p_option)
|
||||
if (videomanager) {
|
||||
if (!strcmp(m_value.GetData(), g_strEnable)) {
|
||||
videomanager->EnableFullScreenMovie(TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp(m_value.GetData(), g_strDisable)) {
|
||||
else if (!strcmp(m_value.GetData(), g_strDisable)) {
|
||||
videomanager->EnableFullScreenMovie(FALSE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,30 +14,12 @@ DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
|
||||
// FUNCTION: LEGO1 0x10043f50
|
||||
MxControlPresenter::MxControlPresenter()
|
||||
{
|
||||
this->m_unk0x4c = 0;
|
||||
this->m_unk0x4e = -1;
|
||||
this->m_unk0x50 = FALSE;
|
||||
this->m_unk0x52 = 0;
|
||||
this->m_unk0x58 = 0;
|
||||
this->m_unk0x54 = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10043fd0
|
||||
void MxControlPresenter::RepeatingTickle()
|
||||
{
|
||||
// empty
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10043fe0
|
||||
MxBool MxControlPresenter::VTable0x64(undefined4 p_undefined)
|
||||
{
|
||||
return m_unk0x50;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10043ff0
|
||||
void MxControlPresenter::VTable0x68(MxBool p_unk0x50)
|
||||
{
|
||||
m_unk0x50 = p_unk0x50;
|
||||
m_unk0x4c = 0;
|
||||
m_unk0x4e = -1;
|
||||
m_unk0x50 = FALSE;
|
||||
m_unk0x52 = 0;
|
||||
m_unk0x58 = 0;
|
||||
m_unk0x54 = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10044110
|
||||
@@ -89,6 +71,7 @@ void MxControlPresenter::EndAction()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10044270
|
||||
// FUNCTION: BETA10 0x100eae68
|
||||
MxBool MxControlPresenter::FUN_10044270(MxS32 p_x, MxS32 p_y, MxVideoPresenter* p_presenter)
|
||||
{
|
||||
if (m_unk0x4c == 3) {
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "mxautolock.h"
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
#include "mxdisplaysurface.h"
|
||||
#include "mxdsfile.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxomnicreateflags.h"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "legopathcontroller.h"
|
||||
|
||||
#include "legopathedgecontainer.h"
|
||||
#include "legopathstruct.h"
|
||||
#include "misc/legostorage.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxticklemanager.h"
|
||||
@@ -214,12 +213,21 @@ MxResult LegoPathController::PlaceActor(
|
||||
}
|
||||
|
||||
LegoPathBoundary* pBoundary = GetPathBoundary(p_name);
|
||||
|
||||
assert(pBoundary);
|
||||
assert(p_src < pBoundary->GetNumEdges() && p_dest < pBoundary->GetNumEdges());
|
||||
|
||||
LegoEdge* pSrcE = pBoundary->GetEdges()[p_src];
|
||||
LegoEdge* pDestE = pBoundary->GetEdges()[p_dest];
|
||||
float time = Timer()->GetTime();
|
||||
|
||||
if (p_actor->VTable0x88(pBoundary, time, *pSrcE, p_srcScale, (LegoUnknown100db7f4&) *pDestE, p_destScale) !=
|
||||
SUCCESS) {
|
||||
assert(pSrcE && pDestE);
|
||||
|
||||
float time = Timer()->GetTime();
|
||||
MxResult result =
|
||||
p_actor->VTable0x88(pBoundary, time, *pSrcE, p_srcScale, (LegoUnknown100db7f4&) *pDestE, p_destScale);
|
||||
|
||||
if (result != SUCCESS) {
|
||||
assert(0);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -679,7 +687,7 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage)
|
||||
|
||||
if (boundary.m_numTriggers > 0) {
|
||||
boundary.m_unk0x50 = new Mx3DPointFloat;
|
||||
boundary.m_pathTrigger = new LegoWEGEdge::PathWithTrigger[boundary.m_numTriggers];
|
||||
boundary.m_pathTrigger = new PathWithTrigger[boundary.m_numTriggers];
|
||||
|
||||
for (j = 0; j < boundary.m_numTriggers; j++) {
|
||||
if (p_storage->Read(&s, sizeof(s)) != SUCCESS) {
|
||||
|
||||
@@ -92,12 +92,6 @@ LegoAct2::LegoAct2()
|
||||
NotificationManager()->Register(this);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1004fe10
|
||||
MxBool LegoAct2::VTable0x5c()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1004fe40
|
||||
// FUNCTION: BETA10 0x1003a6f0
|
||||
LegoAct2::~LegoAct2()
|
||||
|
||||
Reference in New Issue
Block a user