2023-06-11 01:11:05 -04:00
|
|
|
#include "legoomni.h"
|
|
|
|
|
2023-09-20 16:22:57 -04:00
|
|
|
#include "mxdsobject.h"
|
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
// 0x100f4588
|
|
|
|
char *g_nocdSourceName = NULL;
|
|
|
|
|
|
|
|
// 0x101020e8
|
|
|
|
void (*g_omniUserMessage)(const char *,int);
|
|
|
|
|
2023-06-19 02:19:40 -04:00
|
|
|
// OFFSET: LEGO1 0x10058a00
|
|
|
|
LegoOmni::LegoOmni()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x10058b50
|
|
|
|
LegoOmni::~LegoOmni()
|
|
|
|
{
|
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
// OFFSET: LEGO1 0x1005b560 STUB
|
|
|
|
void LegoOmni::CreateBackgroundAudio()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005af10 STUB
|
2023-07-02 04:05:49 -04:00
|
|
|
void LegoOmni::RemoveWorld(const MxAtomId &p1, MxLong p2)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005b400 STUB
|
|
|
|
int LegoOmni::GetCurrPathInfo(LegoPathBoundary **,int &)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-09-25 22:30:56 -04:00
|
|
|
// OFFSET: LEGO1 0x100b6ff0
|
|
|
|
void MakeSourceName(char *p_output, const char *p_input)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-09-25 22:30:56 -04:00
|
|
|
const char *cln = strchr(p_input, ':');
|
|
|
|
if (cln) {
|
|
|
|
p_input = cln + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
strcpy(p_output, p_input);
|
|
|
|
|
|
|
|
strlwr(p_output);
|
|
|
|
|
|
|
|
char *extLoc = strstr(p_output, ".si");
|
|
|
|
if (extLoc) {
|
|
|
|
*extLoc = 0;
|
|
|
|
}
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
2023-09-13 03:44:03 -04:00
|
|
|
// OFFSET: LEGO1 0x100b7050
|
2023-09-27 15:16:46 -04:00
|
|
|
MxBool KeyValueStringParse(char *p_outputValue, const char *p_key, const char *p_source)
|
2023-09-13 03:44:03 -04:00
|
|
|
{
|
|
|
|
MxBool didMatch = FALSE;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
token = strtok(NULL, ", \t\r\n:");
|
|
|
|
}
|
|
|
|
|
|
|
|
delete[] temp;
|
|
|
|
return didMatch;
|
|
|
|
}
|
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
// OFFSET: LEGO1 0x100b7210
|
|
|
|
void SetOmniUserMessage(void (*p_userMsg)(const char *,int))
|
|
|
|
{
|
|
|
|
g_omniUserMessage = p_userMsg;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100acf50 STUB
|
2023-07-02 04:05:49 -04:00
|
|
|
MxLong Start(MxDSAction *)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-06-18 23:56:55 -04:00
|
|
|
// OFFSET: LEGO1 0x1005ad10
|
2023-06-11 01:11:05 -04:00
|
|
|
LegoOmni *LegoOmni::GetInstance()
|
|
|
|
{
|
2023-06-29 13:02:47 -04:00
|
|
|
return (LegoOmni *)MxOmni::GetInstance();
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1005ac90
|
|
|
|
void LegoOmni::CreateInstance()
|
|
|
|
{
|
|
|
|
MxOmni::DestroyInstance();
|
|
|
|
MxOmni::SetInstance(new LegoOmni());
|
2023-06-11 01:11:05 -04:00
|
|
|
}
|
|
|
|
|
2023-06-18 23:56:55 -04:00
|
|
|
// OFFSET: LEGO1 0x10015700
|
2023-06-11 01:11:05 -04:00
|
|
|
LegoOmni *Lego()
|
|
|
|
{
|
2023-06-29 13:02:47 -04:00
|
|
|
return (LegoOmni *)MxOmni::GetInstance();
|
2023-06-11 01:11:05 -04:00
|
|
|
}
|
2023-06-18 07:45:39 -04:00
|
|
|
|
2023-06-22 12:23:54 -04:00
|
|
|
// OFFSET: LEGO1 0x10015710
|
|
|
|
LegoSoundManager *SoundManager()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetSoundManager();
|
|
|
|
}
|
|
|
|
|
2023-06-18 23:56:55 -04:00
|
|
|
// OFFSET: LEGO1 0x10015720
|
2023-06-18 07:45:39 -04:00
|
|
|
LegoVideoManager *VideoManager()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetVideoManager();
|
2023-06-18 23:56:55 -04:00
|
|
|
}
|
2023-06-19 02:19:40 -04:00
|
|
|
|
2023-06-29 04:10:08 -04:00
|
|
|
// OFFSET: LEGO1 0x100157f0
|
|
|
|
LegoBuildingManager *BuildingManager()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetLegoBuildingManager();
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x10015790
|
|
|
|
Isle *GetIsle()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetIsle();
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100157e0
|
|
|
|
LegoPlantManager *PlantManager()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetLegoPlantManager();
|
|
|
|
}
|
|
|
|
|
2023-06-22 12:23:54 -04:00
|
|
|
// OFFSET: LEGO1 0x10015730
|
|
|
|
MxBackgroundAudioManager *BackgroundAudioManager()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetBackgroundAudioManager();
|
|
|
|
}
|
|
|
|
|
2023-09-20 16:22:57 -04:00
|
|
|
// OFFSET: LEGO1 0x100c0280
|
|
|
|
MxDSObject *CreateStreamObject(MxDSFile *p_file, MxS16 p_ofs)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-09-20 16:22:57 -04:00
|
|
|
char *buf;
|
|
|
|
_MMCKINFO tmp_chunk;
|
|
|
|
|
|
|
|
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')) {
|
|
|
|
|
|
|
|
buf = new char[tmp_chunk.cksize];
|
|
|
|
if (!buf) {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2023-06-22 12:23:54 -04:00
|
|
|
// OFFSET: LEGO1 0x10015740
|
|
|
|
LegoInputManager *InputManager()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetInputManager();
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x10015760
|
|
|
|
LegoGameState *GameState()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetGameState();
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x10015780
|
|
|
|
LegoNavController *NavController()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetNavController();
|
|
|
|
}
|
|
|
|
|
2023-06-29 13:02:47 -04:00
|
|
|
// OFFSET: LEGO1 0x10015900
|
|
|
|
MxTransitionManager *TransitionManager()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetTransitionManager();
|
|
|
|
}
|
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
// OFFSET: LEGO1 0x10053430
|
|
|
|
const char *GetNoCD_SourceName()
|
|
|
|
{
|
|
|
|
return g_nocdSourceName;
|
|
|
|
}
|
2023-06-29 13:02:47 -04:00
|
|
|
|
2023-06-19 02:19:40 -04:00
|
|
|
// OFFSET: LEGO1 0x1005b5f0
|
2023-07-02 04:05:49 -04:00
|
|
|
MxLong LegoOmni::Notify(MxParam &p)
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
// OFFSET: LEGO1 0x1003dd70 STUB
|
2023-07-02 04:05:49 -04:00
|
|
|
LegoROI *PickROI(MxLong,MxLong)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1003ddc0 STUB
|
2023-07-02 04:05:49 -04:00
|
|
|
LegoEntity *PickEntity(MxLong,MxLong)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2023-06-19 02:19:40 -04:00
|
|
|
// OFFSET: LEGO1 0x10058bd0
|
|
|
|
void LegoOmni::Init()
|
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x10058e70
|
2023-07-02 02:53:54 -04:00
|
|
|
MxResult LegoOmni::Create(COMPAT_CONST MxOmniCreateParam &p)
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
void LegoOmni::Destroy()
|
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
void LegoOmni::vtable0x20()
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
void LegoOmni::DeleteObject(MxDSAction &ds)
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
MxBool LegoOmni::DoesEntityExist(MxDSAction &ds)
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
2023-06-27 22:04:07 -04:00
|
|
|
return TRUE;
|
2023-06-19 02:19:40 -04:00
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
void LegoOmni::vtable0x2c()
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
int LegoOmni::vtable0x30(char*, int, MxCore*)
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
2023-09-25 16:28:25 -04:00
|
|
|
return 0;
|
2023-06-19 02:19:40 -04:00
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
void LegoOmni::NotifyCurrentEntity()
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
void LegoOmni::StartTimer()
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
void LegoOmni::vtable0x3c()
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:28:25 -04:00
|
|
|
MxBool LegoOmni::vtable40()
|
2023-06-19 02:19:40 -04:00
|
|
|
{
|
|
|
|
// FIXME: Stub
|
|
|
|
return 0;
|
|
|
|
}
|
2023-10-04 02:56:16 -04:00
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100157a0
|
|
|
|
LegoWorld *GetCurrentWorld()
|
|
|
|
{
|
|
|
|
return LegoOmni::GetInstance()->GetCurrentWorld();
|
|
|
|
}
|