Reorganize sources and files (#414)

* Reorganize sources

* Refactor

* Remove relative paths

* Renames

* Fix gitignore

* Remove stuff

* Try fixing format script

* Fix format

* Fix format

* Fix naming script

* Test format

* Fix format
This commit is contained in:
Christian Semmler
2024-01-08 04:58:49 -05:00
committed by GitHub
parent 6a85e62406
commit c47206617d
447 changed files with 347 additions and 346 deletions

View File

@@ -0,0 +1,13 @@
#include "legoactor.h"
DECOMP_SIZE_ASSERT(LegoActor, 0x78)
// FUNCTION: LEGO1 0x1002d110
LegoActor::LegoActor()
{
m_unk0x68 = 0.0f;
m_unk0x6c = 0;
m_unk0x70 = 0.0f;
m_unk0x10 = 0;
m_unk0x74 = 0;
}

View File

@@ -0,0 +1 @@
#include "legoanimactor.h"

View File

@@ -0,0 +1,161 @@
#include "legoentity.h"
#include "define.h"
#include "legoomni.h"
#include "legoutil.h"
#include "legoworld.h"
DECOMP_SIZE_ASSERT(LegoEntity, 0x68)
// FUNCTION: LEGO1 0x1000c290
LegoEntity::~LegoEntity()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x100105f0
void LegoEntity::Init()
{
m_worldLocation.Fill(0);
m_worldDirection.Fill(0);
m_worldSpeed = 0;
m_roi = NULL;
m_cameraFlag = 0;
m_actionArgString = NULL;
m_unk0x10 = 0;
m_unk0x11 = 0;
m_actionType = ExtraActionType_unknown;
m_actionArgNumber = -1;
m_unk0x59 = 4;
}
// STUB: LEGO1 0x10010650
void LegoEntity::ResetWorldTransform(MxBool p_inVehicle)
{
// TODO
}
// STUB: LEGO1 0x10010790
void LegoEntity::SetWorldTransform(Vector3Impl& p_loc, Vector3Impl& p_dir, Vector3Impl& p_up)
{
// TODO
}
// FUNCTION: LEGO1 0x100107e0
MxResult LegoEntity::Create(MxDSObject& p_dsObject)
{
m_mxEntityId = p_dsObject.GetObjectId();
m_atom = p_dsObject.GetAtomId();
Init();
return SUCCESS;
}
// STUB: LEGO1 0x10010810
void LegoEntity::Destroy(MxBool p_fromDestructor)
{
if (m_roi) {
// TODO
}
delete[] m_actionArgString;
Init();
}
// FUNCTION: LEGO1 0x10010880
void LegoEntity::SetWorld()
{
LegoWorld* world = GetCurrentWorld();
if (world != NULL && world != (LegoWorld*) this) {
world->VTable0x58(this);
}
}
// STUB: LEGO1 0x100108a0
void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
{
// TODO
}
// STUB: LEGO1 0x100109b0
void LegoEntity::SetLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up, MxBool)
{
// TODO
}
// STUB: LEGO1 0x10010c30
void LegoEntity::FUN_10010c30()
{
}
// FUNCTION: LEGO1 0x10010e10
void LegoEntity::ParseAction(char* p_extra)
{
char copy[1024];
char actionValue[1024];
strcpy(copy, p_extra);
if (KeyValueStringParse(actionValue, g_strACTION, copy)) {
m_actionType = MatchActionString(strtok(actionValue, g_parseExtraTokens));
if (m_actionType != ExtraActionType_exit) {
char* token = strtok(NULL, g_parseExtraTokens);
m_actionArgString = new char[strlen(token) + 1];
strcpy(m_actionArgString, token);
if (m_actionType != ExtraActionType_run) {
m_actionArgNumber = atoi(strtok(NULL, g_parseExtraTokens));
}
}
}
}
// STUB: LEGO1 0x10010f10
void LegoEntity::VTable0x34()
{
// TODO
}
// STUB: LEGO1 0x10011070
void LegoEntity::VTable0x38()
{
// TODO
}
// STUB: LEGO1 0x10011300
void LegoEntity::VTable0x3c()
{
// TODO
}
// STUB: LEGO1 0x10011360
void LegoEntity::VTable0x40()
{
// TODO
}
// STUB: LEGO1 0x100113c0
void LegoEntity::VTable0x44()
{
// TODO
}
// STUB: LEGO1 0x10011420
void LegoEntity::VTable0x48()
{
// TODO
}
// STUB: LEGO1 0x10011470
void LegoEntity::VTable0x4c()
{
// TODO
}
// STUB: LEGO1 0x100114f0
MxLong LegoEntity::Notify(MxParam& p_param)
{
// TODO
return 0;
}

