hedgewars/GearDrawing.inc
author nemo
Mon, 06 Sep 2010 16:23:47 -0400
changeset 3836 833c0f32e326
parent 3751 a70c61c076ae
child 3854 d390b0f29b0b
permissions -rw-r--r--
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon. NEEDS TESTING. Also disable cheese in pro, remove some unused vars.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
     1
procedure DrawHH(Gear: PGear);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
     2
var i, t: LongInt;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
     3
    amt: TAmmoType;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
     4
    hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
3483
54ff8cbabaa6 Engine:
smxx
parents: 3482
diff changeset
     5
    dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
     6
    defaultPos, HatVisible: boolean;
3393
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
     7
    VertexBuffer: array [0..1] of TVertex2f;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
     8
    HH: PHedgehog;
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
     9
    CurWeapon: PAmmo;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    10
begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    11
HH:= PHedgehog(Gear^.Hedgehog);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    12
if HH^.Unplaced then exit;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    13
m:= 1;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    14
if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    15
if (Gear^.State and gstHHDeath) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    16
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    17
    DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    18
    exit
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    19
    end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    20
else if (Gear^.State and gstHHGone) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    21
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    22
    DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, Gear^.Pos, hwSign(Gear^.dX), 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    23
    exit
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    24
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    25
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    26
defaultPos:= true;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    27
HatVisible:= false;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    28
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    29
sx:= hwRound(Gear^.X) + 1 + WorldDx;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    30
sy:= hwRound(Gear^.Y) - 3 + WorldDy;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    31
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    32
if HH^.Effects[hePoisoned] then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    33
    begin
3392
9d5d01b52ae8 Engine:
smxx
parents: 3390
diff changeset
    34
    Tint($00, $FF, $40, $40);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    35
    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
    36
    Tint($FF, $FF, $FF, $FF)
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    37
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    38
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    39
if ((Gear^.State and gstWinner) <> 0) and
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    40
   ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    41
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    42
    DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    43
            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    44
            2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    45
            0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    46
            0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    47
    defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    48
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    49
if (Gear^.State and gstDrowning) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    50
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    51
    DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    52
            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    53
            1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    54
            7,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    55
            0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    56
    defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    57
    end else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    58
