This commit is contained in:
parent
80839a7c3b
commit
0672dce0cf
5 changed files with 71 additions and 16 deletions
|
@ -29,12 +29,15 @@ GString SpritePath;
|
|||
GString OutPath;
|
||||
GString IncludePath;
|
||||
|
||||
float Aspect=512.0f/320.0f;
|
||||
|
||||
//***************************************************************************
|
||||
char * CycleCommands(char *String,int Num)
|
||||
{
|
||||
char Text[2048],*TextPtr;
|
||||
int Count;
|
||||
|
||||
|
||||
if (String[0]=='-' || String[0]=='/')
|
||||
{
|
||||
GString TpStr;
|
||||
|
@ -64,6 +67,10 @@ int Count;
|
|||
RootPath.Upper();
|
||||
RootPath.Append('\\');
|
||||
break;
|
||||
case 'a':
|
||||
TpStr= CheckFileString(String);
|
||||
Aspect=(float)atof(TpStr);
|
||||
break;
|
||||
case 't':
|
||||
TpStr= CheckFileString(String);
|
||||
TextPtr=Text;
|
||||
|
@ -103,6 +110,7 @@ void Usage(char *ErrStr)
|
|||
printf(" -s:nn Sprite Dir\n");
|
||||
printf(" -t:p,w,h Set TPage No,Width,Height\n");
|
||||
printf(" -d: Enable Debug output\n");
|
||||
printf(" -a: Aspect Ratio\n");
|
||||
GObject::Error(ERR_FATAL,ErrStr);
|
||||
}
|
||||
|
||||
|
@ -150,6 +158,8 @@ CMkActor::CMkActor(GString &ActorName,GString &ActorPath,GString &SpritePath)
|
|||
DupCount=0;
|
||||
MaxW=0;
|
||||
MaxH=0;
|
||||
BlankCount=0;
|
||||
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
@ -294,6 +304,7 @@ void CMkActor::MakePsxGfx(sBmp &Bmp)
|
|||
{
|
||||
Bmp.Psx=0;
|
||||
Bmp.PsxSize=0;
|
||||
BlankCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -563,7 +574,7 @@ GString OutName=OutFile+".SBK";
|
|||
fclose(File);
|
||||
|
||||
WriteInclude();
|
||||
printf("%s. %i Dups, (In %i Out %i = Saved %i) (MaxWH %i %i)\n",Name,DupCount,TotalIn,TotalOut,TotalIn-TotalOut,FileHdr.MaxW,FileHdr.MaxH);
|
||||
printf("%s. D=%i B=%i - WH=%i %i - In=%i Out=%i Sv=%i \n",Name,DupCount,BlankCount,FileHdr.MaxW,FileHdr.MaxH,TotalIn,TotalOut,TotalIn-TotalOut);
|
||||
|
||||
}
|
||||
|
||||
|
@ -666,12 +677,28 @@ vector<sSpriteFrameGfx> Hdrs;
|
|||
{
|
||||
sBmp &ThisBmp=BmpList[i];
|
||||
|
||||
Hdrs[i].PAKSpr=(u8*)ftell(File);
|
||||
// Hdrs[i].XOfs=ThisBmp.CrossHairX;
|
||||
// Hdrs[i].YOfs=ThisBmp.CrossHairY;
|
||||
Hdrs[i].W=ThisBmp.Frm.GetWidth();
|
||||
Hdrs[i].H=ThisBmp.Frm.GetHeight();
|
||||
fwrite(ThisBmp.Pak,1,ThisBmp.PakSize,File);
|
||||
if (ThisBmp.Pak)
|
||||
{
|
||||
Hdrs[i].PAKSpr=(u8*)ftell(File);
|
||||
Hdrs[i].W=ThisBmp.Frm.GetWidth();
|
||||
Hdrs[i].H=ThisBmp.Frm.GetHeight();
|
||||
// aspect
|
||||
float aW=Hdrs[i].W*Aspect;
|
||||
int dW=(int)aW-Hdrs[i].W;
|
||||
int X0=dW/2;
|
||||
int X1=dW-X0;
|
||||
|
||||
Hdrs[i].AspectX0=X0;
|
||||
Hdrs[i].AspectX1=X1;
|
||||
// printf("%i %i %i\n",Hdrs[i].W,X0,X1);
|
||||
fwrite(ThisBmp.Pak,1,ThisBmp.PakSize,File);
|
||||
}
|
||||
else
|
||||
{
|
||||
Hdrs[i].PAKSpr=0;
|
||||
Hdrs[i].W=0;
|
||||
Hdrs[i].H=0;
|
||||
}
|
||||
}
|
||||
// ReWrite Headers
|
||||
int SavePos=ftell(File);
|
||||
|
|
|
@ -79,6 +79,7 @@ private:
|
|||
int DupCount;
|
||||
int MaxW,MaxH;
|
||||
int TotalIn,TotalOut;
|
||||
int BlankCount;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
|
|
|
@ -88,7 +88,7 @@ CFXBaseAnim::sFXAnim FXExplodeData=
|
|||
CFXBaseAnim::sFXAnim FXFireData=
|
||||
{
|
||||
ONE,
|
||||
FRM__FIRE01,FRM__FIRE06,
|
||||
FRM__FIRE01,FRM__FIRE08,
|
||||
1,
|
||||
127,127,127,
|
||||
CFXBaseAnim::FXANIM_FLAG_LOOP | CFXBaseAnim::FXANIM_FLAG_TRANS,
|
||||
|
@ -140,7 +140,7 @@ CFXBaseAnim::sFXAnim FXOilDripData=
|
|||
// Bubble
|
||||
CFXBaseAnim::sFXAnim FXBubbleWaterData=
|
||||
{
|
||||
ONE/2,
|
||||
ONE,
|
||||
FRM__BUBBLE_2,FRM__BUBBLE_2,
|
||||
1,
|
||||
127,127,255,
|
||||
|
@ -151,7 +151,7 @@ CFXBaseAnim::sFXAnim FXBubbleWaterData=
|
|||
|
||||
CFXBaseAnim::sFXAnim FXBubbleAcidData=
|
||||
{
|
||||
ONE/2,
|
||||
ONE,
|
||||
FRM__BUBBLE_2,FRM__BUBBLE_2,
|
||||
1,
|
||||
0,255,0,
|
||||
|
@ -161,7 +161,7 @@ CFXBaseAnim::sFXAnim FXBubbleAcidData=
|
|||
};
|
||||
CFXBaseAnim::sFXAnim FXBubbleLavaData=
|
||||
{
|
||||
ONE/2,
|
||||
ONE,
|
||||
FRM__BUBBLE_2,FRM__BUBBLE_2,
|
||||
1,
|
||||
255,0,0,
|
||||
|
@ -171,7 +171,7 @@ CFXBaseAnim::sFXAnim FXBubbleLavaData=
|
|||
};
|
||||
CFXBaseAnim::sFXAnim FXBubbleOilData=
|
||||
{
|
||||
ONE/2,
|
||||
ONE,
|
||||
FRM__BUBBLE_2,FRM__BUBBLE_2,
|
||||
1,
|
||||
32,32,32,
|
||||
|
@ -183,7 +183,7 @@ CFXBaseAnim::sFXAnim FXBubbleOilData=
|
|||
CFXBaseAnim::sFXAnim FXWaterFountainData=
|
||||
{
|
||||
ONE,
|
||||
FRM__GUSH000,FRM__GUSH002,
|
||||
FRM__GUSH000,FRM__GUSH003,
|
||||
3,
|
||||
127,127,255,
|
||||
CFXBaseAnim::FXANIM_FLAG_LOOP,
|
||||
|
|
Binary file not shown.
|
@ -246,9 +246,9 @@ struct sLevelHdr
|
|||
// Actors
|
||||
struct sSpriteFrameGfx
|
||||
{
|
||||
u8 *PAKSpr; // 4 Needs to be u32, so might as well make it a ptr
|
||||
u16 Pad; // 2 :o(
|
||||
u8 W,H; // 2
|
||||
u8 *PAKSpr; // 4 Needs to be u32, so might as well make it a ptr
|
||||
s8 AspectX0,AspectX1; // 2 Aspect correction value
|
||||
u8 W,H; // 2
|
||||
};
|
||||
|
||||
struct sSpriteFrame
|
||||
|
@ -366,4 +366,31 @@ struct sThingHazard
|
|||
}; // 12
|
||||
|
||||
//***************************************************************************
|
||||
//*** FX Stuff **************************************************************
|
||||
//***************************************************************************
|
||||
#if 0
|
||||
enum FX_FLAG
|
||||
{
|
||||
FX_FLAG_LOOP =1<<0,
|
||||
FX_FLAG_COLLIDE_KILL =1<<1,
|
||||
FX_FLAG_HAS_GRAVITY =1<<2,
|
||||
FX_FLAG_INJURE_PLAYER =1<<3,
|
||||
FX_FLAG_TRANS =1<<4,
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
struct sFXData
|
||||
{
|
||||
s16 Scale;
|
||||
// s16 StartFrame,EndFrame;
|
||||
// s8 FrameShift;
|
||||
// u8 R,G,B;
|
||||
u16 Flags;
|
||||
// DVECTOR Velocity;
|
||||
u16 Velocity,Heading;
|
||||
// u16 EndFX;
|
||||
};
|
||||
#endif
|
||||
//***************************************************************************
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue