2023-10-23 07:16:21 -04:00
|
|
|
#ifndef GIFMANAGER_H
|
|
|
|
#define GIFMANAGER_H
|
|
|
|
|
|
|
|
#include "decomp.h"
|
|
|
|
#include "mxtypes.h"
|
|
|
|
|
|
|
|
#include <d3drmobj.h>
|
2023-10-24 19:38:27 -04:00
|
|
|
#include <ddraw.h>
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
struct GifData {
|
2023-10-23 07:16:21 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
const char* m_name;
|
|
|
|
LPDIRECTDRAWSURFACE m_surface;
|
|
|
|
LPDIRECTDRAWPALETTE m_palette;
|
|
|
|
LPDIRECT3DRMTEXTURE2 m_texture;
|
|
|
|
MxU8* m_data;
|
2023-10-23 07:16:21 -04:00
|
|
|
};
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
struct GifMapEntry {
|
2023-10-23 07:16:21 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
GifMapEntry* m_right;
|
|
|
|
GifMapEntry* m_parent;
|
|
|
|
GifMapEntry* m_left;
|
|
|
|
const char* m_key;
|
|
|
|
GifData* m_value;
|
2023-10-23 07:16:21 -04:00
|
|
|
};
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
class GifMap {
|
2023-10-23 07:16:21 -04:00
|
|
|
public:
|
2023-12-13 05:48:14 -05:00
|
|
|
GifMapEntry* FindNode(const char*& p_string);
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
inline GifData* Get(const char* p_string)
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
|
|
|
GifData* ret = NULL;
|
2023-12-13 05:48:14 -05:00
|
|
|
GifMapEntry* entry = FindNode(p_string);
|
|
|
|
if (((m_unk0x4 == entry || strcmp(p_string, entry->m_key) > 0) ? m_unk0x4 : entry) != entry)
|
2023-10-24 19:38:27 -04:00
|
|
|
ret = entry->m_value;
|
|
|
|
return ret;
|
|
|
|
}
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
undefined4 m_unk0x0;
|
|
|
|
GifMapEntry* m_unk0x4;
|
2023-10-23 07:16:21 -04:00
|
|
|
};
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d86d4
|
2023-10-24 19:38:27 -04:00
|
|
|
class GifManagerBase {
|
2023-10-23 07:16:21 -04:00
|
|
|
public:
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x1005a310
|
2023-10-24 19:38:27 -04:00
|
|
|
virtual ~GifManagerBase() {} // vtable+00
|
2023-10-23 07:16:21 -04:00
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
inline GifData* Get(const char* p_name) { return m_unk0x8.Get(p_name); }
|
2023-10-23 07:16:21 -04:00
|
|
|
|
|
|
|
protected:
|
2023-12-13 05:48:14 -05:00
|
|
|
undefined4 m_unk0x0;
|
|
|
|
undefined4 m_unk0x4;
|
|
|
|
GifMap m_unk0x8;
|
2023-10-23 07:16:21 -04:00
|
|
|
};
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d86fc
|
2023-10-24 19:38:27 -04:00
|
|
|
class GifManager : public GifManagerBase {
|
2023-10-23 07:16:21 -04:00
|
|
|
public:
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x1005a580
|
2023-10-24 19:38:27 -04:00
|
|
|
virtual ~GifManager() {} // vtable+00
|
2023-10-23 07:16:21 -04:00
|
|
|
|
|
|
|
protected:
|
2023-12-13 05:48:14 -05:00
|
|
|
undefined m_unk0x14[0x1c];
|
2023-10-23 07:16:21 -04:00
|
|
|
};
|
|
|
|
|
2023-10-25 14:51:59 -04:00
|
|
|
#endif // GIFMANAGER_H
|