From 62c82114318ed04ce42617fa9ce2e179834dbda4 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 19 Sep 2007 11:44:10 +0000 Subject: added UCommon ( in classes ) for lazarus... common functions needed for lazarus ( and others ) can be put in here. also this now compiles on lazarus.. ( dosnt link yet... but I dont get any critical compiler errors ) tested to compile in my delphi, and basic functionality is fine. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@395 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UMusic.pas | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'Game/Code/Classes/UMusic.pas') diff --git a/Game/Code/Classes/UMusic.pas b/Game/Code/Classes/UMusic.pas index f9c6457d..be585ee1 100644 --- a/Game/Code/Classes/UMusic.pas +++ b/Game/Code/Classes/UMusic.pas @@ -2,6 +2,11 @@ unit UMusic; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + + uses Classes, Windows, Messages, @@ -180,7 +185,14 @@ const ModeStr: array[TMPModes] of string = ('Not ready', 'Stopped', 'Playing', 'Recording', 'Seeking', 'Paused', 'Open'); implementation -uses UGraphic, URecord, UFiles, UIni, UMain, UThemes; + +uses UCommon, + UGraphic, + URecord, + UFiles, + UIni, + UMain, + UThemes; procedure InitializeSound; begin @@ -195,12 +207,18 @@ var begin Log.BenchmarkStart(4); Log.LogStatus('Initializing Playback Subsystem', 'Music Initialize'); + Loaded := false; - Loop := false; - fHWND := AllocateHWND( nil); + Loop := false; + + fHWND := AllocateHWND( nil); // TODO : JB - can we do something different here ?? lazarus didnt like this function - if not BASS_Init(1, 44100, 0, fHWND, nil) then begin + if not BASS_Init(1, 44100, 0, fHWND, nil) then + begin + {$IFNDEF FPC} + // TODO : JB find a way to do this nice.. Application.MessageBox ('Could not initialize BASS', 'Error'); + {$ENDIF} Exit; end; -- cgit v1.2.3