hedgewars/uStore.pas
changeset 10127 7f29a65aa1e4
parent 10123 64e72781d344
child 10128 0f6878b5395a
equal deleted inserted replaced
10126:2fa3bb7785ee 10127:7f29a65aa1e4
   183 md:= 0;
   183 md:= 0;
   184 {$ENDIF}
   184 {$ENDIF}
   185 for t:= 0 to Pred(TeamsCount) do
   185 for t:= 0 to Pred(TeamsCount) do
   186     with TeamsArray[t]^ do
   186     with TeamsArray[t]^ do
   187         begin
   187         begin
   188         NameTagTex:= RenderStringTexLim(TeamName, Clan^.Color, Font, cTeamHealthWidth);
   188         NameTagTex:= RenderStringTexLim(ansistring(TeamName), Clan^.Color, Font, cTeamHealthWidth);
   189         if length(Owner) > 0 then
   189         if length(Owner) > 0 then
   190             OwnerTex:= RenderStringTexLim(Owner, Clan^.Color, Font, cTeamHealthWidth);
   190             OwnerTex:= RenderStringTexLim(ansistring(Owner), Clan^.Color, Font, cTeamHealthWidth);
   191 
   191 
   192         r.x:= 0;
   192         r.x:= 0;
   193         r.y:= 0;
   193         r.y:= 0;
   194         r.w:= 32;
   194         r.w:= 32;
   195         r.h:= 32;
   195         r.h:= 32;
   251 
   251 
   252         FlagTex:= Surface2Tex(texsurf, false);
   252         FlagTex:= Surface2Tex(texsurf, false);
   253         SDL_FreeSurface(texsurf);
   253         SDL_FreeSurface(texsurf);
   254         texsurf:= nil;
   254         texsurf:= nil;
   255 
   255 
   256         AIKillsTex := RenderStringTex(inttostr(stats.AIKills), Clan^.Color, fnt16);
   256         AIKillsTex := RenderStringTex(ansistring(inttostr(stats.AIKills)), Clan^.Color, fnt16);
   257 
   257 
   258         dec(drY, r.h + 2);
   258         dec(drY, r.h + 2);
   259         DrawHealthY:= drY;
   259         DrawHealthY:= drY;
   260         for i:= 0 to cMaxHHIndex do
   260         for i:= 0 to cMaxHHIndex do
   261             with Hedgehogs[i] do
   261             with Hedgehogs[i] do
   262                 if Gear <> nil then
   262                 if Gear <> nil then
   263                     begin
   263                     begin
   264                     NameTagTex:= RenderStringTexLim(Name, Clan^.Color, fnt16, cTeamHealthWidth);
   264                     NameTagTex:= RenderStringTexLim(ansistring(Name), Clan^.Color, fnt16, cTeamHealthWidth);
   265                     if Hat = 'NoHat' then
   265                     if Hat = 'NoHat' then
   266                         begin
   266                         begin
   267                         if (month = 4) and (md = 20) then
   267                         if (month = 4) and (md = 20) then
   268                             Hat := 'eastertop'   // Easter
   268                             Hat := 'eastertop'   // Easter
   269                         else if (month = 12) and ((md = 24) or (md = 25) or (md = 26)) then
   269                         else if (month = 12) and ((md = 24) or (md = 25) or (md = 26)) then
   449 // name of weapons in ammo menu
   449 // name of weapons in ammo menu
   450 for ai:= Low(TAmmoType) to High(TAmmoType) do
   450 for ai:= Low(TAmmoType) to High(TAmmoType) do
   451     with Ammoz[ai] do
   451     with Ammoz[ai] do
   452         begin
   452         begin
   453         TryDo(length(trAmmo[NameId]) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ai)) + '!',true);
   453         TryDo(length(trAmmo[NameId]) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ai)) + '!',true);
   454         tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(trAmmo[NameId],fnt16)].Handle, Str2PChar(trAmmo[NameId]), cWhiteColorChannels);
   454         tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(trAmmo[NameId],fnt16)].Handle, PChar(trAmmo[NameId]), cWhiteColorChannels);
   455         TryDo(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ai)) + ' failed!',true);
   455         TryDo(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ai)) + ' failed!',true);
   456         tmpsurf:= doSurfaceConversion(tmpsurf);
   456         tmpsurf:= doSurfaceConversion(tmpsurf);
   457         FreeTexture(NameTex);
   457         FreeTexture(NameTex);
   458         NameTex:= Surface2Tex(tmpsurf, false);
   458         NameTex:= Surface2Tex(tmpsurf, false);
   459         SDL_FreeSurface(tmpsurf)
   459         SDL_FreeSurface(tmpsurf)
   583 procedure RenderHealth(var Hedgehog: THedgehog);
   583 procedure RenderHealth(var Hedgehog: THedgehog);
   584 var s: shortstring;
   584 var s: shortstring;
   585 begin
   585 begin
   586 str(Hedgehog.Gear^.Health, s);
   586 str(Hedgehog.Gear^.Health, s);
   587 FreeTexture(Hedgehog.HealthTagTex);
   587 FreeTexture(Hedgehog.HealthTagTex);
   588 Hedgehog.HealthTagTex:= RenderStringTex(s, Hedgehog.Team^.Clan^.Color, fnt16)
   588 Hedgehog.HealthTagTex:= RenderStringTex(ansistring(s), Hedgehog.Team^.Clan^.Color, fnt16)
   589 end;
   589 end;
   590 
   590 
   591 function LoadImage(const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
   591 function LoadImage(const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
   592 var tmpsurf: PSDL_Surface;
   592 var tmpsurf: PSDL_Surface;
   593     s: shortstring;
   593     s: shortstring;
   838 {$ENDIF}
   838 {$ENDIF}
   839 
   839 
   840 procedure SetupOpenGL;
   840 procedure SetupOpenGL;
   841 var buf: array[byte] of char;
   841 var buf: array[byte] of char;
   842     AuxBufNum: LongInt = 0;
   842     AuxBufNum: LongInt = 0;
   843     tmpstr: AnsiString;
   843     tmpstr: ansistring;
   844     tmpint: LongInt;
   844     tmpint: LongInt;
   845     tmpn: LongInt;
   845     tmpn: LongInt;
   846 begin
   846 begin
   847 
   847 
   848 {$IFDEF SDL2}
   848 {$IFDEF SDL2}