This commit is contained in:
Daveo 2001-01-30 20:54:27 +00:00
parent 9d0aef7b89
commit 3153c50369
2 changed files with 33 additions and 34 deletions

View File

@ -15,7 +15,7 @@
#endif #endif
CAnimTex *AnimTexList=0; CAnimTex *AnimTexList=0;
CMoveTex *MoveTexList=0; CMoveTex CMoveTex::MoveTexList[CMoveTex::MOVETEX_MAX];
/*****************************************************************************/ /*****************************************************************************/
CAnimTex::CAnimTex() CAnimTex::CAnimTex()
@ -110,8 +110,6 @@ CAnimTex *PrevTex, *ThisTex, *NextTex;
} }
/*****************************************************************************/ /*****************************************************************************/
void CAnimTex::AnimateTex() void CAnimTex::AnimateTex()
{ {
CAnimTex *ThisTex=AnimTexList; CAnimTex *ThisTex=AnimTexList;
@ -152,26 +150,21 @@ int Time = GameState::getFramesSinceLast();
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/
CMoveTex::CMoveTex()
{
NextTex=0;
}
/*****************************************************************************/ /*****************************************************************************/
void CMoveTex::Add(sTexInfo &SrcFrame,sTexInfo &DstFrame) void CMoveTex::Add(sTexInfo &SrcFrame,sTexInfo &DstFrame)
{ {
CMoveTex *ThisTex=new ("CMoveTex::AddMoveTex") CMoveTex; int Idx;
// ASSERT(SrcFrame.w==DstFrame.w); // ASSERT(SrcFrame.w==DstFrame.w);
// ASSERT(SrcFrame.h==DstFrame.h); // ASSERT(SrcFrame.h==DstFrame.h);
ThisTex->NextTex=MoveTexList; for (Idx=0; Idx<MOVETEX_MAX && MoveTexList[Idx].Src; Idx++);
MoveTexList=ThisTex;
ThisTex->Src=&SrcFrame; ASSERT(Idx<MOVETEX_MAX);
ThisTex->Dst=&DstFrame;
CMoveTex &ThisTex=MoveTexList[Idx];
ThisTex.Src=&SrcFrame;
ThisTex.Dst=&DstFrame;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -179,15 +172,14 @@ void CMoveTex::MoveTex()
{ {
CMoveTex *ThisTex=MoveTexList,*NextTex; CMoveTex *ThisTex=MoveTexList,*NextTex;
while (ThisTex) for (int Idx=0; Idx<MOVETEX_MAX; Idx++)
{ {
MoveImage((RECT*)ThisTex->Src,ThisTex->Dst->x,ThisTex->Dst->y); CMoveTex &ThisTex=MoveTexList[Idx];
NextTex=ThisTex->NextTex; if (!ThisTex.Src) return;
delete ThisTex;
ThisTex=NextTex;
}
MoveTexList=0;
MoveImage((RECT*)ThisTex.Src,ThisTex.Dst->x,ThisTex.Dst->y);
ThisTex.Src=0;
}
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -21,13 +21,13 @@ static void GetTexData();
static void DumpThisTPage(FileEquate TexName); static void DumpThisTPage(FileEquate TexName);
private: private:
CAnimTex *NextTex; CAnimTex *NextTex;
RECT Rect; RECT Rect;
s16 Speed,Count; s16 Speed,Count;
s16 PixPerWord; s16 PixPerWord;
u32 *TexData; u32 *TexData;
FileEquate TexName; FileEquate TexName;
u8 TPage; u8 TPage;
}; };
@ -35,16 +35,23 @@ private:
class CMoveTex class CMoveTex
{ {
public: public:
CMoveTex(); enum
// ~CMoveTex(); {
MOVETEX_MAX=16,
};
CMoveTex()
{
Src=0;
}
static void Add(sTexInfo &SrcFrame,sTexInfo &DstFrame); static void Add(sTexInfo &SrcFrame,sTexInfo &DstFrame);
static void MoveTex(); static void MoveTex();
private: private:
CMoveTex *NextTex; sTexInfo *Src,*Dst;
sTexInfo *Src,*Dst;
static CMoveTex MoveTexList[];
}; };
/*****************************************************************************/ /*****************************************************************************/