# HG changeset patch # User unc0rr # Date 1248946376 0 # Node ID e34b5363ae919d6c2793d44ad9c115a6bc1318be # Parent 8a24e0858947fd550d9d99eb81c196f5c7b76420 Better handle pointing with mouse cursor on zoom diff -r 8a24e0858947 -r e34b5363ae91 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Wed Jul 29 23:01:19 2009 +0000 +++ b/hedgewars/uWorld.pas Thu Jul 30 09:32:56 2009 +0000 @@ -402,24 +402,11 @@ // AmmoMenu if (AMxShift < 210) or bShowAmmoMenu then ShowAmmoMenu; -DrawChat; +// Cursor +if isCursorVisible and bShowAmmoMenu then + DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8); -// Cursor -if isCursorVisible then - begin - if not bShowAmmoMenu then - with CurrentHedgehog^ do - if (Gear^.State and gstHHChooseTarget) <> 0 then - begin - i:= Ammo^[CurSlot, CurAmmo].Pos; - with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do - if PosCount > 1 then - DrawSprite(PosSprite, CursorPoint.X - SpritesData[PosSprite].Width div 2, - cScreenHeight - CursorPoint.Y - SpritesData[PosSprite].Height div 2, - i); - end; - DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) - end; +DrawChat; if isPaused then DrawCentered(cScreenWidth div 2, cScreenHeight div 2, PauseTexture); @@ -457,6 +444,24 @@ SetScale(zoom); +// Cursor +if isCursorVisible then + begin + if not bShowAmmoMenu then + with CurrentHedgehog^ do + if (Gear^.State and gstHHChooseTarget) <> 0 then + begin + i:= Ammo^[CurSlot, CurAmmo].Pos; + with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do + if PosCount > 1 then + DrawSprite(PosSprite, CursorPoint.X - SpritesData[PosSprite].Width div 2, + cScreenHeight - CursorPoint.Y - SpritesData[PosSprite].Height div 2, + i); + end; + DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8) + end; + + glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND) end;