Source code to the MapViewer project by RZN.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

77 lines
1.2 KiB

#pragma once
#include "stdafx.h"
#pragma pack(push,1)
typedef struct
{
char id[16];
float fTransX,fTransY,fTransZ;
float fRotX,fRotY,fRotZ;
float fScaleX,fScaleY,fScaleZ;
float fa,fb,fc,fd;
long fe,ff,fg,fh,fi,fj,fk,fl;
} OBJINFO;
typedef struct
{
float x1,x2,y1,y2,z1,z2;
} OOO;
typedef struct
{
DWORD id;
long type:7;
long next:19;
long is_shadow:1;
long is_extracted:1;
long ver_num:3;
long is_virtual:1;
} DATHEAD;
#pragma pack(pop)
typedef struct
{
char ID[17];
LPDIRECT3DTEXTURE9 pTex;
} TEXTEX;
class MapFile
{
private:
bool RenderReady;
char ffxidir[1024];
char filename[1024];
char *pdat;
DWORD dwSize;
LPSTR pData;
void decode_ObjectMap(BYTE* p);
void decode_mmb(BYTE*p);
void decode_mmb2(BYTE *p);
void GetRegistryKey();
DWORD GetFileIDFromIDsub(DWORD dwV,DWORD dwID);
BOOL GetFileNameFromFileID(LPSTR filename,DWORD dwID);
BOOL ParseFile();
LPSTR FistData(DATHEAD *phd);
LPSTR NextData(DATHEAD *phd);
public:
OBJINFO* obj;
int nobj;
int TexListCount;
TEXTEX TexList[4096];
LPSTR MMBlist[4096];
int NumMMB;
bool Ready() { return RenderReady; }
MapFile();
~MapFile();
bool LoadMap(int ZoneID);
BOOL Free(void);
};