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;
2001-05-15 19:40:54 +02:00
int XOfs,YOfs;
2001-04-01 15:36:57 +02:00
};
//***************************************************************************
struct sAnim
{
GString Name;
vector<sFrame> Frames;
};
//***************************************************************************
struct sBmp
{
2001-04-26 23:38:18 +02:00
Frame Frm;
int OrigW,OrigH;
2001-06-25 22:41:25 +02:00
// int ChkR,ChkG,ChkB;
2001-04-01 22:22:49 +02:00
u8 *RGB;
u8 *Psx;
u8 *Pak;
int PsxSize;
int PakSize;
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();
2001-05-15 19:40:54 +02:00
void LoadBmp(sFrame &ThisFrame);
2001-06-15 21:19:45 +02:00
void CheckAndShrinkFrame(sBmp &Bmp,const char *Filename);
2001-04-01 15:36:57 +02:00
bool IsImageSame(sBmp &Bmp0,sBmp &Bmp1);
void MakePsxGfx(sBmp &Bmp);
void ProcessFrames();
2001-06-15 21:19:45 +02:00
2001-04-01 15:36:57 +02:00
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-06-18 23:26:55 +02:00
int BlankCount;
2001-04-01 15:36:57 +02:00
};
//***************************************************************************