X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fengine%2Fe_graphics.pas;h=b1d34101d44014c5ab06d3aa6b96dcfc32d94863;hp=d0f967230f0c31c94f7e575f926414ed9927bc72;hb=a49e32f2040ac79644fabdfa629cd4fd4750c515;hpb=f0703eae1c66566c95d11bf44ff4560be416b971 diff --git a/src/engine/e_graphics.pas b/src/engine/e_graphics.pas index d0f9672..b1d3410 100644 --- a/src/engine/e_graphics.pas +++ b/src/engine/e_graphics.pas @@ -115,7 +115,8 @@ procedure e_TextureFontKill(FontID: DWORD); procedure e_TextureFontPrint(X, Y: GLint; Text: string; FontID: DWORD); procedure e_TextureFontPrintEx(X, Y: GLint; Text: string; FontID: DWORD; Red, Green, Blue: Byte; Scale: Single; Shadow: Boolean = False); -procedure e_TextureFontPrintFmt(X, Y: GLint; Text: string; FontID: DWORD; Shadow: Boolean = False); +procedure e_TextureFontPrintFmt(X, Y: GLint; Text: string; FontID: DWORD; + Shadow: Boolean = False; Newlines: Boolean = False); procedure e_TextureFontGetSize(ID: DWORD; out CharWidth, CharHeight: Byte); procedure e_RemoveAllTextureFont(); @@ -1685,11 +1686,12 @@ begin result := e_TextureFonts[FontID].CharWidth; end; -procedure e_TextureFontPrintFmt(X, Y: GLint; Text: string; FontID: DWORD; Shadow: Boolean = False); +procedure e_TextureFontPrintFmt(X, Y: GLint; Text: string; FontID: DWORD; + Shadow: Boolean = False; Newlines: Boolean = False); var a, TX, TY, len: Integer; tc, c: TRGB; - w: Word; + w, h: Word; begin if e_NoGraphics then Exit; if Text = '' then Exit; @@ -1705,6 +1707,7 @@ begin len := Length(Text); w := e_TextureFonts[FontID].CharWidth; + h := e_TextureFonts[FontID].CharHeight; with e_TextureFonts[FontID] do begin @@ -1721,12 +1724,15 @@ begin for a := 1 to len do begin case Text[a] of - {#10: // line feed + #10: // line feed begin - TX := X; - TY := TY + h; - continue; - end;} + if Newlines then + begin + TX := X; + TY := TY + h; + continue; + end; + end; #1: // black begin c.R := 0; c.G := 0; c.B := 0;