bodyparts separated
[k8-i-v-a-n.git] / src / game / bodyparts / normaltorso_dogtorso.cpp
blobbe4ba597a91fb86d2a635b8beec35150cac3effc
1 #ifdef HEADER_PHASE
2 ITEM(dogtorso, normaltorso)
4 protected:
5 virtual void Draw(blitdata&) const;
6 virtual int GetClassAnimationFrames() const { return 16; }
7 virtual v2 GetBitmapPos(int) const;
8 };
11 #else
15 v2 dogtorso::GetBitmapPos(int Frame) const
17 v2 BasePos = torso::GetBitmapPos(Frame);
19 if(Frame >= GraphicData.AnimationFrames >> 1)
20 BasePos.X += 32;
22 return v2(BasePos.X + ((Frame & 4) << 2), BasePos.Y);
27 void dogtorso::Draw(blitdata& BlitData) const
29 cint AF = GraphicData.AnimationFrames >> 1;
30 int Index = !(BlitData.CustomData & ALLOW_ANIMATE) || AF == 1 ? 0 : GET_TICK() & (AF - 1);
32 if(GetHP() << 1 <= GetMaxHP())
33 Index += AF;
35 cbitmap* P = GraphicData.Picture[Index];
37 if(BlitData.CustomData & ALLOW_ALPHA)
38 P->AlphaPriorityBlit(BlitData);
39 else
40 P->MaskedPriorityBlit(BlitData);
42 #endif