View File

@@ -0,0 +1,105 @@
#include "legoentitypresenter.h"
#include "islepathactor.h"
#include "legoomni.h"
#include "legovideomanager.h"
DECOMP_SIZE_ASSERT(LegoEntityPresenter, 0x50);
// FUNCTION: LEGO1 0x10053440
LegoEntityPresenter::LegoEntityPresenter()
{
Init();
}
// FUNCTION: LEGO1 0x100535c0
void LegoEntityPresenter::Init()
{
m_objectBackend = 0;
}
// FUNCTION: LEGO1 0x100535d0
LegoEntityPresenter::~LegoEntityPresenter()
{
Destroy(TRUE);
}
// FUNCTION: LEGO1 0x10053630
undefined4 LegoEntityPresenter::SetBackend(LegoEntity* p_backend)
{
m_objectBackend = p_backend;
return 0;
}
// FUNCTION: LEGO1 0x10053640
void LegoEntityPresenter::Destroy(MxBool p_fromDestructor)
{
if (VideoManager()) {
VideoManager()->RemovePresenter(*this);
}
Init();
}
// FUNCTION: LEGO1 0x10053670
void LegoEntityPresenter::Destroy()
{
Destroy(FALSE);
}
// FUNCTION: LEGO1 0x10053680
MxResult LegoEntityPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
MxResult result = MxCompositePresenter::StartAction(p_controller, p_action);
if (VideoManager()) {
VideoManager()->AddPresenter(*this);
}
return result;
}
// FUNCTION: LEGO1 0x100536c0
void LegoEntityPresenter::ReadyTickle()
{
if (GetCurrentWorld()) {
m_objectBackend = (LegoEntity*) MxPresenter::CreateEntityBackend("LegoEntity");
if (m_objectBackend) {
m_objectBackend->Create(*m_action);
m_objectBackend->SetLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), TRUE);
ParseExtra();
}
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
}
}
// FUNCTION: LEGO1 0x10053720
void LegoEntityPresenter::RepeatingTickle()
{
if (m_list.empty()) {
EndAction();
}
}
// FUNCTION: LEGO1 0x10053730
void LegoEntityPresenter::SetBackendLocation(Vector3Data& p_location, Vector3Data& p_direction, Vector3Data& p_up)
{
if (m_objectBackend) {
m_objectBackend->SetLocation(p_location, p_direction, p_up, TRUE);
}
}
// FUNCTION: LEGO1 0x10053750
void LegoEntityPresenter::ParseExtra()
{
char data[512];
MxU16 len = m_action->GetExtraLength();
if (len) {
memcpy(data, m_action->GetExtraData(), len);
data[len] = 0;
len &= MAXWORD;
m_objectBackend->ParseAction(data);
}
}

View File

@@ -0,0 +1 @@
#include "legojetski.h"

View File

@@ -0,0 +1,87 @@
#include "legopathactor.h"
DECOMP_SIZE_ASSERT(LegoPathActor, 0x154)
// STUB: LEGO1 0x1002d700
LegoPathActor::LegoPathActor()
{
// TODO
}
// STUB: LEGO1 0x1002d820
LegoPathActor::~LegoPathActor()
{
// TODO
}
// STUB: LEGO1 0x1002d8d0
void LegoPathActor::VTable0x80()
{
// TODO
}
// STUB: LEGO1 0x1002d9c0
void LegoPathActor::VTable0x88()
{
// TODO
}
// STUB: LEGO1 0x1002de10
void LegoPathActor::VTable0x84()
{
// TODO
}
// STUB: LEGO1 0x1002e100
void LegoPathActor::VTable0x8c()
{
// TODO
}
// STUB: LEGO1 0x1002e740
void LegoPathActor::VTable0x74(Matrix4Impl& p_transform)
{
// TODO
}
// STUB: LEGO1 0x1002e790
void LegoPathActor::VTable0x70(float)
{
// TODO
}
// STUB: LEGO1 0x1002e8b0
void LegoPathActor::VTable0x98()
{
// TODO
}
// STUB: LEGO1 0x1002e8d0
void LegoPathActor::VTable0x6c()
{
// TODO
}
// STUB: LEGO1 0x1002ebe0
void LegoPathActor::VTable0x68()
{
// TODO
}
// STUB: LEGO1 0x1002f1b0
void LegoPathActor::VTable0x9c()
{
// TODO
}
// STUB: LEGO1 0x1002f650
void LegoPathActor::VTable0xa4()
{
// TODO
}
// STUB: LEGO1 0x1002f700
void LegoPathActor::VTable0xa8()
{
// TODO
}

View File

