hedgewars/uStore.pas
changeset 2670 1b327b7515ed
parent 2669 4eec706e86b0
child 2671 7e0f88013fe8
equal deleted inserted replaced
2669:4eec706e86b0 2670:1b327b7515ed
   121 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
   121 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
   122 Result.x:= X;
   122 Result.x:= X;
   123 Result.y:= Y;
   123 Result.y:= Y;
   124 Result.w:= w + FontBorder * 2 + 4;
   124 Result.w:= w + FontBorder * 2 + 4;
   125 Result.h:= h + FontBorder * 2;
   125 Result.h:= h + FontBorder * 2;
   126 DrawRoundRect(@Result, cWhiteColor, cNearBlackColorChannels.value, Surface, true);
   126 DrawRoundRect(@Result, cWhiteColor, endian(cNearBlackColorChannels.value), Surface, true);
   127 clr.r:= Color shr 16;
   127 clr.r:= (Color shr 16) and $FF;
   128 clr.g:= (Color shr 8) and $FF;
   128 clr.g:= (Color shr 8) and $FF;
   129 clr.b:= Color and $FF;
   129 clr.b:= Color and $FF;
   130 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr);
   130 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr);
   131 tmpsurf:= doSurfaceConversion(tmpsurf);
       
   132 Result.x:= X + FontBorder + 2;
   131 Result.x:= X + FontBorder + 2;
   133 Result.y:= Y + FontBorder;
   132 Result.y:= Y + FontBorder;
   134 SDLTry(tmpsurf <> nil, true);
   133 SDLTry(tmpsurf <> nil, true);
   135 SDL_UpperBlit(tmpsurf, nil, Surface, @Result);
   134 SDL_UpperBlit(tmpsurf, nil, Surface, @Result);
   136 SDL_FreeSurface(tmpsurf);
   135 SDL_FreeSurface(tmpsurf);
   335 ConfirmTexture:= RenderStringTex(trmsg[sidConfirm], cYellowColor, fntBig);
   334 ConfirmTexture:= RenderStringTex(trmsg[sidConfirm], cYellowColor, fntBig);
   336 SyncTexture:= RenderStringTex(trmsg[sidSync], cYellowColor, fntBig);
   335 SyncTexture:= RenderStringTex(trmsg[sidSync], cYellowColor, fntBig);
   337 
   336 
   338 AddProgress;
   337 AddProgress;
   339 
   338 
       
   339 // name of weapons in ammo menu
   340 for ai:= Low(TAmmoType) to High(TAmmoType) do
   340 for ai:= Low(TAmmoType) to High(TAmmoType) do
   341 	with Ammoz[ai] do
   341 	with Ammoz[ai] do
   342 		begin
   342 		begin
   343 		tmpsurf:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(trAmmo[NameId]), cWhiteColorChannels);
   343 		tmpsurf:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(trAmmo[NameId]), cWhiteColorChannels);
       
   344 		tmpsurf:= doSurfaceConversion(tmpsurf);
   344 		NameTex:= Surface2Tex(tmpsurf, false);
   345 		NameTex:= Surface2Tex(tmpsurf, false);
   345 		SDL_FreeSurface(tmpsurf)
   346 		SDL_FreeSurface(tmpsurf)
   346 		end;
   347 		end;
   347 
   348 
       
   349 // number of weapons in ammo menu
   348 for i:= Low(CountTexz) to High(CountTexz) do
   350 for i:= Low(CountTexz) to High(CountTexz) do
   349 	begin
   351 	begin
   350 	tmpsurf:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(IntToStr(i) + 'x'), cWhiteColorChannels);
   352 	tmpsurf:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(IntToStr(i) + 'x'), cWhiteColorChannels);
       
   353 	tmpsurf:= doSurfaceConversion(tmpsurf);
   351 	CountTexz[i]:= Surface2Tex(tmpsurf, false);
   354 	CountTexz[i]:= Surface2Tex(tmpsurf, false);
   352 	SDL_FreeSurface(tmpsurf)
   355 	SDL_FreeSurface(tmpsurf)
   353 	end;
   356 	end;
   354 
   357 
   355 {$IFDEF DUMP}
   358 {$IFDEF DUMP}