hedgewars/uRenderUtils.pas
changeset 10106 4020864e3d79
parent 10105 8c5fa1d15bd5
child 10107 dd6541ba745e
equal deleted inserted replaced
10105:8c5fa1d15bd5 10106:4020864e3d79
   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 StrLength(s) = 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