From cf4e5393ccee3af7d592c680ecf7c22f7bc4a4be Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 28 Oct 2008 19:01:20 +0000 Subject: - glPrint(Pchar) -> glPrint(string) - glPrintLetter removed git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1483 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/TextGL.pas | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/base/TextGL.pas b/src/base/TextGL.pas index ad4c0ee2..57f3d6f5 100644 --- a/src/base/TextGL.pas +++ b/src/base/TextGL.pas @@ -41,9 +41,8 @@ uses procedure BuildFont; // build our bitmap font procedure KillFont; // delete the font -function glTextWidth(text: PChar): real; // returns text width -procedure glPrintLetter(letter: char); -procedure glPrint(text: pchar); // custom GL "Print" routine +function glTextWidth(const text: string): real; // returns text width +procedure glPrint(const text: string); // custom GL "Print" routine procedure ResetFont(); // reset font settings of active font procedure SetFontPos(X, Y: real); // sets X and Y procedure SetFontZ(Z: real); // sets Z @@ -205,7 +204,7 @@ begin //glDeleteLists(..., 256); end; -function glTextWidth(text: pchar): real; +function glTextWidth(const text: string): real; var Letter: char; i: integer; @@ -321,18 +320,18 @@ begin end; // Custom GL "Print" Routine -procedure glPrint(Text: PChar); +procedure glPrint(const Text: string); var Pos: integer; begin // if there is no text do nothing - if ((Text = nil) or (Text = '')) then + if (Text = '') then Exit; //Save the actual color and alpha (for reflection) glGetFloatv(GL_CURRENT_COLOR, @TempColor); - for Pos := 0 to Length(Text) - 1 do + for Pos := 1 to Length(Text) do begin glPrintLetter(Text[Pos]); end; -- cgit v1.2.3