hedgewars/uStore.pas
changeset 785 ac538f1a629e
parent 780 f45b0e513dfd
child 806 d397c502a5dd
equal deleted inserted replaced
784:b203147d91b5 785:ac538f1a629e
   491 glVertex2i(32 + X, 32 + Y);
   491 glVertex2i(32 + X, 32 + Y);
   492 
   492 
   493 glTexCoord2f(l, b);
   493 glTexCoord2f(l, b);
   494 glVertex2i(X, 32 + Y);
   494 glVertex2i(X, 32 + Y);
   495 
   495 
   496 glEnd();
   496 glEnd()
   497 
       
   498 end;
   497 end;
   499 
   498 
   500 procedure StoreRelease;
   499 procedure StoreRelease;
   501 var ii: TSprite;
   500 var ii: TSprite;
   502 begin
   501 begin
   515 function  RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture;
   514 function  RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture;
   516 var w, h: LongInt;
   515 var w, h: LongInt;
   517     Result: PSDL_Surface;
   516     Result: PSDL_Surface;
   518 begin
   517 begin
   519 TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), w, h);
   518 TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), w, h);
       
   519 
   520 Result:= SDL_CreateRGBSurface(SDL_SWSURFACE, w + FontBorder * 2 + 4, h + FontBorder * 2,
   520 Result:= SDL_CreateRGBSurface(SDL_SWSURFACE, w + FontBorder * 2 + 4, h + FontBorder * 2,
   521          32, RMask, GMask, BMask, AMask);
   521          32, RMask, GMask, BMask, AMask);
       
   522 
   522 TryDo(Result <> nil, 'RenderString: fail to create surface', true);
   523 TryDo(Result <> nil, 'RenderString: fail to create surface', true);
       
   524 
   523 WriteInRoundRect(Result, 0, 0, Color, font, s);
   525 WriteInRoundRect(Result, 0, 0, Color, font, s);
       
   526 
   524 TryDo(SDL_SetColorKey(Result, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   527 TryDo(SDL_SetColorKey(Result, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
       
   528 
   525 RenderStringTex:= Surface2Tex(Result);
   529 RenderStringTex:= Surface2Tex(Result);
       
   530 
   526 SDL_FreeSurface(Result)
   531 SDL_FreeSurface(Result)
   527 end;
   532 end;
   528 
   533 
   529 procedure RenderHealth(var Hedgehog: THedgehog);
   534 procedure RenderHealth(var Hedgehog: THedgehog);
   530 var s: shortstring;
   535 var s: shortstring;