Get rid if deprecated Surface parameter of Draw* calls
authorunc0rr
Sun, 13 Apr 2008 12:45:30 +0000
changeset 841 0700e3d3474d
parent 840 3c0028245ff3
child 842 fae2fae2fe8d
Get rid if deprecated Surface parameter of Draw* calls
hedgewars/uConsole.pas
hedgewars/uGears.pas
hedgewars/uStore.pas
hedgewars/uVisualGears.pas
hedgewars/uWorld.pas
--- a/hedgewars/uConsole.pas	Sun Apr 13 12:33:16 2008 +0000
+++ b/hedgewars/uConsole.pas	Sun Apr 13 12:45:30 2008 +0000
@@ -147,7 +147,7 @@
 
 for y:= 0 to cConsoleHeight div 256 + 1 do
     for x:= 0 to cScreenWidth div 256 + 1 do
-        DrawSprite(sprConsoleBG, x * 256, cConsoleHeight - 256 - y * 256, 0, Surface);
+        DrawSprite(sprConsoleBG, x * 256, cConsoleHeight - 256 - y * 256, 0);
 
 for y:= 0 to cConsoleHeight div Fontz[fnt16].Height do
     DrawLine(ConsoleLines[(CurrLine - 1 - y + cLinesCount) mod cLinesCount], 4, cConsoleHeight - (y + 2) * (Fontz[fnt16].Height + 2));
--- a/hedgewars/uGears.pas	Sun Apr 13 12:33:16 2008 +0000
+++ b/hedgewars/uGears.pas	Sun Apr 13 12:45:30 2008 +0000
@@ -469,7 +469,7 @@
       end
 end;
 
-procedure DrawHH(Gear: PGear; Surface: PSDL_Surface);
+procedure DrawHH(Gear: PGear);
 var t: LongInt;
 	amt: TAmmoType;
 	hx, hy: LongInt;
@@ -596,11 +596,11 @@
         begin
         if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
            DrawSprite(sprFinger, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 64 + WorldDy,
-                      GameTicks div 32 mod 16, Surface);
+                      GameTicks div 32 mod 16);
 
         if (Gear^.State and (gstMoving or gstDrowning)) = 0 then
            if (Gear^.State and gstHHThinking) <> 0 then
-              DrawSprite(sprQuestion, hwRound(Gear^.X) - 10 + WorldDx, hwRound(Gear^.Y) - cHHRadius - 34 + WorldDy, 0, Surface)
+              DrawSprite(sprQuestion, hwRound(Gear^.X) - 10 + WorldDx, hwRound(Gear^.Y) - cHHRadius - 34 + WorldDy, 0)
               else
               if ShowCrosshair and ((Gear^.State and gstAttacked) = 0) then
                  DrawRotatedTex(Team^.CrosshairTex,
@@ -675,7 +675,7 @@
         if b then
            begin
            inc(roplen);
-           if (roplen mod 4) = 0 then DrawSprite(sprRopeNode, x - 2, y - 2, 0, Surface)
+           if (roplen mod 4) = 0 then DrawSprite(sprRopeNode, x - 2, y - 2, 0)
            end
        end
     end;
@@ -686,12 +686,12 @@
       begin
       case Gear^.Kind of
        gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
-        gtHedgehog: DrawHH(Gear, Surface);
+        gtHedgehog: DrawHH(Gear);
     gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
        gtHealthTag,
      gtSmallDamage: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
-           gtGrave: DrawSurfSprite(hwRound(Gear^.X) + WorldDx - 16, hwRound(Gear^.Y) + WorldDy - 16, 32, (GameTicks shr 7) and 7, PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex, Surface);
-             gtUFO: DrawSprite(sprUFO, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, (GameTicks shr 7) mod 4, Surface);
+           gtGrave: DrawSurfSprite(hwRound(Gear^.X) + WorldDx - 16, hwRound(Gear^.Y) + WorldDy - 16, 32, (GameTicks shr 7) and 7, PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex);
+             gtUFO: DrawSprite(sprUFO, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, (GameTicks shr 7) mod 4);
             gtRope: begin
                     roplen:= 0;
                     if RopePoints.Count > 0 then
@@ -715,25 +715,25 @@
                        DrawRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
                        end;
                     end;
-      gtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State, Surface);
-       gtExplosion: DrawSprite(sprExplosion50, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State, Surface);
+      gtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State);
+       gtExplosion: DrawSprite(sprExplosion50, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State);
             gtMine: if ((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)
                        then DrawRotated(sprMineOff, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle)
                        else DrawRotated(sprMineOn, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
             gtCase: case Gear^.Pos of
-                         posCaseAmmo  : DrawSprite(sprCase, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0, Surface);
-                         posCaseHealth: DrawSprite(sprFAid, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, (GameTicks shr 6) mod 13, Surface);
+                         posCaseAmmo  : DrawSprite(sprCase, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
+                         posCaseHealth: DrawSprite(sprFAid, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, (GameTicks shr 6) mod 13);
                          end;
-        gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1, Surface);
+        gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1);
      gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
-         gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0, Surface);
-           gtFlame: DrawSprite(sprFlame, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy,(GameTicks div 128 + Gear^.Angle) mod 8, Surface);
-       gtParachute: DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0, Surface);
-       gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 0, Surface)
-                                     else DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 1, Surface);
+         gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0);
+           gtFlame: DrawSprite(sprFlame, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy,(GameTicks div 128 + Gear^.Angle) mod 8);
+       gtParachute: DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0);
+       gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 0)
+                                     else DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 1);
          gtAirBomb: DrawRotated(sprAirBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
-        gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12, Surface);
-          gtTarget: DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0, Surface);
+        gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12);
+          gtTarget: DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
               end;
       Gear:= Gear^.NextGear
       end;
