aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Menu/UMenuText.pas
diff options
context:
space:
mode:
authoreddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-01 19:34:40 +0000
committereddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-01 19:34:40 +0000
commit391d30716d48dc709f6444b19c008e82311623b9 (patch)
treee922181e99262c06e6d48a6df5cda71a2338e0bd /Game/Code/Menu/UMenuText.pas
parent39c1fdef33f512a36334e689e38b90cfe4aceb82 (diff)
downloadusdx-391d30716d48dc709f6444b19c008e82311623b9.tar.gz
usdx-391d30716d48dc709f6444b19c008e82311623b9.tar.xz
usdx-391d30716d48dc709f6444b19c008e82311623b9.zip
Mac OS X version compiles and links. I hope I didn't break too many files on windows/linux.
Added switches.inc to all files. Changed many IFDEFs. For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is also used by the Mac port. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Menu/UMenuText.pas')
-rw-r--r--Game/Code/Menu/UMenuText.pas37
1 files changed, 34 insertions, 3 deletions
diff --git a/Game/Code/Menu/UMenuText.pas b/Game/Code/Menu/UMenuText.pas
index 19adef03..350c28de 100644
--- a/Game/Code/Menu/UMenuText.pas
+++ b/Game/Code/Menu/UMenuText.pas
@@ -2,9 +2,7 @@ unit UMenuText;
interface
-{$IFDEF FPC}
- {$MODE Delphi}
-{$ENDIF}
+{$I switches.inc}
uses TextGL,
UTexture,
@@ -61,6 +59,39 @@ uses UGraphic,
{$ENDIF}
StrUtils;
+{$IFDEF DARWIN}
+function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;
+var
+ I,X: Integer;
+ Len, LenSubStr: Integer;
+begin
+ if Offset = 1 then
+ Result := Pos(SubStr, S)
+ else
+ begin
+ I := Offset;
+ LenSubStr := Length(SubStr);
+ Len := Length(S) - LenSubStr + 1;
+ while I <= Len do
+ begin
+ if S[I] = SubStr[1] then
+ begin
+ X := 1;
+ while (X < LenSubStr) and (S[I + X] = SubStr[X + 1]) do
+ Inc(X);
+ if (X = LenSubStr) then
+ begin
+ Result := I;
+ exit;
+ end;
+ end;
+ Inc(I);
+ end;
+ Result := 0;
+ end;
+end;
+{$ENDIF}
+
procedure TText.SetSelect(Value: Boolean);
begin
SelectBool := Value;