mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 10:31:16 +00:00
* Use strcasecmp, strncasecmp, strlwr, strupr and itoa from SDL * Use SDL_GetTicks instead of timeGetTime * Use MxDSFile::OPEN_READ instead of OF_READ * Use SDL_IOStream to read bitmaps * Use SDL_LogXXX instead of OutputDebugString * Undo mxvideoparam.h change * Revert "Undo mxvideoparam.h change" This reverts commit4a20cf6c46. * Fix _MxTrace * Reapply "Undo mxvideoparam.h change" This reverts commitb3a09dc520. * fix _MxTrace * Use __declspec(dllexport) for exporting symbols from dll Refactored CMake script such that all objects are passed to the lego1 library. * clang-format * fix msvc build * MSVC fixed for real now? * Forgot about d3drm_guid * Fix naming issue * Use Uint64 in LegoCarBuild::Tickle for dTime
121 lines
2.9 KiB
C++
121 lines
2.9 KiB
C++
#ifndef MODELDB_H
|
|
#define MODELDB_H
|
|
|
|
#include "decomp.h"
|
|
#include "mxlist.h"
|
|
#include "mxstring.h"
|
|
#include "mxtypes.h"
|
|
|
|
#include <SDL3/SDL_iostream.h>
|
|
#include <SDL3/SDL_stdinc.h>
|
|
|
|
// SIZE 0x18
|
|
struct ModelDbPart {
|
|
MxResult Read(SDL_IOStream* p_file);
|
|
|
|
MxString m_roiName; // 0x00
|
|
undefined4 m_partDataLength; // 0x10
|
|
undefined4 m_partDataOffset; // 0x14
|
|
};
|
|
|
|
// VTABLE: LEGO1 0x100d6888
|
|
// class MxCollection<ModelDbPart *>
|
|
|
|
// VTABLE: LEGO1 0x100d68a0
|
|
// class MxList<ModelDbPart *>
|
|
|
|
// VTABLE: LEGO1 0x100d68b8
|
|
// SIZE 0x1c
|
|
class ModelDbPartList : public MxList<ModelDbPart*> {
|
|
public:
|
|
ModelDbPartList() { m_unk0x18 = 1; }
|
|
|
|
// FUNCTION: LEGO1 0x10027c40
|
|
MxS8 Compare(ModelDbPart* p_a, ModelDbPart* p_b) override
|
|
{
|
|
MxS32 compare = SDL_strcasecmp(p_a->m_roiName.GetData(), p_b->m_roiName.GetData());
|
|
|
|
if (compare == 0) {
|
|
p_b->m_partDataLength = p_a->m_partDataLength;
|
|
p_b->m_partDataOffset = p_a->m_partDataOffset;
|
|
}
|
|
|
|
return compare;
|
|
} // vtable+0x14
|
|
|
|
// SYNTHETIC: LEGO1 0x10027d70
|
|
// ModelDbPartList::`scalar deleting destructor'
|
|
|
|
private:
|
|
undefined m_unk0x18;
|
|
};
|
|
|
|
// VTABLE: LEGO1 0x100d68d0
|
|
// class MxListCursor<ModelDbPart *>
|
|
|
|
// VTABLE: LEGO1 0x100d68e8
|
|
// SIZE 0x10
|
|
class ModelDbPartListCursor : public MxListCursor<ModelDbPart*> {
|
|
public:
|
|
ModelDbPartListCursor(ModelDbPartList* p_list) : MxListCursor<ModelDbPart*>(p_list) {}
|
|
};
|
|
|
|
// TEMPLATE: LEGO1 0x10027c70
|
|
// MxCollection<ModelDbPart *>::Compare
|
|
|
|
// TEMPLATE: LEGO1 0x10027c80
|
|
// MxCollection<ModelDbPart *>::~MxCollection<ModelDbPart *>
|
|
|
|
// TEMPLATE: LEGO1 0x10027cd0
|
|
// MxCollection<ModelDbPart *>::Destroy
|
|
|
|
// TEMPLATE: LEGO1 0x10027ce0
|
|
// MxList<ModelDbPart *>::~MxList<ModelDbPart *>
|
|
|
|
// SYNTHETIC: LEGO1 0x10027de0
|
|
// MxCollection<ModelDbPart *>::`scalar deleting destructor'
|
|
|
|
// SYNTHETIC: LEGO1 0x10027e50
|
|
// MxList<ModelDbPart *>::`scalar deleting destructor'
|
|
|
|
// SYNTHETIC: LEGO1 0x10027f00
|
|
// ModelDbPartListCursor::`scalar deleting destructor'
|
|
|
|
// TEMPLATE: LEGO1 0x10027f70
|
|
// MxListCursor<ModelDbPart *>::~MxListCursor<ModelDbPart *>
|
|
|
|
// SYNTHETIC: LEGO1 0x10027fc0
|
|
// MxListCursor<ModelDbPart *>::`scalar deleting destructor'
|
|
|
|
// TEMPLATE: LEGO1 0x10028030
|
|
// ModelDbPartListCursor::~ModelDbPartListCursor
|
|
|
|
// SIZE 0x38
|
|
struct ModelDbModel {
|
|
void Free();
|
|
MxResult Read(SDL_IOStream* p_file);
|
|
|
|
char* m_modelName; // 0x00
|
|
undefined4 m_unk0x04; // 0x04
|
|
undefined4 m_unk0x08; // 0x08
|
|
char* m_presenterName; // 0x0c
|
|
float m_location[3]; // 0x10
|
|
float m_direction[3]; // 0x1c
|
|
float m_up[3]; // 0x28
|
|
undefined m_unk0x34; // 0x34
|
|
};
|
|
|
|
// SIZE 0x18
|
|
struct ModelDbWorld {
|
|
char* m_worldName; // 0x00
|
|
ModelDbPartList* m_partList; // 0x04
|
|
ModelDbModel* m_models; // 0x08
|
|
MxS32 m_numModels; // 0x0c
|
|
undefined m_unk0x10[0x08]; // 0x10
|
|
};
|
|
|
|
MxResult ReadModelDbWorlds(SDL_IOStream* p_file, ModelDbWorld*& p_worlds, MxS32& p_numWorlds);
|
|
void FreeModelDbWorlds(ModelDbWorld*& p_worlds, MxS32 p_numWorlds);
|
|
|
|
#endif // MODELDB_H
|