hedgewars/uRenderUtils.pas
changeset 10107 dd6541ba745e
parent 10106 4020864e3d79
child 10108 c68cf030eded
equal deleted inserted replaced
10106:4020864e3d79 10107:dd6541ba745e
   281 
   281 
   282 function RenderStringTexLim(s: PChar; Color: Longword; font: THWFont; maxLength: LongWord): PTexture;
   282 function RenderStringTexLim(s: PChar; Color: Longword; font: THWFont; maxLength: LongWord): PTexture;
   283 var w, h: LongInt;
   283 var w, h: LongInt;
   284     finalSurface: PSDL_Surface;
   284     finalSurface: PSDL_Surface;
   285 begin
   285 begin
   286     if s[0] = #0 then s:= Str2PChar(''); // conversion because pas2c ain't smart enough yet;
   286     if s[0] = #0 then s:= Str2PChar(' '); // conversion because pas2c ain't smart enough yet;
   287     font:= CheckCJKFont(s, font);
   287     font:= CheckCJKFont(s, font);
   288     w:= 0; h:= 0; // avoid compiler hints
   288     w:= 0; h:= 0; // avoid compiler hints
   289     TTF_SizeUTF8(Fontz[font].Handle, s, @w, @h);
   289     TTF_SizeUTF8(Fontz[font].Handle, s, @w, @h);
   290     if (maxLength <> 0) and (w > maxLength) then w := maxLength;
   290     if (maxLength <> 0) and (w > maxLength) then w := maxLength;
   291 
   291