bodyparts separated
[k8-i-v-a-n.git] / src / game / bodyparts / normaltorso_largetorso.cpp
blobd3c7eaae2efe8d0f1ffdfa2af5334ef0faca7e4c
1 #ifdef HEADER_PHASE
2 ITEM(largetorso, normaltorso)
4 public:
5 virtual void SignalStackAdd(stackslot*, void (stack::*)(item*, truth));
6 virtual int GetSquareIndex(v2) const;
7 virtual void Draw(blitdata&) const;
8 virtual void CalculateSquaresUnder() { SquaresUnder = 4; }
9 protected:
10 virtual v2 GetBitmapPos(int I) const { return GetLargeBitmapPos(BitmapPos, I); }
11 virtual void ModifyAnimationFrames(int& AF) const { AF <<= 2; }
15 #else
19 void largetorso::Draw(blitdata& BlitData) const
21 LargeDraw(BlitData);
26 void largetorso::SignalStackAdd(stackslot* StackSlot, void (stack::*AddHandler)(item*, truth))
28 if(!Slot[0])
30 Slot[0] = StackSlot;
31 v2 Pos = GetPos();
32 level* Level = GetLevel();
34 for(int c = 1; c < 4; ++c)
35 (Level->GetLSquare(Pos + game::GetLargeMoveVector(12 + c))->GetStack()->*AddHandler)(this, false);
37 else
38 for(int c = 1; c < 4; ++c)
39 if(!Slot[c])
41 Slot[c] = StackSlot;
42 return;
48 int largetorso::GetSquareIndex(v2 Pos) const
50 v2 RelativePos = Pos - GetPos();
51 return RelativePos.X + (RelativePos.Y << 1);
53 #endif