--- a/hedgewars/uStore.pas	Sun Apr 13 12:33:16 2008 +0000
+++ b/hedgewars/uStore.pas	Sun Apr 13 12:45:30 2008 +0000
@@ -24,10 +24,10 @@
 procedure StoreInit;
 procedure StoreLoad;
 procedure StoreRelease;
-procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt; Surface: PSDL_Surface);
-procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt; Surface: PSDL_Surface);
-procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt; Surface: PSDL_Surface);
-procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture; Surface: PSDL_Surface);
+procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
+procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
+procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
+procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture);
 procedure DrawLand (X, Y: LongInt);
 procedure DrawTexture(X, Y: LongInt; Texture: PTexture);
 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
@@ -35,7 +35,7 @@
 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
 procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface);
 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
-procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture; DestSurface: PSDL_Surface);
+procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
 function  RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture;
 procedure RenderHealth(var Hedgehog: THedgehog);
@@ -302,7 +302,7 @@
 {$ENDIF}
 end;
 
-procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture; DestSurface: PSDL_Surface);
+procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
 var rr: TSDL_Rect;
     _l, _r, _t, _b: real;
 begin
@@ -371,7 +371,7 @@
 glTranslatef(X, Y, 0);
 glRotatef(Angle, 0, 0, 1);
 
-DrawSprite(Sprite, -SpritesData[Sprite].Width div 2, -SpritesData[Sprite].Width div 2, Frame, nil);
+DrawSprite(Sprite, -SpritesData[Sprite].Width div 2, -SpritesData[Sprite].Width div 2, Frame);
 
 glPopMatrix
 end;
@@ -410,41 +410,41 @@
 glPopMatrix
 end;
 
-procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt; Surface: PSDL_Surface);
+procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
 begin
 r.y:= r.y + Height * Position;
 r.h:= Height;
-DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture, Surface)
+DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
 end;
 
-procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt; Surface: PSDL_Surface);
+procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
 var r: TSDL_Rect;
 begin
 r.x:= 0;
 r.w:= SpritesData[Sprite].Width;
 r.y:= Frame * SpritesData[Sprite].Height;
 r.h:= SpritesData[Sprite].Height;
-DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture, Surface)
+DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
 end;
 
-procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt; Surface: PSDL_Surface);
+procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
 var r: TSDL_Rect;
 begin
 r.x:= FrameX * SpritesData[Sprite].Width;
 r.w:= SpritesData[Sprite].Width;
 r.y:= FrameY * SpritesData[Sprite].Height;
 r.h:= SpritesData[Sprite].Height;
-DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture, Surface)
+DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
 end;
 
-procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture; Surface: PSDL_Surface);
+procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture);
 var r: TSDL_Rect;
 begin
 r.x:= 0;
 r.w:= Source^.w;
 r.y:= Frame * Height;
 r.h:= Height;
-DrawFromRect(X, Y, @r, Source, Surface)
+DrawFromRect(X, Y, @r, Source)
 end;
 
 procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface);
