isle-portable/LEGO1/gifmanager.h

70 lines
1.2 KiB
C
Raw Normal View History

#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-24 19:38:27 -04:00
struct GifData {
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-24 19:38:27 -04:00
struct GifMapEntry {
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-24 19:38:27 -04:00
class GifMap {
public:
2023-10-24 19:38:27 -04:00
GifMapEntry* FindNode(const char*& string);
2023-10-24 19:38:27 -04:00
inline GifData* Get(const char* string)
{
GifData* ret = NULL;
GifMapEntry* entry = FindNode(string);
if (((m_unk4 == entry || strcmp(string, entry->m_key) > 0) ? m_unk4 : entry) != entry)
ret = entry->m_value;
return ret;
}
2023-10-24 19:38:27 -04:00
undefined4 m_unk0;
GifMapEntry* m_unk4;
};
// VTABLE 0x100d86d4
2023-10-24 19:38:27 -04:00
class GifManagerBase {
public:
2023-10-24 19:38:27 -04:00
// OFFSET: LEGO1 0x1005a310 STUB
virtual ~GifManagerBase() {} // vtable+00
2023-10-24 19:38:27 -04:00
inline GifData* Get(const char* name) { return m_unk8.Get(name); }
protected:
2023-10-24 19:38:27 -04:00
undefined4 m_unk0;
undefined4 m_unk4;
GifMap m_unk8;
};
// VTABLE 0x100d86fc
2023-10-24 19:38:27 -04:00
class GifManager : public GifManagerBase {
public:
2023-10-24 19:38:27 -04:00
// OFFSET: LEGO1 0x1005a580 STUB
virtual ~GifManager() {} // vtable+00
protected:
2023-10-24 19:38:27 -04:00
undefined m_unk[0x1c];
};
#endif // GIFMANAGER_H