mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Introduce clang-format (#240)
This commit is contained in:

committed by
GitHub

parent
e928fc9425
commit
b449da1fa3
@@ -1,373 +1,373 @@
|
||||
#include "legoomni.h"
|
||||
|
||||
#include "legogamestate.h"
|
||||
#include "legoinputmanager.h"
|
||||
#include "legoobjectfactory.h"
|
||||
#include "legoutil.h"
|
||||
#include "legoworld.h"
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
#include "mxdsfile.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legoutil.h"
|
||||
#include "legoobjectfactory.h"
|
||||
#include "legoinputmanager.h"
|
||||
#include "legoworld.h"
|
||||
|
||||
// 0x100f4588
|
||||
MxAtomId *g_nocdSourceName = NULL;
|
||||
MxAtomId* g_nocdSourceName = NULL;
|
||||
|
||||
// 0x100f456c
|
||||
MxAtomId *g_jukeboxScript = NULL;
|
||||
MxAtomId* g_jukeboxScript = NULL;
|
||||
|
||||
// 0x101020e8
|
||||
void (*g_omniUserMessage)(const char *,int);
|
||||
void (*g_omniUserMessage)(const char*, int);
|
||||
|
||||
// OFFSET: LEGO1 0x10058a00
|
||||
LegoOmni::LegoOmni()
|
||||
{
|
||||
Init();
|
||||
Init();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10058b50
|
||||
LegoOmni::~LegoOmni()
|
||||
{
|
||||
Destroy();
|
||||
Destroy();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b560
|
||||
void LegoOmni::CreateBackgroundAudio()
|
||||
{
|
||||
if (m_bkgAudioManager)
|
||||
m_bkgAudioManager->Create(*g_jukeboxScript, 100);
|
||||
if (m_bkgAudioManager)
|
||||
m_bkgAudioManager->Create(*g_jukeboxScript, 100);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005af10 STUB
|
||||
void LegoOmni::RemoveWorld(const MxAtomId &p1, MxLong p2)
|
||||
void LegoOmni::RemoveWorld(const MxAtomId& p1, MxLong p2)
|
||||
{
|
||||
// TODO
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b400 STUB
|
||||
int LegoOmni::GetCurrPathInfo(LegoPathBoundary **,int &)
|
||||
int LegoOmni::GetCurrPathInfo(LegoPathBoundary**, int&)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b6ff0
|
||||
void MakeSourceName(char *p_output, const char *p_input)
|
||||
void MakeSourceName(char* p_output, const char* p_input)
|
||||
{
|
||||
const char *cln = strchr(p_input, ':');
|
||||
if (cln) {
|
||||
p_input = cln + 1;
|
||||
}
|
||||
const char* cln = strchr(p_input, ':');
|
||||
if (cln) {
|
||||
p_input = cln + 1;
|
||||
}
|
||||
|
||||
strcpy(p_output, p_input);
|
||||
strcpy(p_output, p_input);
|
||||
|
||||
strlwr(p_output);
|
||||
strlwr(p_output);
|
||||
|
||||
char *extLoc = strstr(p_output, ".si");
|
||||
if (extLoc) {
|
||||
*extLoc = 0;
|
||||
}
|
||||
char* extLoc = strstr(p_output, ".si");
|
||||
if (extLoc) {
|
||||
*extLoc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b7050
|
||||
MxBool KeyValueStringParse(char *p_outputValue, const char *p_key, const char *p_source)
|
||||
MxBool KeyValueStringParse(char* p_outputValue, const char* p_key, const char* p_source)
|
||||
{
|
||||
MxBool didMatch = FALSE;
|
||||
MxBool didMatch = FALSE;
|
||||
|
||||
MxS16 len = strlen(p_source);
|
||||
char *temp = new char[len + 1];
|
||||
strcpy(temp, p_source);
|
||||
MxS16 len = strlen(p_source);
|
||||
char* temp = new char[len + 1];
|
||||
strcpy(temp, p_source);
|
||||
|
||||
char *token = strtok(temp, ", \t\r\n:");
|
||||
while (token) {
|
||||
len -= (strlen(token) + 1);
|
||||
char* token = strtok(temp, ", \t\r\n:");
|
||||
while (token) {
|
||||
len -= (strlen(token) + 1);
|
||||
|
||||
if (strcmpi(token, p_key) == 0) {
|
||||
if (p_outputValue && len > 0) {
|
||||
char *cur = &token[strlen(p_key)];
|
||||
cur++;
|
||||
while (*cur != ',') {
|
||||
if (*cur == ' ' || *cur == '\0' || *cur == '\t' || *cur == '\n' || *cur == '\r')
|
||||
break;
|
||||
*p_outputValue++ = *cur++;
|
||||
}
|
||||
*p_outputValue = '\0';
|
||||
}
|
||||
if (strcmpi(token, p_key) == 0) {
|
||||
if (p_outputValue && len > 0) {
|
||||
char* cur = &token[strlen(p_key)];
|
||||
cur++;
|
||||
while (*cur != ',') {
|
||||
if (*cur == ' ' || *cur == '\0' || *cur == '\t' || *cur == '\n' || *cur == '\r')
|
||||
break;
|
||||
*p_outputValue++ = *cur++;
|
||||
}
|
||||
*p_outputValue = '\0';
|
||||
}
|
||||
|
||||
didMatch = TRUE;
|
||||
break;
|
||||
}
|
||||
didMatch = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok(NULL, ", \t\r\n:");
|
||||
}
|
||||
token = strtok(NULL, ", \t\r\n:");
|
||||
}
|
||||
|
||||
delete[] temp;
|
||||
return didMatch;
|
||||
delete[] temp;
|
||||
return didMatch;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b7210
|
||||
void SetOmniUserMessage(void (*p_userMsg)(const char *,int))
|
||||
void SetOmniUserMessage(void (*p_userMsg)(const char*, int))
|
||||
{
|
||||
g_omniUserMessage = p_userMsg;
|
||||
g_omniUserMessage = p_userMsg;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100acf50
|
||||
MxResult Start(MxDSAction* p_dsAction)
|
||||
{
|
||||
return MxOmni::GetInstance()->Start(p_dsAction);
|
||||
return MxOmni::GetInstance()->Start(p_dsAction);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005ad10
|
||||
LegoOmni *LegoOmni::GetInstance()
|
||||
LegoOmni* LegoOmni::GetInstance()
|
||||
{
|
||||
return (LegoOmni *)MxOmni::GetInstance();
|
||||
return (LegoOmni*) MxOmni::GetInstance();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005ac90
|
||||
void LegoOmni::CreateInstance()
|
||||
{
|
||||
MxOmni::DestroyInstance();
|
||||
MxOmni::SetInstance(new LegoOmni());
|
||||
MxOmni::DestroyInstance();
|
||||
MxOmni::SetInstance(new LegoOmni());
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015700
|
||||
LegoOmni *Lego()
|
||||
LegoOmni* Lego()
|
||||
{
|
||||
return (LegoOmni *)MxOmni::GetInstance();
|
||||
return (LegoOmni*) MxOmni::GetInstance();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015710
|
||||
LegoSoundManager *SoundManager()
|
||||
LegoSoundManager* SoundManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetSoundManager();
|
||||
return LegoOmni::GetInstance()->GetSoundManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015720
|
||||
LegoVideoManager *VideoManager()
|
||||
LegoVideoManager* VideoManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetVideoManager();
|
||||
return LegoOmni::GetInstance()->GetVideoManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015730
|
||||
MxBackgroundAudioManager *BackgroundAudioManager()
|
||||
MxBackgroundAudioManager* BackgroundAudioManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetBackgroundAudioManager();
|
||||
return LegoOmni::GetInstance()->GetBackgroundAudioManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015740
|
||||
LegoInputManager *InputManager()
|
||||
LegoInputManager* InputManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetInputManager();
|
||||
return LegoOmni::GetInstance()->GetInputManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015750
|
||||
LegoControlManager *ControlManager()
|
||||
LegoControlManager* ControlManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetInputManager()->GetControlManager();
|
||||
return LegoOmni::GetInstance()->GetInputManager()->GetControlManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015760
|
||||
LegoGameState *GameState()
|
||||
LegoGameState* GameState()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetGameState();
|
||||
return LegoOmni::GetInstance()->GetGameState();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015770
|
||||
LegoAnimationManager *AnimationManager()
|
||||
LegoAnimationManager* AnimationManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetAnimationManager();
|
||||
return LegoOmni::GetInstance()->GetAnimationManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015780
|
||||
LegoNavController *NavController()
|
||||
LegoNavController* NavController()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetNavController();
|
||||
return LegoOmni::GetInstance()->GetNavController();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015790
|
||||
LegoWorld *GetCurrentVehicle()
|
||||
LegoWorld* GetCurrentVehicle()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetCurrentVehicle();
|
||||
return LegoOmni::GetInstance()->GetCurrentVehicle();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100157a0
|
||||
LegoWorld *GetCurrentWorld()
|
||||
LegoWorld* GetCurrentWorld()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetCurrentWorld();
|
||||
return LegoOmni::GetInstance()->GetCurrentWorld();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100157e0
|
||||
LegoPlantManager *PlantManager()
|
||||
LegoPlantManager* PlantManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetLegoPlantManager();
|
||||
return LegoOmni::GetInstance()->GetLegoPlantManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100157f0
|
||||
LegoBuildingManager *BuildingManager()
|
||||
LegoBuildingManager* BuildingManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetLegoBuildingManager();
|
||||
return LegoOmni::GetInstance()->GetLegoBuildingManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015800
|
||||
GifManager *GetGifManager()
|
||||
GifManager* GetGifManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetGifManager();
|
||||
return LegoOmni::GetInstance()->GetGifManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10015900
|
||||
MxTransitionManager *TransitionManager()
|
||||
MxTransitionManager* TransitionManager()
|
||||
{
|
||||
return LegoOmni::GetInstance()->GetTransitionManager();
|
||||
return LegoOmni::GetInstance()->GetTransitionManager();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100c0280
|
||||
MxDSObject *CreateStreamObject(MxDSFile *p_file, MxS16 p_ofs)
|
||||
MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs)
|
||||
{
|
||||
char *buf;
|
||||
_MMCKINFO tmp_chunk;
|
||||
char* buf;
|
||||
_MMCKINFO tmp_chunk;
|
||||
|
||||
if (p_file->Seek(((MxLong*)p_file->GetBuffer())[p_ofs], 0)) {
|
||||
return NULL;
|
||||
}
|
||||
if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], 0)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (p_file->Read((MxU8*)&tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'S', 't')) {
|
||||
if (p_file->Read((MxU8*)&tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'O', 'b')) {
|
||||
if (p_file->Read((MxU8*) &tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'S', 't')) {
|
||||
if (p_file->Read((MxU8*) &tmp_chunk.ckid, 8) == 0 && tmp_chunk.ckid == FOURCC('M', 'x', 'O', 'b')) {
|
||||
|
||||
buf = new char[tmp_chunk.cksize];
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
buf = new char[tmp_chunk.cksize];
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (p_file->Read((MxU8*)buf, tmp_chunk.cksize) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (p_file->Read((MxU8*) buf, tmp_chunk.cksize) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Save a copy so we can clean up properly, because
|
||||
// this function will alter the pointer value.
|
||||
char *copy = buf;
|
||||
MxDSObject *obj = DeserializeDSObjectDispatch(&buf, -1);
|
||||
delete[] copy;
|
||||
return obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
// Save a copy so we can clean up properly, because
|
||||
// this function will alter the pointer value.
|
||||
char* copy = buf;
|
||||
MxDSObject* obj = DeserializeDSObjectDispatch(&buf, -1);
|
||||
delete[] copy;
|
||||
return obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10053430
|
||||
const char *GetNoCD_SourceName()
|
||||
const char* GetNoCD_SourceName()
|
||||
{
|
||||
return g_nocdSourceName->GetInternal();
|
||||
return g_nocdSourceName->GetInternal();
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b5f0
|
||||
MxLong LegoOmni::Notify(MxParam &p)
|
||||
MxLong LegoOmni::Notify(MxParam& p)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003dd70 STUB
|
||||
LegoROI *PickROI(MxLong,MxLong)
|
||||
LegoROI* PickROI(MxLong, MxLong)
|
||||
{
|
||||
// TODO
|
||||
return NULL;
|
||||
// TODO
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1003ddc0 STUB
|
||||
LegoEntity *PickEntity(MxLong,MxLong)
|
||||
LegoEntity* PickEntity(MxLong, MxLong)
|
||||
{
|
||||
// TODO
|
||||
return NULL;
|
||||
// TODO
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10058bd0
|
||||
void LegoOmni::Init()
|
||||
{
|
||||
MxOmni::Init();
|
||||
m_unk68 = 0;
|
||||
m_inputMgr = NULL;
|
||||
m_unk6c = 0;
|
||||
m_gifManager = NULL;
|
||||
m_unk78 = 0;
|
||||
m_currentWorld = NULL;
|
||||
m_unk80 = FALSE;
|
||||
m_currentVehicle = NULL;
|
||||
m_unkLegoSaveDataWriter = NULL;
|
||||
m_plantManager = NULL;
|
||||
m_gameState = NULL;
|
||||
m_animationManager = NULL;
|
||||
m_buildingManager = NULL;
|
||||
m_bkgAudioManager = NULL;
|
||||
m_unk13c = TRUE;
|
||||
m_transitionManager = NULL;
|
||||
MxOmni::Init();
|
||||
m_unk68 = 0;
|
||||
m_inputMgr = NULL;
|
||||
m_unk6c = 0;
|
||||
m_gifManager = NULL;
|
||||
m_unk78 = 0;
|
||||
m_currentWorld = NULL;
|
||||
m_unk80 = FALSE;
|
||||
m_currentVehicle = NULL;
|
||||
m_unkLegoSaveDataWriter = NULL;
|
||||
m_plantManager = NULL;
|
||||
m_gameState = NULL;
|
||||
m_animationManager = NULL;
|
||||
m_buildingManager = NULL;
|
||||
m_bkgAudioManager = NULL;
|
||||
m_unk13c = TRUE;
|
||||
m_transitionManager = NULL;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10058e70 STUB
|
||||
MxResult LegoOmni::Create(MxOmniCreateParam &p)
|
||||
MxResult LegoOmni::Create(MxOmniCreateParam& p)
|
||||
{
|
||||
MxOmni::Create(p);
|
||||
MxOmni::Create(p);
|
||||
|
||||
m_objectFactory = new LegoObjectFactory();
|
||||
m_gameState = new LegoGameState();
|
||||
m_bkgAudioManager = new MxBackgroundAudioManager();
|
||||
m_objectFactory = new LegoObjectFactory();
|
||||
m_gameState = new LegoGameState();
|
||||
m_bkgAudioManager = new MxBackgroundAudioManager();
|
||||
|
||||
return SUCCESS;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x10058c30 STUB
|
||||
void LegoOmni::Destroy()
|
||||
{
|
||||
// TODO
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b580
|
||||
MxResult LegoOmni::Start(MxDSAction* action)
|
||||
{
|
||||
MxResult result = MxOmni::Start(action);
|
||||
this->m_action.SetAtomId(action->GetAtomId());
|
||||
this->m_action.SetObjectId(action->GetObjectId());
|
||||
this->m_action.SetUnknown24(action->GetUnknown24());
|
||||
return result;
|
||||
MxResult result = MxOmni::Start(action);
|
||||
this->m_action.SetAtomId(action->GetAtomId());
|
||||
this->m_action.SetObjectId(action->GetObjectId());
|
||||
this->m_action.SetUnknown24(action->GetUnknown24());
|
||||
return result;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b1d0 STUB
|
||||
MxResult LegoOmni::DeleteObject(MxDSAction &ds)
|
||||
MxResult LegoOmni::DeleteObject(MxDSAction& ds)
|
||||
{
|
||||
// TODO
|
||||
return FAILURE;
|
||||
// TODO
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b3c0 STUB
|
||||
MxBool LegoOmni::DoesEntityExist(MxDSAction &ds)
|
||||
MxBool LegoOmni::DoesEntityExist(MxDSAction& ds)
|
||||
{
|
||||
// TODO
|
||||
return TRUE;
|
||||
// TODO
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b2f0 STUB
|
||||
int LegoOmni::Vtable0x30(char*, int, MxCore*)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b3a0
|
||||
void LegoOmni::NotifyCurrentEntity(MxNotificationParam *p_param)
|
||||
void LegoOmni::NotifyCurrentEntity(MxNotificationParam* p_param)
|
||||
{
|
||||
if (m_currentWorld)
|
||||
NotificationManager()->Send(m_currentWorld, p_param);
|
||||
if (m_currentWorld)
|
||||
NotificationManager()->Send(m_currentWorld, p_param);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b640
|
||||
void LegoOmni::StartTimer()
|
||||
{
|
||||
MxOmni::StartTimer();
|
||||
SetAppCursor(2);
|
||||
MxOmni::StartTimer();
|
||||
SetAppCursor(2);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1005b650
|
||||
void LegoOmni::StopTimer()
|
||||
{
|
||||
MxOmni::StopTimer();
|
||||
SetAppCursor(0);
|
||||
MxOmni::StopTimer();
|
||||
SetAppCursor(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user