Commit 90b48c2

Nick committed on
Adding some ifdef crap to load Pixelite
commit 90b48c234d5a50af8ad94e804c3ee3100f94208c parent 067a7be
2 changed files +25−3
ModifiedGBEmu.lpr +21−0
@@ -3,6 +3,18 @@ program GBEmu;
3 {$MODE Delphi} 3 {$MODE Delphi}
4 4
5 uses 5 uses
6 {$ifdef MSWINDOWS}
7 windows,
8 {$endif}
9
10 {$ifdef UNIX}
11 // font includes here
12 {$endif}
13
14 {$ifdef DARWIN}
15 // font includes here
16 {$endif}
17
6 {$ifdef unix} 18 {$ifdef unix}
7 cthreads, 19 cthreads,
8 cmem, // the c memory manager is on some systems much faster for multi-threading 20 cmem, // the c memory manager is on some systems much faster for multi-threading
@@ -21,6 +33,15 @@ uses
21 {$R *.res} 33 {$R *.res}
22 34
23 begin 35 begin
36 { Before the LCL starts, embed Pixelite so users dont have to install it.
37 Unfortunately there isn't really a cross-platform way to do it, so here's an
38 ifdef mess. }
39
40 {$ifdef MSWINDOWS}
41 if AddFontResource('PixeliteTTF.ttf') = 0 then
42 Writeln(StdErr, 'Couldn''t load Pixelite!!!');
43 {$endif}
44
24 Application.Scaled:=True; 45 Application.Scaled:=True;
25 Application.Title:='hUGETracker'; 46 Application.Title:='hUGETracker';
26 Application.Initialize; 47 Application.Initialize;
Modifiedtracker.pas +4−3
@@ -886,9 +886,10 @@ var
886 Stream: TStream; 886 Stream: TStream;
887 begin 887 begin
888 if Screen.Fonts.IndexOf('Pixelite') < 0 then 888 if Screen.Fonts.IndexOf('Pixelite') < 0 then
889 MessageDlg('Warning', 'You don''t have the Pixelite .FON file installed, '+ 889 MessageDlg('Warning', 'You don''t have the Pixelite .TTF file in the same '+
890 'which means the tracker view will be messed up. Please install the font and restart!', 890 'directory as the program, which means you likely didn''t extract the program before running.'+
891 mtWarning, [mbOk], 0); 891 LineEnding+LineEnding+'Please extract, and restart!',
892 mtWarning, [mbOk], 0);
892 893
893 ReturnNilIfGrowHeapFails := False; 894 ReturnNilIfGrowHeapFails := False;
894 PreviewingInstrument := -1; 895 PreviewingInstrument := -1;