@@ -0,0 +1,88 @@
#include "legorace.h"
#include "mxnotificationmanager.h"
DECOMP_SIZE_ASSERT(LegoRace, 0x144)
// FUNCTION: LEGO1 0x1000dab0
undefined4 LegoRace::VTable0x78(undefined4)
{
return 0;
}
// STUB: LEGO1 0x1000dac0
void LegoRace::VTable0x7c(undefined4, undefined4)
{
// TODO
}
// FUNCTION: LEGO1 0x1000dae0
MxBool LegoRace::VTable0x5c()
{
return TRUE;
}
// FUNCTION: LEGO1 0x10015aa0
LegoRace::LegoRace()
{
this->m_unk0xf8 = 0;
this->m_unk0xfc = 0;
this->m_unk0x100 = 0;
this->m_unk0x104 = 0;
this->m_unk0x108 = 0;
this->m_unk0x10c = 0;
this->m_unk0x140 = 0;
this->m_unk0x110 = 0;
this->m_unk0x114 = 0;
this->m_unk0x118 = 0;
this->m_unk0x128 = 0;
this->m_unk0x12c = 0;
this->m_unk0x120 = 0;
this->m_unk0x124 = 0;
this->m_unk0x11c = 0;
NotificationManager()->Register(this);
}
// FUNCTION: LEGO1 0x10015b70
undefined4 LegoRace::VTable0x70(undefined4)
{
return 0;
}
// FUNCTION: LEGO1 0x10015b80
undefined4 LegoRace::VTable0x74(undefined4)
{
return 0;
}
// FUNCTION: LEGO1 0x10015b90
MxBool LegoRace::VTable0x64()
{
return FALSE;
}
// STUB: LEGO1 0x10015ce0
MxResult LegoRace::Create(MxDSObject& p_dsObject)
{
// TODO
return SUCCESS;
}
// STUB: LEGO1 0x10015d40
LegoRace::~LegoRace()
{
// TODO
}
// STUB: LEGO1 0x10015e00
MxLong LegoRace::Notify(MxParam& p_param)
{
// TODO
return 0;
}
// STUB: LEGO1 0x10015ed0
void LegoRace::VTable0x68(MxBool p_add)
{
// TODO
}

View File

@@ -0,0 +1,153 @@
#include "legoworld.h"
#include "legoinputmanager.h"
#include "legoomni.h"
#include "legoutil.h"
#include "mxactionnotificationparam.h"
#include "mxnotificationmanager.h"
#include "mxnotificationparam.h"
#include "mxomni.h"
#include "mxticklemanager.h"
DECOMP_SIZE_ASSERT(LegoWorld, 0xf8);
// STUB: LEGO1 0x1001ca40
LegoWorld::LegoWorld() : m_list0x68(TRUE)
{
// TODO
m_unk0xf6 = FALSE;
m_unk0xf4 = 4;
NotificationManager()->Register(this);
}
// FUNCTION: LEGO1 0x1001d670
MxBool LegoWorld::VTable0x5c()
{
return FALSE;
}
// FUNCTION: LEGO1 0x1001d680
MxBool LegoWorld::VTable0x64()
{
return FALSE;
}
// STUB: LEGO1 0x1001dfa0
LegoWorld::~LegoWorld()
{
// TODO
}
// STUB: LEGO1 0x1001e0b0
MxResult LegoWorld::SetAsCurrentWorld(MxDSObject& p_dsObject)
{
// TODO
return SUCCESS;
}
// FUNCTION: LEGO1 0x1001f5e0
MxLong LegoWorld::Notify(MxParam& p_param)
{
MxLong ret = 0;
switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationEndAction: {
MxPresenter* presenter = (MxPresenter*) ((MxEndActionNotificationParam&) p_param).GetSender();
EndAction(presenter);
ret = 1;
break;
}
case c_notificationNewPresenter:
TickleManager()->RegisterClient(this, 100);
break;
}
return ret;
}
// STUB: LEGO1 0x1001f630
void LegoWorld::VTable0x54()
{
// TODO
}
// STUB: LEGO1 0x1001fc80
void LegoWorld::FUN_1001fc80(IslePathActor* p_actor)
{
}
// STUB: LEGO1 0x10020120
MxS32 LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value)
{
// TODO
return 0;
}
// STUB: LEGO1 0x10020220
void LegoWorld::VTable0x58(MxCore* p_object)
{
// TODO
}
// STUB: LEGO1 0x10020f10
void LegoWorld::EndAction(MxCore* p_object)
{
}
// STUB: LEGO1 0x10021a70
void LegoWorld::VTable0x68(MxBool p_add)
{
// TODO
}
// FUNCTION: LEGO1 0x10022080
MxResult LegoWorld::Tickle()
{
if (!m_unk0xf6) {
switch (m_unk0xf4) {
case 0:
m_unk0xf6 = TRUE;
SetAppCursor(0);
Stop();
return TRUE;
case 2:
if (FUN_100220e0() == 1)
break;
default:
m_unk0xf4--;
}
}
return TRUE;
}
// STUB: LEGO1 0x100220e0
undefined LegoWorld::FUN_100220e0()
{
return TRUE;
}
// FUNCTION: LEGO1 0x10022340
void LegoWorld::Stop()
{
TickleManager()->UnregisterClient(this);
}
// STUB: LEGO1 0x100727e0
MxBool LegoWorld::FUN_100727e0(MxU32, Vector3Data& p_loc, Vector3Data& p_dir, Vector3Data& p_up)
{
return FALSE;
}
// STUB: LEGO1 0x10072980
MxBool LegoWorld::FUN_10072980(MxU32, Vector3Data& p_loc, Vector3Data& p_dir, Vector3Data& p_up)
{
return FALSE;
}
// STUB: LEGO1 0x10073400
void LegoWorld::FUN_10073400()
{
}
// STUB: LEGO1 0x10073430
void LegoWorld::FUN_10073430()
{
}

