Skip to content

Commit

Permalink
Adding some ifdef crap to load Pixelite
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDisk committed Jan 12, 2020
1 parent 067a7be commit 90b48c2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
21 changes: 21 additions & 0 deletions GBEmu.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
{$MODE Delphi}

uses
{$ifdef MSWINDOWS}
windows,
{$endif}

{$ifdef UNIX}
// font includes here
{$endif}

{$ifdef DARWIN}
// font includes here
{$endif}

{$ifdef unix}
cthreads,
cmem, // the c memory manager is on some systems much faster for multi-threading
Expand All @@ -21,6 +33,15 @@
{$R *.res}

begin
{ Before the LCL starts, embed Pixelite so users dont have to install it.
Unfortunately there isn't really a cross-platform way to do it, so here's an
ifdef mess. }

{$ifdef MSWINDOWS}
if AddFontResource('PixeliteTTF.ttf') = 0 then
Writeln(StdErr, 'Couldn''t load Pixelite!!!');
{$endif}

Application.Scaled:=True;
Application.Title:='hUGETracker';
Application.Initialize;
Expand Down
7 changes: 4 additions & 3 deletions tracker.pas
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,10 @@ procedure TfrmTracker.FormCreate(Sender: TObject);
Stream: TStream;
begin
if Screen.Fonts.IndexOf('Pixelite') < 0 then
MessageDlg('Warning', 'You don''t have the Pixelite .FON file installed, '+
'which means the tracker view will be messed up. Please install the font and restart!',
mtWarning, [mbOk], 0);
MessageDlg('Warning', 'You don''t have the Pixelite .TTF file in the same '+
'directory as the program, which means you likely didn''t extract the program before running.'+
LineEnding+LineEnding+'Please extract, and restart!',
mtWarning, [mbOk], 0);

ReturnNilIfGrowHeapFails := False;
PreviewingInstrument := -1;
Expand Down

0 comments on commit 90b48c2

Please sign in to comment.