and while we are giving SDLh.pas all this love, let's fix the signature of one SDL_ttf calls
--- a/hedgewars/SDLh.pas Sat Nov 05 06:02:32 2011 +0100
+++ b/hedgewars/SDLh.pas Sat Nov 05 06:06:04 2011 +0100
@@ -919,7 +919,7 @@
function TTF_Init: LongInt; cdecl; external SDL_TTFLibName;
procedure TTF_Quit; cdecl; external SDL_TTFLibName;
-function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; out w, h: LongInt): LongInt; cdecl; external SDL_TTFLibName;
+function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; w, h: PLongInt): LongInt; cdecl; external SDL_TTFLibName;
function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName;
function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName;
--- a/hedgewars/uChat.pas Sat Nov 05 06:02:32 2011 +0100
+++ b/hedgewars/uChat.pas Sat Nov 05 06:06:04 2011 +0100
@@ -84,7 +84,7 @@
font:= CheckCJKFont(str, fnt16);
w:= 0; h:= 0; // avoid compiler hints
-TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(str), w, h);
+TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(str), @w, @h);
resSurface:= SDL_CreateRGBSurface(0, toPowerOf2(w), toPowerOf2(h), 32, RMask, GMask, BMask, AMask);
--- a/hedgewars/uRenderUtils.pas Sat Nov 05 06:02:32 2011 +0100
+++ b/hedgewars/uRenderUtils.pas Sat Nov 05 06:06:04 2011 +0100
@@ -68,7 +68,7 @@
clr: TSDL_Color;
finalRect: TSDL_Rect;
begin
- TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
+ TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), @w, @h);
finalRect.x:= X;
finalRect.y:= Y;
finalRect.w:= w + FontBorder * 2 + 4;
@@ -173,7 +173,7 @@
if length(s) = 0 then s:= ' ';
font:= CheckCJKFont(s, font);
w:= 0; h:= 0; // avoid compiler hints
- TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), w, h);
+ TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), @w, @h);
finalSurface:= SDL_CreateRGBSurface(SDL_SWSURFACE, w + FontBorder * 2 + 4, h + FontBorder * 2,
32, RMask, GMask, BMask, AMask);
@@ -229,7 +229,7 @@
if length(s) = 0 then s:= '...';
font:= CheckCJKFont(s, font);
w:= 0; h:= 0; // avoid compiler hints
- TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), w, h);
+ TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), @w, @h);
if w<8 then w:= 8;
j:= 0;
if (length(s) > 20) then
@@ -248,7 +248,7 @@
while s[prevpos+1] = ' ' do inc(prevpos);
substr:= copy(s, prevpos+1, pos-prevpos-1);
i:= 0; j:= 0;
- TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(substr), i, j);
+ TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(substr), @i, @j);
if i > w then w:= i;
prevpos:= pos;
end;
--- a/hedgewars/uStore.pas Sat Nov 05 06:02:32 2011 +0100
+++ b/hedgewars/uStore.pas Sat Nov 05 06:06:04 2011 +0100
@@ -56,7 +56,7 @@
finalRect: TSDL_Rect;
begin
w:= 0; h:= 0; // avoid compiler hints
-TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h);
+TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), @w, @h);
finalRect.x:= X + FontBorder + 2;
finalRect.y:= Y + FontBorder;
finalRect.w:= w + FontBorder * 2 + 4;
@@ -796,13 +796,13 @@
// TODO: Recheck height/position calculation
// get caption's dimensions
-TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(caption), i, j);
+TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(caption), @i, @j);
// width adds 36 px (image + space)
w:= i + 36 + wa;
h:= j + ha;
// get sub caption's dimensions
-TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(subcaption), i, j);
+TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(subcaption), @i, @j);
// width adds 36 px (image + space)
if w < (i + 36 + wa) then w:= i + 36 + wa;
inc(h, j + ha);
@@ -815,7 +815,7 @@
SplitByChar(tmpline, tmpdesc, '|');
if tmpline <> '' then
begin
- TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(tmpline), i, j);
+ TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(tmpline), @i, @j);
if w < (i + wa) then w:= i + wa;
inc(h, j + ha)
end
@@ -824,7 +824,7 @@
if extra <> '' then
begin
// get extra label's dimensions
- TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(extra), i, j);
+ TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(extra), @i, @j);
if w < (i + wa) then w:= i + wa;
inc(h, j + ha);
end;