aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/MacOSX/Wrapper/MacClasses.pas
diff options
context:
space:
mode:
authoreddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-29 21:40:14 +0000
committereddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-29 21:40:14 +0000
commit52eeec05d021df5334934f50dfafff981cbca33b (patch)
treea5f459e4b3065312820250e6c4ecbc1c7fcc6e0d /Game/Code/MacOSX/Wrapper/MacClasses.pas
parente779d4f8a8ca13215895338f71e6929dc795cf60 (diff)
downloadusdx-52eeec05d021df5334934f50dfafff981cbca33b.tar.gz
usdx-52eeec05d021df5334934f50dfafff981cbca33b.tar.xz
usdx-52eeec05d021df5334934f50dfafff981cbca33b.zip
Just adding first MacOSX version. This does not compile yet.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@540 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rwxr-xr-xGame/Code/MacOSX/Wrapper/MacClasses.pas57
1 files changed, 57 insertions, 0 deletions
diff --git a/Game/Code/MacOSX/Wrapper/MacClasses.pas b/Game/Code/MacOSX/Wrapper/MacClasses.pas
new file mode 100755
index 00000000..c494e6df
--- /dev/null
+++ b/Game/Code/MacOSX/Wrapper/MacClasses.pas
@@ -0,0 +1,57 @@
+unit MacClasses;
+
+{$INCLUDE ../Platform.inc}
+
+interface
+
+uses
+ Classes, GlueWindows, SysUtils;
+
+type
+
+ TMemoryStream = Classes.TMemoryStream;
+
+ TResourceStream = class(TFileStream)
+ private
+ public
+ constructor Create(Instance: THandle; const ResName: string; ResType: PChar);
+ end;
+
+{$IFDEF MACOS}
+ TWndMethod = procedure of object;
+{$ENDIF}
+
+ function AllocateHWnd(Method: TWndMethod): HWND;
+
+implementation
+
+uses UPliki;
+
+{ TResourceStream }
+
+constructor TResourceStream.Create(Instance: THandle; const ResName: string; ResType: PChar);
+var
+ sFileName : String;
+begin
+ if ResType = 'FNT' then
+ sFileName := GetResourcesPath + 'Fonts/' + ResName + '.dat'
+ else
+ sFileName := GetResourcesPath + 'Fonts/' + ResName + '.' + ResType;
+
+ if FileExists(sFileName) then
+ inherited Create( sFileName, fmOpenReadWrite)
+ else
+ inherited Create( sFileName, fmCreate);
+end;
+
+function AllocateHWnd(Method: TWndMethod): HWND;
+begin
+{$IFDEF MSWINDOWS}
+ Result := Classes.AllocateHWnd(Method);
+{$ENDIF}
+{$IFDEF MACOS}
+ Result := 0;
+{$ENDIF}
+end;
+
+end.