# HG changeset patch # User unc0rr # Date 1208095577 0 # Node ID 9a82149409f36ec24f8c665111fb443fa0836677 # Parent 27b5180d09880b8acb1e51d577d8437cc9453979 Also, repair weapon count show in ammo menu diff -r 27b5180d0988 -r 9a82149409f3 hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Sun Apr 13 13:57:32 2008 +0000 +++ b/hedgewars/uConsts.pas Sun Apr 13 14:06:17 2008 +0000 @@ -775,6 +775,8 @@ PosCount: 1; PosSprite: sprWater)); +var CountTexz: array[1..9] of PTexture; + implementation end. diff -r 27b5180d0988 -r 9a82149409f3 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sun Apr 13 13:57:32 2008 +0000 +++ b/hedgewars/uStore.pas Sun Apr 13 14:06:17 2008 +0000 @@ -116,11 +116,7 @@ end; procedure StoreLoad; -var ii: TSprite; - fi: THWFont; - ai: TAmmoType; - s: string; - tmpsurf: PSDL_Surface; +var s: string; procedure WriteNames(Font: THWFont); var t: LongInt; @@ -163,7 +159,6 @@ procedure MakeCrossHairs; var t: LongInt; tmpsurf, texsurf: PSDL_Surface; - s: string; Color, i: Longword; begin s:= Pathz[ptGraphics] + '/' + cCHFileName; @@ -249,6 +244,11 @@ $FF000000 end; +var ii: TSprite; + fi: THWFont; + ai: TAmmoType; + tmpsurf: PSDL_Surface; + i: LongInt; begin for fi:= Low(THWFont) to High(THWFont) do with Fontz[fi] do @@ -304,6 +304,13 @@ SDL_FreeSurface(tmpsurf) end; +for i:= Low(CountTexz) to High(CountTexz) do + begin + tmpsurf:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(IntToStr(i) + 'x'), $FFFFFF); + CountTexz[i]:= Surface2Tex(tmpsurf); + SDL_FreeSurface(tmpsurf) + end; + {$IFDEF DUMP} SDL_SaveBMP_RW(LandSurface, SDL_RWFromFile('LandSurface.bmp', 'wb'), 1); SDL_SaveBMP_RW(StoreSurface, SDL_RWFromFile('StoreSurface.bmp', 'wb'), 1); diff -r 27b5180d0988 -r 9a82149409f3 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sun Apr 13 13:57:32 2008 +0000 +++ b/hedgewars/uWorld.pas Sun Apr 13 14:06:17 2008 +0000 @@ -134,7 +134,7 @@ begin DrawTexture(AMxCurr + 10, cScreenHeight - 68, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex); if Ammo^[Slot, Pos].Count < 10 then - //DXOutText(AMxCurr + 175, cScreenHeight - 68, fnt16, chr(Ammo^[Slot, Pos].Count + 48) + 'x', Surface); + DrawTexture(AMxCurr + 175, cScreenHeight - 68, CountTexz[Ammo^[Slot, Pos].Count]); if bSelected then begin bShowAmmoMenu:= false;