View File

@@ -0,0 +1,131 @@
#include "legoworldpresenter.h"
#include "legoentity.h"
#include "legoomni.h"
#include "legovideomanager.h"
#include "mxactionnotificationparam.h"
#include "mxautolocker.h"
#include "mxdsactionlist.h"
#include "mxdsmultiaction.h"
#include "mxobjectfactory.h"
#include "mxpresenter.h"
#include "mxstl/stlcompat.h"
// GLOBAL: LEGO1 0x100f75d4
undefined4 g_legoWorldPresenterQuality = 1;
// FUNCTION: LEGO1 0x100665b0
void LegoWorldPresenter::configureLegoWorldPresenter(MxS32 p_legoWorldPresenterQuality)
{
g_legoWorldPresenterQuality = p_legoWorldPresenterQuality;
}
// FUNCTION: LEGO1 0x100665c0
LegoWorldPresenter::LegoWorldPresenter()
{
m_unk0x50 = 50000;
}
// STUB: LEGO1 0x10066770
LegoWorldPresenter::~LegoWorldPresenter()
{
// TODO
}
// FUNCTION: LEGO1 0x10066870
MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
MxAutoLocker lock(&m_criticalSection);
MxResult result = FAILURE;
MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList();
MxObjectFactory* factory = ObjectFactory();
MxDSActionListCursor cursor(actions);
MxDSAction* action;
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
// The usual cursor.Next() loop doesn't match here, even though
// the logic is the same. It does match when "deconstructed" into
// the following Head(), Current() and NextFragment() calls,
// but this seems unlikely to be the original code.
// The alpha debug build also uses Next().
cursor.Head();
while (cursor.Current(action)) {
cursor.NextFragment();
MxBool success = FALSE;
action->CopyFlags(m_action->GetFlags());
const char* presenterName = PresenterNameDispatch(*action);
MxPresenter* presenter = (MxPresenter*) factory->Create(presenterName);
if (presenter && presenter->AddToManager() == SUCCESS) {
presenter->SetCompositePresenter(this);
if (presenter->StartAction(p_controller, action) == SUCCESS) {
presenter->SetTickleState(TickleState_Idle);
success = TRUE;
}
}
if (success) {
action->SetOrigin(this);
m_list.push_back(presenter);
}
else if (presenter)
delete presenter;
}
VideoManager()->AddPresenter(*this);
result = SUCCESS;
}
return result;
}
// FUNCTION: LEGO1 0x10066a50
void LegoWorldPresenter::ReadyTickle()
{
m_objectBackend = (LegoEntity*) MxPresenter::CreateEntityBackend("LegoWorld");
if (m_objectBackend) {
m_objectBackend->Create(*m_action);
Lego()->AddWorld((LegoWorld*) m_objectBackend);
SetBackendLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp());
}
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
}
// FUNCTION: LEGO1 0x10066ac0
void LegoWorldPresenter::StartingTickle()
{
if (m_action->IsA("MxDSSerialAction")) {
MxPresenter* presenter = *m_list.begin();
if (presenter->GetCurrentTickleState() == TickleState_Idle) {
presenter->SetTickleState(TickleState_Ready);
}
}
else {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
if ((*it)->GetCurrentTickleState() == TickleState_Idle) {
(*it)->SetTickleState(TickleState_Ready);
}
}
}
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
}
// STUB: LEGO1 0x10067a70
void LegoWorldPresenter::VTable0x60(MxPresenter* p_presenter)
{
}
// STUB: LEGO1 0x10067b00
void LegoWorldPresenter::ParseExtra()
{
}