# HG changeset patch # User sheepluva # Date 1418839413 -3600 # Node ID 692649e341fc60bfc39b20a4aa3a35ea57888479 # Parent 9459c45b519027e8b919d2cde348ca194b4bf125 change string types of speech bubbles fix to work with pas2c diff -r 9459c45b5190 -r 692649e341fc hedgewars/uRenderUtils.pas --- a/hedgewars/uRenderUtils.pas Wed Dec 17 19:02:33 2014 +0100 +++ b/hedgewars/uRenderUtils.pas Wed Dec 17 19:03:33 2014 +0100 @@ -304,14 +304,14 @@ end; end; -function GetNextSpeechLine(s: ansistring; ldelim: char; var startFrom: LongInt; out substr: shortstring): boolean; +function GetNextSpeechLine(s: ansistring; ldelim: char; var startFrom: LongInt; out substr: ansistring): boolean; var p, l, m, r: Integer; newl : boolean; c : char; begin m:= Length(s); - SetLength(substr, m); + SetLengthA(substr, m); // number of chars read r:= 0; @@ -340,7 +340,7 @@ inc(startFrom, r); - SetLength(substr, l); + SetLengthA(substr, l); GetNextSpeechLine:= (l > 0); end; @@ -352,7 +352,7 @@ {$IFNDEF PAS2C} chars: set of char = [#9,' ',';',':','?','!',',']; {$ENDIF} - substr: shortstring; + substr: ansistring; edge, corner, tail: TSPrite; begin if cOnlyStats then exit(nil); @@ -408,7 +408,7 @@ begin inc(numLines); i:= 0; j:= 0; - TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(substr), @i, @j); + TTF_SizeUTF8(Fontz[font].Handle, PChar(substr), @i, @j); if i > w then w:= i; end; @@ -509,7 +509,7 @@ pos:= 1; line:= 0; while GetNextSpeechLine(s, #1, pos, substr) do begin - tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(substr), cNearBlackColorChannels); + tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(substr), cNearBlackColorChannels); rect.x:= edgeHeight + 1 + ((i - w) div 2); // trying to more evenly position the text, vertically rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h;