if (Gear^.State and gstLoser) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    59
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    60
    DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    61
            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    62
            2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    63
            3,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    64
            0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    65
    defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    66
    end else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    67
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    68
if (Gear^.State and gstHHDriven) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    69
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    70
    if ((Gear^.State and gstHHThinking) = 0) and
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    71
       (ShowCrosshair  or ((CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtRope))) and
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    72
       ((Gear^.State and (gstAttacked or gstAnimation)) = 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    73
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    74
(* These calculations are a little complex for a few reasons:
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    75
   1: I need to draw the laser from weapon origin to nearest land
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    76
   2: I need to start the beam outside the hedgie for attractiveness.
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    77
   3: I need to extend the beam beyond land.
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    78
   This routine perhaps should be pushed into uStore or somesuch instead of continuuing the increase in size of this function.
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    79
*)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    80
        dx:= hwSign(Gear^.dX) * m * Sin(Gear^.Angle * pi / cMaxAngle);
3483
54ff8cbabaa6 Engine:
smxx
parents: 3482
diff changeset
    81
        dy:= -Cos(Gear^.Angle * pi / cMaxAngle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    82
        if cLaserSighting then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    83
            begin
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
    84
            lx:= GetLaunchX(HH^.CurAmmoType, hwSign(Gear^.dX) * m, Gear^.Angle);
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
    85
            ly:= GetLaunchY(HH^.CurAmmoType, Gear^.Angle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    86
3496
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    87
            // ensure we start outside the hedgehog (he's solid after all)
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    88
            while abs(lx * lx + ly * ly) < (Gear^.radius * Gear^.radius) do
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    89
                begin
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    90
                lx:= lx + dx;
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    91
                ly:= ly + dy
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    92
                end;
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    93
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    94
            // add hog's position
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    95
            lx:= lx + hwRound(Gear^.X);
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    96
            ly:= ly + hwRound(Gear^.Y);
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    97
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
    98
            // decrease number of iterations required
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
    99
            ax:= dx * 4;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   100
            ay:= dy * 4;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   101
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   102
            tx:= round(lx);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   103
            ty:= round(ly);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   104
            hx:= tx;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   105
            hy:= ty;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   106
            while ((ty and LAND_HEIGHT_MASK) = 0) and
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   107
                ((tx and LAND_WIDTH_MASK) = 0) and
3496
8fb007d36c09 Engine:
smxx
parents: 3485
diff changeset
   108
                (Land[ty, tx] = 0) do // TODO: check for constant variable instead
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   109
                begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   110
                lx:= lx + ax;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   111
                ly:= ly + ay;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   112
                tx:= round(lx);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   113
                ty:= round(ly)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   114
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   115
            // reached edge of land. assume infinite beam. Extend it way out past camera
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   116
            if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   117
                begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   118
                tx:= round(lx + ax * (LAND_WIDTH div 4));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   119
                ty:= round(ly + ay * (LAND_WIDTH div 4));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   120
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   121
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   122
            //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   123
                begin
3393
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   124
                glDisable(GL_TEXTURE_2D);
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   125
                glEnable(GL_LINE_SMOOTH);
3393
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   126
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   127
                glLineWidth(1.0);
3393
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   128
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   129
                Tint($FF, $00, $00, $C0);
3393
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   130
                VertexBuffer[0].X:= hx + WorldDx;
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   131
                VertexBuffer[0].Y:= hy + WorldDy;
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   132
                VertexBuffer[1].X:= tx + WorldDx;
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   133
                VertexBuffer[1].Y:= ty + WorldDy;
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   134
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   135
                glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]);
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   136
                glDrawArrays(GL_LINES, 0, Length(VertexBuffer));
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   137
                Tint($FF, $FF, $FF, $FF);
3393
595655a09b26 Engine:
smxx
parents: 3392
diff changeset
   138
                glEnable(GL_TEXTURE_2D);
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   139
                glDisable(GL_LINE_SMOOTH);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   140
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   141
            end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   142
        // draw crosshair
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
   143
        cx:= Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, hwSign(Gear^.dX) * m, Gear^.Angle));
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
   144
        cy:= Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   145
        DrawRotatedTex(HH^.Team^.CrosshairTex,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   146
                12, 12, cx + WorldDx, cy + WorldDy, 0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   147
                hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   148
        end;
3483
54ff8cbabaa6 Engine:
smxx
parents: 3482
diff changeset
   149
    hx:= hwRound(Gear^.X) + 8 * hwSign(Gear^.dX) + WorldDx;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   150
    hy:= hwRound(Gear^.Y) - 2 + WorldDy;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   151
    aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   152
    if CurAmmoGear <> nil then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   153
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   154
        case CurAmmoGear^.Kind of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   155
            gtShotgunShot: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   156
                    if (CurAmmoGear^.State and gstAnimation <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   157
                        DrawRotated(sprShotgun, hx, hy, hwSign(Gear^.dX), aangle)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   158
                    else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   159
                        DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   160
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   161
            gtDEagleShot: DrawRotated(sprDEagle, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   162
            gtSniperRifleShot: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   163
                    if (CurAmmoGear^.State and gstAnimation <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   164
                        DrawRotatedF(sprSniperRifle, hx, hy, 1, hwSign(Gear^.dX), aangle)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   165
                    else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   166
                        DrawRotatedF(sprSniperRifle, hx, hy, 0, hwSign(Gear^.dX), aangle)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   167
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   168
            gtBallgun: DrawRotated(sprHandBallgun, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   169
            gtRCPlane: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   170
                DrawRotated(sprHandPlane, hx, hy, hwSign(Gear^.dX), 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   171
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   172
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   173
            gtRope: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   174
                if Gear^.X < CurAmmoGear^.X then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   175
                    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   176
                    dAngle:= 0;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   177
                    hAngle:= 180;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   178
                    i:= 1
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   179
                    end else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   180
                    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   181
                    dAngle:= 180;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   182
                    hAngle:= 0;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   183
                    i:= -1
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   184
                    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   185
                sx:= hwRound(Gear^.X) + WorldDx;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   186
                sy:= hwRound(Gear^.Y) + WorldDy;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   187
               if ((Gear^.State and gstWinner) = 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   188
                   begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   189
                   DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   190
                           i,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   191
                           1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   192
                           0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   193
                           DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   194
                   with HH^ do
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   195
                       if (HatTex <> nil) then
3445
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   196
                           begin
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   197
                           DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, sx, sy, 0, i, 32, 32,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   198
                               i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
3445
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   199
                           if HatTex^.w > 32 then
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   200
                               begin
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   201
                               Tint(HH^.Team^.Clan^.Color);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   202
                               DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, sx, sy, 32, i, 32, 32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   203
                                   i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   204
                               Tint($FF, $FF, $FF, $FF)
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   205
                               end
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   206
                           end
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   207
                   end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   208
                DrawAltWeapon(Gear, sx, sy);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   209
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   210
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   211
            gtBlowTorch: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   212
                DrawRotated(sprBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   213
                DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   214
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   215
                        3,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   216
                        HH^.visStepPos div 2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   217
                        0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   218
                with HH^ do
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   219
                    if (HatTex <> nil) then
3445
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   220
                        begin
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   221
                        DrawTextureF(HatTex,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   222
                            1,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   223
                            sx,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   224
                            hwRound(Gear^.Y) - 8 + WorldDy,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   225
                            0,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   226
                            hwSign(Gear^.dX),
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   227
                            32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   228
                            32);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   229
                        if HatTex^.w > 32 then
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   230
                            begin
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   231
                            Tint(HH^.Team^.Clan^.Color);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   232
                            DrawTextureF(HatTex,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   233
                                1,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   234
                                sx,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   235
                                hwRound(Gear^.Y) - 8 + WorldDy,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   236
                                32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   237
                                hwSign(Gear^.dX),
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   238
                                32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   239
                                32);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   240
                            Tint($FF, $FF, $FF, $FF)
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   241
                            end
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   242
                        end;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   243
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   244
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   245
            gtShover: DrawRotated(sprHandBaseball, hx, hy, hwSign(Gear^.dX), aangle + 180);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   246
            gtFirePunch: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   247
                DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   248
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   249
                        1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   250
                        4,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   251
                        0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   252
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   253
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   254
            gtPickHammer: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   255
                defaultPos:= false;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   256
                dec(sy,20);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   257
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   258
            gtTeleport: defaultPos:= false;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   259
            gtWhip: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   260
                DrawRotatedF(sprWhip,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   261
                        sx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   262
                        sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   263
                        1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   264
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   265
                        0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   266
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   267
                end;
3717
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   268
            gtHammer: begin
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   269
                DrawRotatedF(sprHammer,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   270
                        sx,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   271
                        sy,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   272
                        1,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   273
                        hwSign(Gear^.dX),
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   274
                        0);
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   275
                defaultPos:= false
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   276
                end;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   277
            gtKamikaze: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   278
                if CurAmmoGear^.Pos = 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   279
                    DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   280
                            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   281
                            1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   282
                            6,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   283
                            0)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   284
                else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   285
                    DrawRotatedF(sprKamikaze,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   286
                            hwRound(Gear^.X) + WorldDx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   287
                            hwRound(Gear^.Y) + WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   288
                            CurAmmoGear^.Pos - 1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   289
                            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   290
                            aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   291
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   292
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   293
            gtSeduction: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   294
                if CurAmmoGear^.Pos >= 6 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   295
                    DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   296
                            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   297
                            2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   298
                            2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   299
                            0)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   300
                else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   301
                    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   302
                    DrawRotatedF(sprDress,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   303
                            hwRound(Gear^.X) + WorldDx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   304
                            hwRound(Gear^.Y) + WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   305
                            CurAmmoGear^.Pos,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   306
                            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   307
                            0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   308
                    DrawSprite(sprCensored, hwRound(Gear^.X) - 32 + WorldDx, hwRound(Gear^.Y) - 20 + WorldDy, 0)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   309
                    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   310
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   311
                end;
3485
ab91c56a9050 Engine (Henek):
smxx
parents: 3483
diff changeset
   312
            gtFlamethrower: begin
ab91c56a9050 Engine (Henek):
smxx
parents: 3483
diff changeset
   313
                DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, hwSign(Gear^.dX), aangle);
ab91c56a9050 Engine (Henek):
smxx
parents: 3483
diff changeset
   314
                if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex)
ab91c56a9050 Engine (Henek):
smxx
parents: 3483
diff changeset
   315
                end;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   316
        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   317
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   318
        case CurAmmoGear^.Kind of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   319
            gtShotgunShot,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   320
            gtDEagleShot,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   321
            gtSniperRifleShot,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   322
            gtShover: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   323
                DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   324
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   325
                        0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   326
                        4,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   327
                        0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   328
                defaultPos:= false;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   329
                HatVisible:= true
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   330
            end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   331
        end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   332
    end else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   333
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   334
    if ((Gear^.State and gstHHJumping) <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   335
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   336
    DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   337
        hwSign(Gear^.dX)*m,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   338
        1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   339
        1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   340
        0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   341
    HatVisible:= true;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   342
    defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   343
    end else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   344
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   345
    if (Gear^.Message and (gm_Left or gm_Right) <> 0) and (not isCursorVisible) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   346
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   347
        DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   348
            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   349
            0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   350
            HH^.visStepPos div 2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   351
            0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   352
        defaultPos:= false;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   353
        HatVisible:= true
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   354
        end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   355
    else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   356
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   357
    if ((Gear^.State and gstAnimation) <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   358
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   359
        if (TWave(Gear^.Tag) < Low(TWave)) or (TWave(Gear^.Tag) > High(TWave)) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   360
            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   361
            Gear^.State:= Gear^.State and not gstAnimation;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   362
            end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   363
        else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   364
            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   365
            DrawRotatedF(Wavez[TWave(Gear^.Tag)].Sprite,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   366
                    sx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   367
                    sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   368
                    Gear^.Pos,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   369
                    hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   370
                    0.0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   371
            defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   372
            end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   373
        end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   374
    else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   375
    if ((Gear^.State and gstAttacked) = 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   376
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   377
        if HH^.Timer > 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   378
            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   379
            // There must be a tidier way to do this. Anyone?
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   380
            if aangle <= 90 then aangle:= aangle+360;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   381
            if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*HH^.Timer/10)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   382
            else aangle:= aangle+((240-aangle)*HH^.Timer/10);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   383
            dec(HH^.Timer)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   384
            end;
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
   385
        amt:= CurrentHedgehog^.CurAmmoType;
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
   386
        CurWeapon:= GetAmmoEntry(HH^);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   387
        case amt of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   388
            amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   389
            amMortar: DrawRotated(sprHandMortar, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   390
            amMolotov: DrawRotated(sprHandMolotov, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   391
            amBallgun: DrawRotated(sprHandBallgun, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   392
            amDrill: DrawRotated(sprHandDrill, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   393
            amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   394
            amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   395
            amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   396
            amSineGun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
   397
            amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer?
3396
e5b3e5f2818e More portal changes. Allows for a multishoot utility. Hopefully not breaking anything.
nemo
parents: 3393
diff changeset
   398
                            DrawRotatedF(sprPortalGun, hx, hy, 0, hwSign(Gear^.dX), aangle)
e5b3e5f2818e More portal changes. Allows for a multishoot utility. Hopefully not breaking anything.
nemo
parents: 3393
diff changeset
   399
                      else
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
   400
                            DrawRotatedF(sprPortalGun, hx, hy, 1+(CurWeapon^.Timer and 1), hwSign(Gear^.dX), aangle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   401
            amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   402
            amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   403
            amCake: DrawRotated(sprHandCake, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   404
            amGrenade: DrawRotated(sprHandGrenade, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   405
            amWatermelon: DrawRotated(sprHandMelon, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   406
            amSkip: DrawRotated(sprHandSkip, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   407
            amClusterBomb: DrawRotated(sprHandCluster, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   408
            amDynamite: DrawRotated(sprHandDynamite, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   409
            amHellishBomb: DrawRotated(sprHandHellish, hx, hy, hwSign(Gear^.dX), aangle);
3475
95345f98da19 Engine:
smxx
parents: 3461
diff changeset
   410
            amGasBomb: DrawRotated(sprHandCheese, hx, hy, hwSign(Gear^.dX), aangle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   411
            amMine: DrawRotated(sprHandMine, hx, hy, hwSign(Gear^.dX), aangle);
3710
411f5c2b5292 Engine:
smaxx
parents: 3641
diff changeset
   412
            amSMine: DrawRotated(sprHandSMine, hx, hy, hwSign(Gear^.dX), aangle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   413
            amSeduction: DrawRotated(sprHandSeduction, hx, hy, hwSign(Gear^.dX), aangle);
3482
106d1f983b48 Engine:
smxx
parents: 3481
diff changeset
   414
            amVampiric: DrawRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, hwSign(Gear^.dX), aangle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   415
            amRCPlane: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   416
                DrawRotated(sprHandPlane, hx, hy, hwSign(Gear^.dX), 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   417
                defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   418
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   419
            amGirder: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   420
                DrawRotated(sprHandConstruction, hx, hy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   421
                DrawSpriteClipped(sprGirder,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   422
                                  sx-256,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   423
                                  sy-256,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   424
                                  LongInt(topY)+WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   425
                                  LongInt(rightX)+WorldDx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   426
                                  cWaterLine+WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   427
                                  LongInt(leftX)+WorldDx)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   428
                end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   429
            amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, hwSign(Gear^.dX), aangle);
3481
c385a7dad025 Engine:
smxx
parents: 3476
diff changeset
   430
            amFlamethrower: DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, hwSign(Gear^.dX), aangle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   431
        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   432
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   433
        case amt of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   434
            amAirAttack,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   435
            amMineStrike: DrawRotated(sprHandAirAttack, sx, hwRound(Gear^.Y) + WorldDy, hwSign(Gear^.dX), 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   436
            amPickHammer: DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   437
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   438
                        1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   439
                        2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   440
                        0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   441
            amTeleport: DrawRotatedF(sprTeleport, sx, sy, 0, hwSign(Gear^.dX), 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   442
            amKamikaze: DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   443
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   444
                        1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   445
                        5,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   446
                        0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   447
            amWhip: DrawRotatedF(sprWhip,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   448
                        sx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   449
                        sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   450
                        0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   451
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   452
                        0);
3717
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   453
            amHammer: DrawRotatedF(sprHammer,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   454
                        sx,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   455
                        sy,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   456
                        0,
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   457
                        hwSign(Gear^.dX),
d88719b0f0dc Engine:
smaxx
parents: 3713
diff changeset
   458
                        0);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   459
        else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   460
            DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   461
                hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   462
                0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   463
                4,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   464
                0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   465
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   466
            HatVisible:= true;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   467
            (* with HH^ do
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   468
                if (HatTex <> nil)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   469
                and (HatVisibility > 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   470
                    DrawTextureF(HatTex,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   471
                        HatVisibility,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   472
                        sx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   473
                        hwRound(Gear^.Y) - 8 + WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   474
                        0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   475
                        hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   476
                        32,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   477
                        32); *)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   478
        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   479
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   480
        case amt of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   481
            amBaseballBat: DrawRotated(sprHandBaseball,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   482
                    hwRound(Gear^.X) + 1 - 4 * hwSign(Gear^.dX) + WorldDx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   483
                    hwRound(Gear^.Y) + 6 + WorldDy, hwSign(Gear^.dX), aangle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   484
        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   485
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   486
        defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   487
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   488
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   489
end else // not gstHHDriven
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   490
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   491
    if (Gear^.Damage > 0)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   492
    and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   493
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   494
        DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   495
            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   496
            2,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   497
            1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   498
            Gear^.DirAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   499
        defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   500
        end else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   501
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   502
    if ((Gear^.State and gstHHJumping) <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   503
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   504
        DrawHedgehog(sx, sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   505
            hwSign(Gear^.dX)*m,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   506
            1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   507
            1,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   508
            0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   509
        defaultPos:= false
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   510
        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   511
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   512
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   513
with HH^ do
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   514
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   515
    if defaultPos then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   516
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   517
        DrawRotatedF(sprHHIdle,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   518
            sx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   519
            sy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   520
            (RealTicks div 128 + Gear^.Pos) mod 19,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   521
            hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   522
            0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   523
        HatVisible:= true;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   524
        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   525
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   526
    if HatVisible then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   527
        if HatVisibility < 1.0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   528
            HatVisibility:= HatVisibility + 0.2
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   529
        else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   530
    else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   531
        if HatVisibility > 0.0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   532
            HatVisibility:= HatVisibility - 0.2;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   533
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   534
    if (HatTex <> nil)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   535
    and (HatVisibility > 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   536
        if DefaultPos then
3445
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   537
            begin
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   538
            DrawTextureF(HatTex,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   539
                HatVisibility,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   540
                sx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   541
                hwRound(Gear^.Y) - 8 + WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   542
                (RealTicks div 128 + Gear^.Pos) mod 19,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   543
                hwSign(Gear^.dX),
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   544
                32,
3445
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   545
                32);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   546
            if HatTex^.w > 32 then
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   547
                begin
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   548
                Tint(HH^.Team^.Clan^.Color);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   549
                DrawTextureF(HatTex,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   550
                    HatVisibility,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   551
                    sx,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   552
                    hwRound(Gear^.Y) - 8 + WorldDy,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   553
                    (RealTicks div 128 + Gear^.Pos) mod 19 + 32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   554
                    hwSign(Gear^.dX),
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   555
                    32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   556
                    32);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   557
                Tint($FF, $FF, $FF, $FF)
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   558
                end
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   559
            end
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   560
        else
3445
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   561
            begin
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   562
            DrawTextureF(HatTex,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   563
                HatVisibility,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   564
                sx,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   565
                hwRound(Gear^.Y) - 8 + WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   566
                0,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   567
                hwSign(Gear^.dX)*m,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   568
                32,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   569
                32);
3445
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   570
            if HatTex^.w > 32 then
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   571
                begin
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   572
                Tint(HH^.Team^.Clan^.Color);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   573
                DrawTextureF(HatTex,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   574
                    HatVisibility,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   575
                    sx,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   576
                    hwRound(Gear^.Y) - 8 + WorldDy,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   577
                    32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   578
                    hwSign(Gear^.dX)*m,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   579
                    32,
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   580
                    32);
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   581
                Tint($FF, $FF, $FF, $FF)
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   582
                end
1ce844170014 Engine:
smxx
parents: 3440
diff changeset
   583
            end
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   584
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   585
if (Gear^.State and gstHHDriven) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   586
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   587
(*    if (CurAmmoGear = nil) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   588
        begin
3836
833c0f32e326 Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents: 3751
diff changeset
   589
        amt:= CurrentHedgehog^.CurAmmoType;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   590
        case amt of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   591
            amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   592
            end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   593
        end; *)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   594
    if CurAmmoGear <> nil then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   595
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   596
        case CurAmmoGear^.Kind of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   597
            gtJetpack: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   598
                       DrawSprite(sprJetpack, sx-32, sy-32, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   599
                       if (CurAmmoGear^.MsgParam and gm_Up) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 1);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   600
                       if (CurAmmoGear^.MsgParam and gm_Left) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 2);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   601
                       if (CurAmmoGear^.MsgParam and gm_Right) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 3);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   602
                       if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   603
                       DrawAltWeapon(Gear, sx, sy)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   604
                       end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   605
            end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   606
        end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   607
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   608
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   609
with HH^ do
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   610
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   611
    if ((Gear^.State and not gstWinner) = 0)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   612
        or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   613
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   614
        t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   615
        if (cTagsMask and htTransparent) <> 0 then
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   616
            Tint($FF, $FF, $FF, $80);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   617
        if ((cTagsMask and htHealth) <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   618
            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   619
            dec(t, HealthTagTex^.h + 2);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   620
            DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTagTex)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   621
            end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   622
        if (cTagsMask and htName) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   623
            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   624
            dec(t, NameTagTex^.h + 2);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   625
            DrawCentered(hwRound(Gear^.X) + WorldDx, t, NameTagTex)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   626
            end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   627
        if (cTagsMask and htTeamName) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   628
            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   629
            dec(t, Team^.NameTagTex^.h + 2);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   630
            DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTagTex)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   631
            end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   632
        if (cTagsMask and htTransparent) <> 0 then
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   633
            Tint($FF, $FF, $FF, $FF)
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   634
        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   635
    if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   636
        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   637
        if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   638
            DrawSprite(sprFinger, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 64 + WorldDy,
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   639
                        GameTicks div 32 mod 16);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   640
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   641
        if (Gear^.State and gstDrowning) = 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   642
            if (Gear^.State and gstHHThinking) <> 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   643
                DrawSprite(sprQuestion, hwRound(Gear^.X) - 10 + WorldDx, hwRound(Gear^.Y) - cHHRadius - 34 + WorldDy, (RealTicks shr 9) mod 8)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   644
        end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   645
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   646
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   647
if HH^.Effects[hePoisoned] then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   648
    begin
3392
9d5d01b52ae8 Engine:
smxx
parents: 3390
diff changeset
   649
    Tint($00, $FF, $40, $80);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   650
    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   651
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   652
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   653
if Gear^.Invulnerable then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   654
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   655
    Tint($FF, $FF, $FF, max($40, floor($FF * abs(1 - ((RealTicks div 2 + Gear^.uid * 491) mod 1500) / 750))));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   656
    DrawSprite(sprInvulnerable, sx - 24, sy - 24, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   657
    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   658
if cVampiric and
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   659
   (CurrentHedgehog^.Gear <> nil) and
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   660
   (CurrentHedgehog^.Gear = Gear) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   661
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   662
    Tint($FF, $FF, $FF, max($40, floor($FF * abs(1 - (RealTicks mod 1500) / 750))));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   663
    DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   664
    end;
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   665
    Tint($FF, $FF, $FF, $FF)
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   666
end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   667
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   668
procedure DrawGears;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   669
var Gear, HHGear: PGear;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   670
    i: Longword;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   671
    startX, endX, startY, endY: LongInt;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   672
begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   673
Gear:= GearsList;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   674
while Gear<>nil do
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   675
    begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   676
    case Gear^.Kind of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   677
       gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
3475
95345f98da19 Engine:
smxx
parents: 3461
diff changeset
   678
       gtGasBomb: DrawRotated(sprCheese, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
3476
1ec68b8d3bd1 Henek adds a flamethrower, updates some translations, and tweaks how fire works.
nemo
parents: 3475
diff changeset
   679
       gtMolotov: DrawRotated(sprMolotov, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   680
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   681
       gtRCPlane: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   682
                  if (Gear^.Tag = -1) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   683
                     DrawRotated(sprPlane, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, -1,  DxDy2Angle(Gear^.dX, Gear^.dY) + 90)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   684
                  else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   685
                     DrawRotated(sprPlane, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,0,DxDy2Angle(Gear^.dY, Gear^.dX));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   686
                  if ((TrainingFlags and tfRCPlane) <> 0) and (TrainingTargetGear <> nil) and ((Gear^.State and gstDrowning) = 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   687
                     DrawRotatedf(sprFinger, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, GameTicks div 32 mod 16, 0, DxDy2Angle(Gear^.X - TrainingTargetGear^.X, TrainingTargetGear^.Y - Gear^.Y));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   688
                  end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   689
       gtBall: DrawRotatedf(sprBalls, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tag,0, Gear^.DirAngle);
3428
46a2694867bc portal:
sheepluva
parents: 3422
diff changeset
   690
46a2694867bc portal:
sheepluva
parents: 3422
diff changeset
   691
       gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
46a2694867bc portal:
sheepluva
parents: 3422
diff changeset
   692
                 or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked?
46a2694867bc portal:
sheepluva
parents: 3422
diff changeset
   693
                 or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving?
46a2694867bc portal:
sheepluva
parents: 3422
diff changeset
   694
                      DrawRotatedf(sprPortal, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
46a2694867bc portal:
sheepluva
parents: 3422
diff changeset
   695
                 else DrawRotatedf(sprPortal, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   696
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   697
       gtDrill: DrawRotated(sprDrill, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   698
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   699
        gtHedgehog: DrawHH(Gear);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   700
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   701
    gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   702
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   703
           gtGrave: DrawTextureF(PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex, 1, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   704
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   705
             gtBee: DrawRotatedF(sprBee, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   706
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   707
      gtPickHammer: DrawSprite(sprPHammer, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 50 + LongInt(((GameTicks shr 5) and 1) * 2) + WorldDy, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   708
            gtRope: DrawRope(Gear);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   709
            gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   710
                           DrawRotated(sprMineOff, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   711
                       else if Gear^.Health <> 0 then DrawRotated(sprMineOn, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   712
                       else DrawRotated(sprMineDead, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
3710
411f5c2b5292 Engine:
smaxx
parents: 3641
diff changeset
   713
           gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
411f5c2b5292 Engine:
smaxx
parents: 3641
diff changeset
   714
                           DrawRotated(sprSMineOff, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle)
411f5c2b5292 Engine:
smaxx
parents: 3641
diff changeset
   715
                       else if Gear^.Health <> 0 then DrawRotated(sprSMineOn, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle)
411f5c2b5292 Engine:
smaxx
parents: 3641
diff changeset
   716
                       else DrawRotated(sprMineDead, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   717
            gtCase: case Gear^.Pos of
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   718
                         posCaseAmmo  : begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   719
                                        i:= (GameTicks shr 6) mod 64;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   720
                                        if i > 18 then i:= 0;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   721
                                        DrawSprite(sprCase, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   722
                                        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   723
                         posCaseHealth: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   724
                                        i:= ((GameTicks shr 6) + 38) mod 64;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   725
                                        if i > 13 then i:= 0;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   726
                                        DrawSprite(sprFAid, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   727
                                        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   728
                         posCaseUtility: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   729
                                        i:= (GameTicks shr 6) mod 70;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   730
                                        if i > 23 then i:= 0;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   731
                                        i:= i mod 12;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   732
                                        DrawSprite(sprUtility, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   733
                                        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   734
                         end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   735
      gtExplosives: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   736
                    if ((Gear^.State and gstDrowning) <> 0) then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   737
                        DrawSprite(sprExplosivesRoll, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, 0)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   738
                    else if Gear^.State and gstAnimation = 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   739
                        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   740
                        i:= (GameTicks shr 6 + Gear^.uid*3) mod 64;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   741
                        if i > 18 then i:= 0;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   742
                        DrawSprite(sprExplosives, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   743
                        end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   744
                    else if Gear^.State and gsttmpFlag = 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   745
                        DrawRotatedF(sprExplosivesRoll, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) +4 + WorldDy, 0, 0, Gear^.DirAngle)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   746
                    else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   747
                        DrawRotatedF(sprExplosivesRoll, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) +4 + WorldDy, 1, 0, Gear^.DirAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   748
                    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   749
        gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   750
     gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   751
         gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0);
3751
a70c61c076ae Engine:
smaxx
parents: 3717
diff changeset
   752
           gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   753
       gtParachute: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   754
                    DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   755
                    DrawAltWeapon(Gear, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   756
                    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   757
       gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - SpritesData[sprAirplane].Width div 2 + WorldDx, hwRound(Gear^.Y) - SpritesData[sprAirplane].Height div 2 + WorldDy, 0)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   758
                                     else DrawSprite(sprAirplane, hwRound(Gear^.X) - SpritesData[sprAirplane].Width div 2 + WorldDx, hwRound(Gear^.Y) - SpritesData[sprAirplane].Height div 2 + WorldDy, 1);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   759
         gtAirBomb: DrawRotated(sprAirBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   760
        gtTeleport: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   761
                    HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   762
                    if not PHedgehog(Gear^.Hedgehog)^.Unplaced then DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, Gear^.Pos, hwSign(Gear^.dX), 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   763
                    DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   764
                    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   765
        gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   766
          gtTarget: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   767
                    Tint($FF, $FF, $FF, floor($FF * Gear^.Timer / 1000));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   768
                    DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   769
                    Tint($FF, $FF, $FF, $FF);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   770
                    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   771
          gtMortar: DrawRotated(sprMortar, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   772
          gtCake: if Gear^.Pos = 6 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   773
                     DrawRotatedf(sprCakeWalk, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   774
                  else
3508
a7ca07614a2d correct cake sit-down animation so that it doesn't sit down in mid-air anymore
sheepluva
parents: 3496
diff changeset
   775
                     DrawRotatedf(sprCakeDown, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   776
       gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   777
      gtWatermelon: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 0, Gear^.DirAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   778
      gtMelonPiece: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 1, 0, Gear^.DirAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   779
     gtHellishBomb: DrawRotated(sprHellishBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   780
           gtBirdy: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   781
                    if Gear^.State and gstAnimation = gstAnimation then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   782
                        begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   783
                        if Gear^.State and gstTmpFlag = 0 then // Appearing
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   784
                            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   785
                            endX:= hwRound(Gear^.X);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   786
                            endY:= hwRound(Gear^.Y);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   787
                            if Gear^.Tag < 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   788
                                startX:= max(LAND_WIDTH + 1024, endX + 2048)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   789
                            else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   790
                                startX:= max(-LAND_WIDTH - 1024, endX - 2048);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   791
                            startY:= endY - 256;
3407
dcc129c4352e Engine:
smxx
parents: 3396
diff changeset
   792
                            DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1)), startY + WorldDy + floor((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   793
                            end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   794
                        else // Disappearing
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   795
                            begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   796
                            startX:= hwRound(Gear^.X);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   797
                            startY:= hwRound(Gear^.Y);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   798
                            if Gear^.Tag > 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   799
                                endX:= max(LAND_WIDTH + 1024, startX + 2048)
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   800
                            else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   801
                                endX:= max(-LAND_WIDTH - 1024, startX - 2048);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   802
                            endY:= startY + 256;
3407
dcc129c4352e Engine:
smxx
parents: 3396
diff changeset
   803
                            DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + floor((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY)) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   804
                            end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   805
                        end
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   806
                    else
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   807
                        DrawTextureF(SpritesData[sprBirdy].Texture, 1, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   808
                    end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   809
             gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 16, 16, Gear^.DirAngle);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   810
           gtPiano: begin
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   811
                    if (Gear^.State and gstDrowning) = 0 then
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   812
                        begin
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   813
                        Tint($FF, $FF, $FF, $10);
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   814
                        for i:= 8 downto 1 do
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   815
                            DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128, 0);
3390
1d4926d10a9e Engine:
smxx
parents: 3387
diff changeset
   816
                        Tint($FF, $FF, $FF, $FF)
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   817
                        end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   818
                    DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 128, 128, 0);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   819
                    end;
3712
de2026031833 Engine:
smaxx
parents: 3710
diff changeset
   820
     gtPoisonCloud: begin
3713
f8778904600d Engine:
smaxx
parents: 3712
diff changeset
   821
                    if Gear^.Timer < 1020 then
f8778904600d Engine:
smaxx
parents: 3712
diff changeset
   822
                        Tint($C0, $C0, $00, Gear^.Timer div 8)
f8778904600d Engine:
smaxx
parents: 3712
diff changeset
   823
                    else if Gear^.Timer > 3980 then
f8778904600d Engine:
smaxx
parents: 3712
diff changeset
   824
                        Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
3712
de2026031833 Engine:
smaxx
parents: 3710
diff changeset
   825
                    else
3713
f8778904600d Engine:
smaxx
parents: 3712
diff changeset
   826
                        Tint($C0, $C0, $00, $C0);
f8778904600d Engine:
smaxx
parents: 3712
diff changeset
   827
                    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
3712
de2026031833 Engine:
smaxx
parents: 3710
diff changeset
   828
                    Tint($FF, $FF, $FF, $FF)
de2026031833 Engine:
smaxx
parents: 3710
diff changeset
   829
                    end;
3387
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   830
         end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   831
      if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   832
      Gear:= Gear^.NextGear
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   833
      end;
733f4001b8b9 Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff changeset
   834
end;