SBSPSS/Utils/MkActor/MkActor.h

86 lines
1.9 KiB
C
Raw Normal View History

2001-04-01 15:36:57 +02:00
/*************************/
/*** Actor Sprite Tool ***/
/*************************/
#include <Vector3.h>
#include <List.h>
//***************************************************************************
struct sFrame
{
GString Filename;
int FrameIdx;
};
//***************************************************************************
struct sAnim
{
GString Name;
vector<sFrame> Frames;
bool VRamFlag;
};
//***************************************************************************
struct sBmp
{
2001-04-26 23:38:18 +02:00
Frame Frm;
int OrigW,OrigH;
2001-04-01 22:22:49 +02:00
int ChkR,ChkG,ChkB;
u8 *RGB;
u8 *Psx;
u8 *Pak;
int PsxSize;
int PakSize;
bool VRamFlag;
2001-04-26 23:38:18 +02:00
int CrossHairX,CrossHairY;
2001-04-01 15:36:57 +02:00
};
//***************************************************************************
class CMkActor
{
public:
CMkActor(GString &ActorName,GString &ActorPath,GString &SpritePath);
static void SetTPData(const char *Name,int TPBase,int TPW,int TPH);
void Load();
void Process();
void Write();
void CleanUp();
private:
void ReadScript(const char *Filename,vector<GString> &List);
void BuildFrameList();
void FindFrames(sAnim &ThisAnim);
2001-04-11 15:19:22 +02:00
int FindDup(sBmp &Frm);
2001-04-01 15:36:57 +02:00
void LoadFrameList();
void LoadFrame(sFrame &ThisFrame,bool VRamFlag);
int LoadBmp(GString &Name,bool VRamFlag);
2001-04-26 23:38:18 +02:00
void CheckAndShrinkFrame(sBmp &Bmp);
2001-04-01 15:36:57 +02:00
bool IsImageSame(sBmp &Bmp0,sBmp &Bmp1);
void MakePsxGfx(sBmp &Bmp);
void ProcessFrames();
int WritePalette();
int WriteAnimList();
int WriteFrameList();
void WriteInclude();
GString Name,ActorDir,SpriteDir;
GString OutFile,IncFile;
FILE *File;
sSpriteAnimBank FileHdr;
vector<GString> InAnimList;
vector<sAnim> AnimList;
vector<sBmp> BmpList;
CTexGrab TexGrab;
int DupCount;
2001-04-11 15:19:22 +02:00
int MaxW,MaxH;
2001-04-26 23:38:18 +02:00
int TotalIn,TotalOut;
2001-04-01 15:36:57 +02:00
};
//***************************************************************************