# HG changeset patch # User koda # Date 1335972971 -3600 # Node ID 486db9d26e4b9f6923ae265fb62246f9dff30911 # Parent f2524a80eea2aab350a574611cdaef127dca72c9 rename a few Draw* routines diff -r f2524a80eea2 -r 486db9d26e4b hedgewars/uCaptions.pas --- a/hedgewars/uCaptions.pas Wed May 02 14:41:21 2012 +0100 +++ b/hedgewars/uCaptions.pas Wed May 02 16:36:11 2012 +0100 @@ -90,7 +90,7 @@ with Captions[grp] do if Tex <> nil then begin - DrawCentered(0, offset, Tex); + DrawTextureCentered(0, offset, Tex); inc(offset, Tex^.h + 2); if EndTime <= RealTicks then begin diff -r f2524a80eea2 -r 486db9d26e4b hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Wed May 02 14:41:21 2012 +0100 +++ b/hedgewars/uGearsRender.pas Wed May 02 16:36:11 2012 +0100 @@ -176,10 +176,10 @@ if RopePoints.Count > 0 then - DrawRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle) + DrawSpriteRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle) else if Gear^.Elasticity.QWordValue > 0 then - DrawRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); + DrawSpriteRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); end; @@ -224,7 +224,7 @@ end else if (Gear^.State and gstHHGone) <> 0 then begin - DrawRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0); + DrawSpriteRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0); exit end; @@ -235,7 +235,7 @@ if HH^.Effects[hePoisoned] then begin Tint($00, $FF, $40, $40); - DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360); + DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360); Tint($FF, $FF, $FF, $FF) end; @@ -335,7 +335,7 @@ CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle)); - DrawRotatedTex(HH^.Team^.CrosshairTex, + DrawTextureRotated(HH^.Team^.CrosshairTex, 12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0, sign * (Gear^.Angle * 180.0) / cMaxAngle); end; @@ -347,20 +347,20 @@ case CurAmmoGear^.Kind of gtShotgunShot: begin if (CurAmmoGear^.State and gstAnimation <> 0) then - DrawRotated(sprShotgun, hx, hy, sign, aangle) + DrawSpriteRotated(sprShotgun, hx, hy, sign, aangle) else - DrawRotated(sprHandShotgun, hx, hy, sign, aangle); + DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle); end; - gtDEagleShot: DrawRotated(sprDEagle, hx, hy, sign, aangle); + gtDEagleShot: DrawSpriteRotated(sprDEagle, hx, hy, sign, aangle); gtSniperRifleShot: begin if (CurAmmoGear^.State and gstAnimation <> 0) then - DrawRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle) + DrawSpriteRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle) else - DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle) + DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle) end; - gtBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); + gtBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); gtRCPlane: begin - DrawRotated(sprHandPlane, hx, hy, sign, 0); + DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0); defaultPos:= false end; gtRope: begin @@ -386,12 +386,12 @@ with HH^ do if (HatTex <> nil) then begin - DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, + DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); if HatTex^.w > 64 then begin Tint(HH^.Team^.Clan^.Color shl 8 or $FF); - DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, + DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); Tint($FF, $FF, $FF, $FF) end @@ -402,7 +402,7 @@ end; gtBlowTorch: begin - DrawRotated(sprBlowTorch, hx, hy, sign, aangle); + DrawSpriteRotated(sprBlowTorch, hx, hy, sign, aangle); DrawHedgehog(sx, sy, sign, 3, @@ -435,7 +435,7 @@ end; defaultPos:= false end; - gtShover: DrawRotated(sprHandBaseball, hx, hy, sign, aangle + 180); + gtShover: DrawSpriteRotated(sprHandBaseball, hx, hy, sign, aangle + 180); gtFirePunch: begin DrawHedgehog(sx, sy, @@ -453,7 +453,7 @@ gtTeleport: defaultPos:= false; gtWhip: begin - DrawRotatedF(sprWhip, + DrawSpriteRotatedF(sprWhip, sx, sy, 1, @@ -463,7 +463,7 @@ end; gtHammer: begin - DrawRotatedF(sprHammer, + DrawSpriteRotatedF(sprHammer, sx, sy, 1, @@ -473,7 +473,7 @@ end; gtResurrector: begin - DrawRotated(sprHandResurrector, sx, sy, 0, 0); + DrawSpriteRotated(sprHandResurrector, sx, sy, 0, 0); defaultPos:= false end; gtKamikaze: @@ -485,7 +485,7 @@ 6, 0) else - DrawRotatedF(sprKamikaze, + DrawSpriteRotatedF(sprKamikaze, ox, oy, CurAmmoGear^.Pos - 1, sign, @@ -502,7 +502,7 @@ 0) else begin - DrawRotatedF(sprDress, + DrawSpriteRotatedF(sprDress, ox, oy, CurAmmoGear^.Pos, sign, @@ -513,14 +513,14 @@ end; gtFlamethrower: begin - DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); + DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); if CurAmmoGear^.Tex <> nil then - DrawCentered(sx, sy - 40, CurAmmoGear^.Tex) + DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex) end; gtLandGun: - begin DrawRotated(sprHandBallgun, hx, hy, sign, aangle); + begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); if CurAmmoGear^.Tex <> nil then - DrawCentered(sx, sy - 40, CurAmmoGear^.Tex) + DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex) end; end; @@ -568,7 +568,7 @@ end else begin - DrawRotatedF(Wavez[TWave(Gear^.Tag)].Sprite, + DrawSpriteRotatedF(Wavez[TWave(Gear^.Tag)].Sprite, sx, sy, Gear^.Pos, @@ -594,49 +594,49 @@ amt:= CurrentHedgehog^.CurAmmoType; CurWeapon:= GetCurAmmoEntry(HH^); case amt of - amBazooka: DrawRotated(sprHandBazooka, hx, hy, sign, aangle); - amSnowball: DrawRotated(sprHandSnowball, hx, hy, sign, aangle); - amMortar: DrawRotated(sprHandMortar, hx, hy, sign, aangle); - amMolotov: DrawRotated(sprHandMolotov, hx, hy, sign, aangle); - amBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); - amDrill: DrawRotated(sprHandDrill, hx, hy, sign, aangle); - amRope: DrawRotated(sprHandRope, hx, hy, sign, aangle); - amShotgun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle); - amDEagle: DrawRotated(sprHandDEagle, hx, hy, sign, aangle); - amSineGun: DrawRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle); + amBazooka: DrawSpriteRotated(sprHandBazooka, hx, hy, sign, aangle); + amSnowball: DrawSpriteRotated(sprHandSnowball, hx, hy, sign, aangle); + amMortar: DrawSpriteRotated(sprHandMortar, hx, hy, sign, aangle); + amMolotov: DrawSpriteRotated(sprHandMolotov, hx, hy, sign, aangle); + amBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); + amDrill: DrawSpriteRotated(sprHandDrill, hx, hy, sign, aangle); + amRope: DrawSpriteRotated(sprHandRope, hx, hy, sign, aangle); + amShotgun: DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle); + amDEagle: DrawSpriteRotated(sprHandDEagle, hx, hy, sign, aangle); + amSineGun: DrawSpriteRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle); amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer? - DrawRotatedF(sprPortalGun, hx, hy, 0, sign, aangle) + DrawSpriteRotatedF(sprPortalGun, hx, hy, 0, sign, aangle) else - DrawRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle); + DrawSpriteRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle); - amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle); - amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, sign, aangle); - amCake: DrawRotated(sprHandCake, hx, hy, sign, aangle); - amGrenade: DrawRotated(sprHandGrenade, hx, hy, sign, aangle); - amWatermelon: DrawRotated(sprHandMelon, hx, hy, sign, aangle); - amSkip: DrawRotated(sprHandSkip, hx, hy, sign, aangle); - amClusterBomb: DrawRotated(sprHandCluster, hx, hy, sign, aangle); - amDynamite: DrawRotated(sprHandDynamite, hx, hy, sign, aangle); - amHellishBomb: DrawRotated(sprHandHellish, hx, hy, sign, aangle); - amGasBomb: DrawRotated(sprHandCheese, hx, hy, sign, aangle); - amMine: DrawRotated(sprHandMine, hx, hy, sign, aangle); - amSMine: DrawRotated(sprHandSMine, hx, hy, sign, aangle); + amSniperRifle: DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle); + amBlowTorch: DrawSpriteRotated(sprHandBlowTorch, hx, hy, sign, aangle); + amCake: DrawSpriteRotated(sprHandCake, hx, hy, sign, aangle); + amGrenade: DrawSpriteRotated(sprHandGrenade, hx, hy, sign, aangle); + amWatermelon: DrawSpriteRotated(sprHandMelon, hx, hy, sign, aangle); + amSkip: DrawSpriteRotated(sprHandSkip, hx, hy, sign, aangle); + amClusterBomb: DrawSpriteRotated(sprHandCluster, hx, hy, sign, aangle); + amDynamite: DrawSpriteRotated(sprHandDynamite, hx, hy, sign, aangle); + amHellishBomb: DrawSpriteRotated(sprHandHellish, hx, hy, sign, aangle); + amGasBomb: DrawSpriteRotated(sprHandCheese, hx, hy, sign, aangle); + amMine: DrawSpriteRotated(sprHandMine, hx, hy, sign, aangle); + amSMine: DrawSpriteRotated(sprHandSMine, hx, hy, sign, aangle); amSeduction: begin - DrawRotated(sprHandSeduction, hx, hy, sign, aangle); + DrawSpriteRotated(sprHandSeduction, hx, hy, sign, aangle); DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA); //Tint($FF, $0, $0, $AA); //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10); //Tint($FF, $FF, $FF, $FF); end; - amVampiric: DrawRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle); + amVampiric: DrawSpriteRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle); amRCPlane: begin - DrawRotated(sprHandPlane, hx, hy, sign, 0); + DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0); defaultPos:= false end; amGirder: begin - DrawRotated(sprHandConstruction, hx, hy, sign, aangle); + DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle); DrawSpriteClipped(sprGirder, ox-256, oy-256, @@ -645,34 +645,34 @@ cWaterLine+WorldDy, LongInt(leftX)+WorldDx) end; - amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle); - amFlamethrower: DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); - amLandGun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); + amBee: DrawSpriteRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle); + amFlamethrower: DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); + amLandGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here end; case amt of amAirAttack, amMineStrike, - amDrillStrike: DrawRotated(sprHandAirAttack, sx, oy, sign, 0); + amDrillStrike: DrawSpriteRotated(sprHandAirAttack, sx, oy, sign, 0); amPickHammer: DrawHedgehog(sx, sy, sign, 1, 2, 0); - amTeleport: DrawRotatedF(sprTeleport, sx, sy, 0, sign, 0); + amTeleport: DrawSpriteRotatedF(sprTeleport, sx, sy, 0, sign, 0); amKamikaze: DrawHedgehog(sx, sy, sign, 1, 5, 0); - amWhip: DrawRotatedF(sprWhip, + amWhip: DrawSpriteRotatedF(sprWhip, sx, sy, 0, sign, 0); - amHammer: DrawRotatedF(sprHammer, + amHammer: DrawSpriteRotatedF(sprHammer, sx, sy, 0, @@ -700,7 +700,7 @@ end; case amt of - amBaseballBat: DrawRotated(sprHandBaseball, + amBaseballBat: DrawSpriteRotated(sprHandBaseball, sx - 4 * sign, sy + 9, sign, aangle); end; @@ -736,7 +736,7 @@ begin if defaultPos then begin - DrawRotatedF(sprHHIdle, + DrawSpriteRotatedF(sprHHIdle, sx, sy, (RealTicks div 128 + Gear^.Pos) mod 19, @@ -828,7 +828,7 @@ DrawSprite(sprJetpack, sx-36, sy-28, 3) end; if CurAmmoGear^.Tex <> nil then - DrawCentered(sx, sy - 40, CurAmmoGear^.Tex); + DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex); DrawAltWeapon(Gear, sx, sy) end; end; @@ -847,17 +847,17 @@ if ((cTagsMask and htHealth) <> 0) then begin dec(t, HealthTagTex^.h + 2); - DrawCentered(ox, t, HealthTagTex) + DrawTextureCentered(ox, t, HealthTagTex) end; if (cTagsMask and htName) <> 0 then begin dec(t, NameTagTex^.h + 2); - DrawCentered(ox, t, NameTagTex) + DrawTextureCentered(ox, t, NameTagTex) end; if (cTagsMask and htTeamName) <> 0 then begin dec(t, Team^.NameTagTex^.h + 2); - DrawCentered(ox, t, Team^.NameTagTex) + DrawTextureCentered(ox, t, Team^.NameTagTex) end; if (cTagsMask and htTransparent) <> 0 then Tint($FF, $FF, $FF, $FF) @@ -865,7 +865,7 @@ if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog begin if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then - DrawCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex); + DrawTextureCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex); if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then DrawSprite(sprFinger, ox - 16, oy - 64, @@ -880,7 +880,7 @@ if HH^.Effects[hePoisoned] then begin Tint($00, $FF, $40, $80); - DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360); + DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360); end; if HH^.Effects[heResurrected] then begin @@ -913,43 +913,43 @@ begin if Gear^.Target.X <> NoPointX then if Gear^.AmmoType = amBee then - DrawRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) + DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) else - DrawRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); + DrawSpriteRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); case Gear^.Kind of - gtGrenade: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle); - gtSnowball: DrawRotated(sprSnowball, x, y, 0, Gear^.DirAngle); - gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle); + gtGrenade: DrawSpriteRotated(sprBomb, x, y, 0, Gear^.DirAngle); + gtSnowball: DrawSpriteRotated(sprSnowball, x, y, 0, Gear^.DirAngle); + gtGasBomb: DrawSpriteRotated(sprCheese, x, y, 0, Gear^.DirAngle); gtMolotov: if (Gear^.State and gstDrowning) = 0 then - DrawRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX)) + DrawSpriteRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX)) else DrawSprite(sprMolotov, x, y, 8); gtRCPlane: begin aangle:= Gear^.Angle * 360 / 4096; if Gear^.Tag < 0 then aangle:= 360-aangle; Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); - DrawRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90); + DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90); Tint($FF, $FF, $FF, $FF); - DrawRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90) + DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90) end; - gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); + gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked? or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving? - DrawRotatedf(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) - else DrawRotatedf(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); + DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) + else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then - DrawRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) + DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) else - DrawRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); + DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); gtHedgehog: DrawHH(Gear, x, y); - gtShell: DrawRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); + gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); gtGrave: begin DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); @@ -962,21 +962,21 @@ Tint($FF, $FF, $FF, $FF) end end; - gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); + gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); gtRope: DrawRope(Gear); gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then - DrawRotated(sprMineOff, x, y, 0, Gear^.DirAngle) + DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle) else if Gear^.Health <> 0 then - DrawRotated(sprMineOn, x, y, 0, Gear^.DirAngle) - else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); + DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle) + else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then - DrawRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) + DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) else if Gear^.Health <> 0 then - DrawRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) - else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); + DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) + else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); gtCase: if ((Gear^.Pos and posCaseAmmo) <> 0) then begin @@ -1011,12 +1011,12 @@ DrawSprite(sprExplosives, x - 24, y - 24, i) end else if Gear^.State and gsttmpFlag = 0 then - DrawRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) + DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) else - DrawRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); + DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); end; gtDynamite: DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); - gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); + gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); gtFlame: if Gear^.Tag and 1 = 0 then DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16) @@ -1027,16 +1027,16 @@ end; gtAirAttack: begin Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); - DrawRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0); + DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0); Tint($FF, $FF, $FF, $FF); - DrawRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0); + DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0); end; - gtAirBomb: DrawRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); + gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); gtTeleport: begin HHGear:= Gear^.Hedgehog^.Gear; if not Gear^.Hedgehog^.Unplaced then - DrawRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); - DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); + DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); + DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); end; gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12); gtTarget: begin @@ -1044,17 +1044,17 @@ DrawSprite(sprTarget, x - 16, y - 16, 0); Tint($FF, $FF, $FF, $FF); end; - gtMortar: DrawRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); + gtMortar: DrawSpriteRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); gtCake: if Gear^.Pos = 6 then - DrawRotatedf(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) + DrawSpriteRotatedF(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) else - DrawRotatedf(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); + DrawSpriteRotatedF(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, x - 16, y - 16, 0); - gtWatermelon: DrawRotatedf(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); - gtMelonPiece: DrawRotatedf(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); - gtHellishBomb: DrawRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle); + gtWatermelon: DrawSpriteRotatedF(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); + gtMelonPiece: DrawSpriteRotatedF(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); + gtHellishBomb: DrawSpriteRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle); gtBirdy: begin if Gear^.State and gstAnimation = gstAnimation then begin @@ -1089,7 +1089,7 @@ DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); end; end; - gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle); + gtEgg: DrawTextureRotatedF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle); gtPiano: begin if (Gear^.State and gstDrowning) = 0 then begin @@ -1107,16 +1107,16 @@ Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) else Tint($C0, $C0, $00, $C0); - DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); + DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); Tint($FF, $FF, $FF, $FF) end; gtResurrector: begin - DrawRotated(sprCross, x, y, 0, 0); + DrawSpriteRotated(sprCross, x, y, 0, 0); Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000)))); DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5); Tint($FF, $FF, $FF, $FF); end; - gtNapalmBomb: DrawRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); + gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0 then begin Tint((ExplosionBorderColor shr RShift) and $FF, @@ -1124,8 +1124,8 @@ (ExplosionBorderColor shr BShift) and $FF, $FF); // Needs a nicer white texture to tint - DrawRotatedTextureF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle); - //DrawRotated(sprSnowDust, x, y, 0, Gear^.DirAngle); + DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle); + //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle); //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1); Tint($FF, $FF, $FF, $FF); end @@ -1140,9 +1140,9 @@ if vobVelocity = 0 then DrawSprite(sprFlake, x, y, Gear^.Timer) else - DrawRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle); + DrawSpriteRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle); //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer) -//DrawRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle); +//DrawSpriteRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle); if Gear^.FlightTime > 0 then Tint($FF, $FF, $FF, $FF); end; @@ -1171,7 +1171,7 @@ end; if Gear^.RenderTimer and (Gear^.Tex <> nil) then - DrawCentered(x + 8, y + 8, Gear^.Tex); + DrawTextureCentered(x + 8, y + 8, Gear^.Tex); end; end. diff -r f2524a80eea2 -r 486db9d26e4b hedgewars/uRender.pas --- a/hedgewars/uRender.pas Wed May 02 14:41:21 2012 +0100 +++ b/hedgewars/uRender.pas Wed May 02 16:36:11 2012 +0100 @@ -24,33 +24,32 @@ uses SDLh, uTypes, GLunit, uConsts; -procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture); -procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture); - -procedure DrawSprite(Sprite: TSprite; X, Y, Frame: LongInt); -procedure DrawSprite(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt); -procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt); -procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt); - -procedure DrawTexture(X, Y: LongInt; Texture: PTexture); inline; -procedure DrawTexture(X, Y: LongInt; Texture: PTexture; Scale: GLfloat); -procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, w, h: LongInt); +procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt); +procedure DrawSprite (Sprite: TSprite; X, Y, FrameX, FrameY: LongInt); +procedure DrawSpriteFromRect (Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt); +procedure DrawSpriteClipped (Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt); +procedure DrawSpriteRotated (Sprite: TSprite; X, Y, Dir: LongInt; Angle: real); +procedure DrawSpriteRotatedF (Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real); -procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real); -procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real); -procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real); -procedure DrawRotatedTextureF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real); +procedure DrawTexture (X, Y: LongInt; Texture: PTexture); inline; +procedure DrawTexture (X, Y: LongInt; Texture: PTexture; Scale: GLfloat); +procedure DrawTextureFromRect (X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture); +procedure DrawTextureFromRect (X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture); +procedure DrawTextureCentered (X, Top: LongInt; Source: PTexture); +procedure DrawTextureF (Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, w, h: LongInt); +procedure DrawTextureRotated (Texture: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real); +procedure DrawTextureRotatedF (Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real); -procedure DrawCentered(X, Top: LongInt; Source: PTexture); -procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte); -procedure DrawFillRect(r: TSDL_Rect); -procedure DrawCircle(X, Y, Radius, Width: LongInt); -procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte); -procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real); -procedure DrawScreenWidget(widget: POnScreenWidget); +procedure DrawCircle (X, Y, Radius, Width: LongInt); +procedure DrawCircle (X, Y, Radius, Width: LongInt; r, g, b, a: Byte); -procedure Tint(r, g, b, a: Byte); inline; -procedure Tint(c: Longword); inline; +procedure DrawLine (X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte); +procedure DrawFillRect (r: TSDL_Rect); +procedure DrawHedgehog (X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real); +procedure DrawScreenWidget (widget: POnScreenWidget); + +procedure Tint (r, g, b, a: Byte); inline; +procedure Tint (c: Longword); inline; implementation @@ -60,15 +59,15 @@ begin r.y:= r.y + Height * Position; r.h:= Height; -DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture) +DrawTextureFromRect(X, Y, @r, SpritesData[Sprite].Texture) end; -procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture); +procedure DrawTextureFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture); begin -DrawFromRect(X, Y, r^.w, r^.h, r, SourceTexture) +DrawTextureFromRect(X, Y, r^.w, r^.h, r, SourceTexture) end; -procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture); +procedure DrawTextureFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture); var rr: TSDL_Rect; _l, _r, _t, _b: real; VertexBuffer, TextureBuffer: array [0..3] of TVertex2f; @@ -112,7 +111,6 @@ TextureBuffer[3].X:= _l; TextureBuffer[3].Y:= _b; - glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); glTexCoordPointer(2, GL_FLOAT, 0, @TextureBuffer[0]); glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); @@ -141,10 +139,10 @@ procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, w, h: LongInt); begin - DrawRotatedTextureF(Texture, Scale, 0, 0, X, Y, Frame, Dir, w, h, 0) + DrawTextureRotatedF(Texture, Scale, 0, 0, X, Y, Frame, Dir, w, h, 0) end; -procedure DrawRotatedTextureF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real); +procedure DrawTextureRotatedF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real); var ft, fb, fl, fr: GLfloat; hw, nx, ny: LongInt; VertexBuffer, TextureBuffer: array [0..3] of TVertex2f; @@ -204,15 +202,15 @@ glPopMatrix end; -procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real); +procedure DrawSpriteRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real); begin - DrawRotatedTex(SpritesData[Sprite].Texture, + DrawTextureRotated(SpritesData[Sprite].Texture, SpritesData[Sprite].Width, SpritesData[Sprite].Height, X, Y, Dir, Angle) end; -procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real); +procedure DrawSpriteRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real); begin glPushMatrix; glTranslatef(X, Y, 0); @@ -229,7 +227,7 @@ glPopMatrix end; -procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real); +procedure DrawTextureRotated(Texture: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real); var VertexBuffer: array [0..3] of TVertex2f; begin // do not draw anything outside the visible screen space (first check fixes some sprite drawing, e.g. hedgehogs) @@ -250,7 +248,7 @@ glRotatef(Angle, 0, 0, 1); -glBindTexture(GL_TEXTURE_2D, Tex^.id); +glBindTexture(GL_TEXTURE_2D, Texture^.id); VertexBuffer[0].X:= -hw; VertexBuffer[0].Y:= -hh; @@ -262,7 +260,7 @@ VertexBuffer[3].Y:= hh; glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); -glTexCoordPointer(2, GL_FLOAT, 0, @Tex^.tb); +glTexCoordPointer(2, GL_FLOAT, 0, @Texture^.tb); glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer)); glPopMatrix @@ -286,7 +284,7 @@ r.w:= SpritesData[Sprite].Width; r.y:= FrameY * SpritesData[Sprite].Height; r.h:= SpritesData[Sprite].Height; - DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture) + DrawTextureFromRect(X, Y, @r, SpritesData[Sprite].Texture) end; procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt); @@ -310,10 +308,10 @@ dec(r.h, r.y); dec(r.w, r.x); -DrawFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture) +DrawTextureFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture) end; -procedure DrawCentered(X, Top: LongInt; Source: PTexture); +procedure DrawTextureCentered(X, Top: LongInt; Source: PTexture); var scale: GLfloat; begin if (Source^.w + 20) > cScreenWidth then diff -r f2524a80eea2 -r 486db9d26e4b hedgewars/uStore.pas --- a/hedgewars/uStore.pas Wed May 02 14:41:21 2012 +0100 +++ b/hedgewars/uStore.pas Wed May 02 16:36:11 2012 +0100 @@ -789,7 +789,7 @@ r.w:= squaresize; r.h:= squaresize; - DrawFromRect( -squaresize div 2, (cScreenHeight - squaresize) shr 1, @r, ProgrTex); + DrawTextureFromRect( -squaresize div 2, (cScreenHeight - squaresize) shr 1, @r, ProgrTex); {$IFDEF SDL13} SDL_GL_SwapWindow(SDLwindow); diff -r f2524a80eea2 -r 486db9d26e4b hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Wed May 02 14:41:21 2012 +0100 +++ b/hedgewars/uVisualGears.pas Wed May 02 16:36:11 2012 +0100 @@ -585,12 +585,12 @@ if vobSDVelocity = 0 then DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) else if vobVelocity = 0 then DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) end else begin @@ -598,12 +598,12 @@ if vobSDVelocity = 0 then DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) else - DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) else if vobVelocity = 0 then DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) else - DrawRotatedTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) end; end; if Gear^.Tint <> $FFFFFFFF then @@ -624,12 +624,12 @@ if vobSDVelocity = 0 then DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) else if vobVelocity = 0 then DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); + DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); vgtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State); vgtEvilTrace: if Gear^.State < 8 then @@ -680,27 +680,27 @@ if vobSDVelocity = 0 then DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) else if vobVelocity = 0 then DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*) + DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*) vgtSpeechBubble: begin if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then begin tinted:= true; Tint($FF, $FF, $FF, $66); - DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) + DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) end else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then - DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); + DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); end; - vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); + vgtSmallDamageTag: DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); vgtHealthTag: if Gear^.Tex <> nil then begin if Gear^.Frame = 0 then - DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) + DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) else begin SetScale(cDefaultZoomLevel); @@ -716,12 +716,12 @@ i:= -1 else i:= 1; - DrawRotatedTextureF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle); + DrawTextureRotatedF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle); end; end; if (cReducedQuality and rqAntiBoom) = 0 then case Gear^.Kind of - vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); + vgtChunk: DrawSpriteRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); end; if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF); @@ -741,7 +741,7 @@ vgtBigExplosion: begin tinted:= true; Tint($FF, $FF, $FF, round($FF * (1 - power(Gear^.Timer / 250, 4)))); - DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle); + DrawTextureRotatedF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle); end; end; if (cReducedQuality and rqAntiBoom) = 0 then @@ -761,7 +761,7 @@ Tint($FF, $FF, $FF, Gear^.FrameTicks); tinted:= true end; - DrawRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); + DrawSpriteRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); end; vgtFeather: begin if Gear^.FrameTicks < 255 then @@ -769,36 +769,36 @@ Tint($FF, $FF, $FF, Gear^.FrameTicks); tinted:= true end; - DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); + DrawSpriteRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); end; - vgtEgg: DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); + vgtEgg: DrawSpriteRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); vgtBeeTrace: begin if Gear^.FrameTicks < $FF then Tint($FF, $FF, $FF, Gear^.FrameTicks div 2) else Tint($FF, $FF, $FF, $80); tinted:= true; - DrawRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle); + DrawSpriteRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle); end; vgtSmokeRing: begin tinted:= true; Tint($FF, $FF, $FF, round(Gear^.alpha * $FF)); - DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle); + DrawTextureRotatedF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle); end; - vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); - vgtBulletHit: DrawRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle); + vgtNote: DrawSpriteRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle); + vgtBulletHit: DrawSpriteRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle); end; case Gear^.Kind of vgtFlake: if SuddenDeathDmg then if vobSDVelocity = 0 then DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) else - DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) else if vobVelocity = 0 then DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) else - DrawRotatedTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); + DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); vgtCircle: if gear^.Angle = 1 then begin tmp:= Gear^.State / 100; @@ -828,12 +828,12 @@ if vobSDVelocity = 0 then DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) else - DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) + DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle) else if vobVelocity = 0 then DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) else - DrawRotatedTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); + DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); end; if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); @@ -856,12 +856,12 @@ if vobSDVelocity = 0 then DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) else if vobVelocity = 0 then DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); + DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); end; if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); @@ -880,12 +880,12 @@ if vobSDVelocity = 0 then DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) + DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) else if vobVelocity = 0 then DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else - DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); + DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); end; if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF); diff -r f2524a80eea2 -r 486db9d26e4b hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Wed May 02 14:41:21 2012 +0100 +++ b/hedgewars/uWorld.pas Wed May 02 16:36:11 2012 +0100 @@ -1232,9 +1232,9 @@ with PHedgehog(CurrentHedgehog)^ do begin if CurAmmoType = amBee then - DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) + DrawSpriteRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) else - DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) + DrawSpriteRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) end end; {$WARNINGS ON} @@ -1318,13 +1318,13 @@ r.y:= 0; r.w:= 2 + TeamHealthBarWidth; r.h:= HealthTex^.h; - DrawFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); + DrawTextureFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); // draw health bars right border inc(r.x, cTeamHealthWidth + 2); if TeamHealth = 0 then inc(r.x); r.w:= 3; - DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); + DrawTextureFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex); if not highlight and not hasGone and (TeamHealth > 1) then for i:= 0 to cMaxHHIndex do @@ -1353,15 +1353,15 @@ r.y:= 2; r.w:= NameTagTex^.w - 4; r.h:= NameTagTex^.h - 4; - DrawFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, NameTagTex); + DrawTextureFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, NameTagTex); // draw flag r.w:= 22; r.h:= 15; - DrawFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex); + DrawTextureFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex); // draw health bar r.w:= TeamHealthBarWidth + 1; r.h:= HealthTex^.h - 4; - DrawFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex); + DrawTextureFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex); end; end; if smallScreenOffset <> 0 then @@ -1436,9 +1436,9 @@ // various captions if fastUntilLag then - DrawCentered(0, (cScreenHeight shr 1), SyncTexture); + DrawTextureCentered(0, (cScreenHeight shr 1), SyncTexture); if isPaused then - DrawCentered(0, (cScreenHeight shr 1), PauseTexture); + DrawTextureCentered(0, (cScreenHeight shr 1), PauseTexture); if not isFirstFrame and (missionTimer <> 0) or isPaused or fastUntilLag or (GameState = gsConfirm) then begin if (ReadyTimeLeft = 0) and (missionTimer > 0) then @@ -1446,7 +1446,7 @@ if missionTimer < 0 then missionTimer:= 0; // avoid subtracting below 0 if missionTex <> nil then - DrawCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex); + DrawTextureCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex); end; // fps @@ -1523,7 +1523,7 @@ end; if GameState = gsConfirm then - DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture); + DrawTextureCentered(0, (cScreenHeight shr 1), ConfirmTexture); if ScreenFade <> sfNone then begin