@@ -625,7 +625,7 @@
 r.h:= ProgrTex^.w;
 r.y:= (Step mod (ProgrTex^.h div ProgrTex^.w)) * ProgrTex^.w;
 DrawFromRect((cScreenWidth - ProgrTex^.w) div 2,
-             (cScreenHeight - ProgrTex^.w) div 2, @r, ProgrTex, SDLPrimSurface);
+             (cScreenHeight - ProgrTex^.w) div 2, @r, ProgrTex);
 glDisable(GL_TEXTURE_2D);
 SDL_GL_SwapBuffers();
 inc(Step);
--- a/hedgewars/uVisualGears.pas	Sun Apr 13 12:33:16 2008 +0000
+++ b/hedgewars/uVisualGears.pas	Sun Apr 13 12:45:30 2008 +0000
@@ -156,11 +156,11 @@
       begin
       case Gear^.Kind of
            vgtFlake: if vobVelocity = 0 then
-                        DrawSprite(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, nil)
+                        DrawSprite(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame)
                      else
                         DrawRotatedF(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, Gear^.Angle);
 
-           vgtCloud: DrawSprite(sprCloud, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, nil);
+           vgtCloud: DrawSprite(sprCloud, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame);
               end;
       Gear:= Gear^.NextGear
       end;
--- a/hedgewars/uWorld.pas	Sun Apr 13 12:33:16 2008 +0000
+++ b/hedgewars/uWorld.pas	Sun Apr 13 12:45:30 2008 +0000
@@ -101,33 +101,33 @@
      x:= AMxCurr;
      y:= cScreenHeight - 40;
      dec(y);
-     DrawSprite(sprAMBorders, x, y, 0, Surface);
+     DrawSprite(sprAMBorders, x, y, 0);
      dec(y);
-     DrawSprite(sprAMBorders, x, y, 1, Surface);
+     DrawSprite(sprAMBorders, x, y, 1);
      dec(y, 33);
-     DrawSprite(sprAMSlotName, x, y, 0, Surface);
+     DrawSprite(sprAMSlotName, x, y, 0);
      for i:= cMaxSlotIndex downto 0 do
          if Ammo^[i, 0].Count > 0 then
             begin
             if (CursorPoint.Y >= y - 33) and (CursorPoint.Y < y) then Slot:= i;
             dec(y, 33);
             inc(SlotsNum);
-            DrawSprite(sprAMSlot, x, y, 0, Surface);
-            DrawSprite(sprAMSlotKeys, x + 2, y + 1, i, Surface);
+            DrawSprite(sprAMSlot, x, y, 0);
+            DrawSprite(sprAMSlotKeys, x + 2, y + 1, i);
             t:= 0;
             while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
                   begin
-                  DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType), Surface);
+                  DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType));
                   if (Slot = i) and (CursorPoint.X >= x + t * 33 + 35) and (CursorPoint.X < x + t * 33 + 68) then
                      begin
-                     DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0, Surface);
+                     DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0);
                      Pos:= t;
                      end;
                   inc(t)
                   end
             end;
      dec(y, 1);
-     DrawSprite(sprAMBorders, x, y, 0, Surface);
+     DrawSprite(sprAMBorders, x, y, 0);
 
      if (Pos >= 0) then
         if Ammo^[Slot, Pos].Count > 0 then
@@ -146,7 +146,7 @@
      end;
 
 bSelected:= false;
-if AMxLeft = AMxCurr then DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface)
+if AMxLeft = AMxCurr then DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8)
 end;
 
 procedure MoveCamera; forward;
@@ -165,7 +165,7 @@
     i:= Shift mod w;
     if i > 0 then dec(i, w);
     repeat
-      DrawSprite(spr, i, WorldDy + 1024 - SpritesData[spr].Height, 0, Surface);
+      DrawSprite(spr, i, WorldDy + 1024 - SpritesData[spr].Height, 0);
       inc(i, w)
     until i > cScreenWidth
     end;
@@ -188,8 +188,8 @@
 
 // Waves
 {$WARNINGS OFF}
-for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy - 64, 0, Surface);
-for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 192) and $FF), cWaterLine + WorldDy - 48, 0, Surface);
+for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy - 64, 0);
+for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 192) and $FF), cWaterLine + WorldDy - 48, 0);
 {$WARNINGS ON}
 
 DrawLand(WorldDx, WorldDy);
@@ -217,9 +217,9 @@
 
 // Waves
 {$WARNINGS OFF}
-for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6) +  64) and $FF), cWaterLine + WorldDy - 32, 0, Surface);
-for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0, Surface);
-for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy     , 0, Surface);
+for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6) +  64) and $FF), cWaterLine + WorldDy - 32, 0);
+for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0);
+for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy     , 0);
 {$WARNINGS ON}
 
 // Turn time
@@ -229,14 +229,14 @@
    if i>99 then t:= 112
       else if i>9 then t:= 96
                   else t:= 80;
-   DrawSprite(sprFrame, t, cScreenHeight - 48, 1, Surface);
+   DrawSprite(sprFrame, t, cScreenHeight - 48, 1);
    while i > 0 do
          begin
          dec(t, 32);
-         DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10, Surface);
+         DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10);
          i:= i div 10
          end;
-   DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0, Surface);
+   DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0);
    end;
 
 // Attack bar
@@ -256,12 +256,12 @@
                 for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
                     DrawSprite(sprPower, hwRound(Gear^.X) + system.round(WorldDx + tdx * (24 + i * 2)) - 16,
                                          hwRound(Gear^.Y) + system.round(WorldDy + tdy * (24 + i * 2)) - 12,
-                                         i, Surface)
+                                         i)
                 end
         end;
 
 // Target
-if TargetPoint.X <> NoPointX then DrawSprite(sprTargetP, TargetPoint.X + WorldDx - 16, TargetPoint.Y + WorldDy - 16, 0, Surface);
+if TargetPoint.X <> NoPointX then DrawSprite(sprTargetP, TargetPoint.X + WorldDx - 16, TargetPoint.Y + WorldDy - 16, 0);
 
 //glPopMatrix;
 
@@ -294,21 +294,21 @@
 
       DrawFromRect(cScreenWidth div 2,
                         DrawHealthY,
-                        @r, HealthTex, Surface);
+                        @r, HealthTex);
 
       inc(r.x, cTeamHealthWidth + 2);
       r.w:= 3;
 
       DrawFromRect(cScreenWidth div 2 + TeamHealthBarWidth + 2,
                         DrawHealthY,
-                        @r, HealthTex, Surface);
+                        @r, HealthTex);
       end;
 
 // Lag alert
-if isInLag then DrawSprite(sprLag, 32, 32  + cConsoleYAdd, (RealTicks shr 7) mod 12, Surface);
+if isInLag then DrawSprite(sprLag, 32, 32  + cConsoleYAdd, (RealTicks shr 7) mod 12);
 
 // Wind bar
-DrawSprite(sprWindBar, cScreenWidth - 180, cScreenHeight - 30, 0, Surface);
+DrawSprite(sprWindBar, cScreenWidth - 180, cScreenHeight - 30, 0);
 if WindBarWidth > 0 then
    begin
    {$WARNINGS OFF}
@@ -317,7 +317,7 @@
    r.y:= 0;
    r.w:= WindBarWidth;
    r.h:= 13;
-   DrawSpriteFromRect(sprWindR, r, cScreenWidth - 103, cScreenHeight - 28, 13, 0, Surface);
+   DrawSpriteFromRect(sprWindR, r, cScreenWidth - 103, cScreenHeight - 28, 13, 0);
    end else
  if WindBarWidth < 0 then
    begin
@@ -327,7 +327,7 @@
    r.y:= 0;
    r.w:= - WindBarWidth;
    r.h:= 13;
-   DrawSpriteFromRect(sprWindL, r, cScreenWidth - 106 + WindBarWidth, cScreenHeight - 28, 13, 0, Surface);
+   DrawSpriteFromRect(sprWindL, r, cScreenWidth - 106 + WindBarWidth, cScreenHeight - 28, 13, 0);
    end;
 
 // AmmoMenu
@@ -345,9 +345,9 @@
            if PosCount > 1 then
               DrawSprite(PosSprite, CursorPoint.X - SpritesData[PosSprite].Width div 2,
                                     CursorPoint.Y - SpritesData[PosSprite].Height div 2,
-                                    i, Surface);
+                                    i);
          end;
-   DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface)
+   DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8)
    end;
 
 if isPaused then DrawCentered(cScreenWidth div 2, cScreenHeight div 2, PauseTexture);
@@ -368,13 +368,7 @@
       SDL_FreeSurface(tmpSurface)
       end;
    if fpsTexture <> nil then
-      begin
-      r.x:= 0;
-      r.y:= 0;
-      r.w:= fpsTexture^.w;
-      r.h:= fpsTexture^.h;
-      DrawFromRect(cScreenWidth - 50, 10, @r, fpsTexture, Surface);
-      end
+      DrawTexture(cScreenWidth - 50, 10, fpsTexture);
    end;
 
 inc(SoundTimerTicks, Lag);