Subversion Repositories spacemission

Rev

Rev 25 | Rev 40 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. program SpaceMission;
  2.  
  3. uses
  4.   Windows,
  5.   {$IF CompilerVersion >= 23.0}System.UITypes,{$IFEND}
  6.   Forms,
  7.   Dialogs,
  8.   SysUtils,
  9.   GamMain in 'GamMain.pas' {MainForm},
  10.   GamSplash in 'GamSplash.pas' {SplashForm},
  11.   GamSpeicherung in 'GamSpeicherung.pas' {SpeicherungForm},
  12.   ComInfo in 'ComInfo.pas' {InfoForm},
  13.   GamCheat in 'GamCheat.pas' {CheatForm},
  14.   ComLevelReader in 'ComLevelReader.pas',
  15.   Global in 'Global.pas',
  16.   ComSaveGameReader in 'ComSaveGameReader.pas';
  17.  
  18. {$R *.RES}
  19.  
  20. var
  21.   Sem: THandle;
  22.  
  23. begin
  24.   { Programm schon gestartet? }
  25.   Sem := CreateSemaphore(nil, 0, 1, 'SpaceMission');
  26.   if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then
  27.   begin
  28.     CloseHandle(Sem);
  29.     MessageDlg('Das Spiel wurde bereits gestartet.', mtInformation, [mbOK], 0);
  30.     exit;
  31.   end;
  32.   SplashForm := TSplashForm.Create(Application);
  33.   SplashForm.Show;
  34.   SplashForm.Update;
  35.   Application.Initialize;
  36.   Application.ShowMainform := False;
  37.   Application.MainFormOnTaskBar := true;
  38.   Application.Title := 'SpaceMission';
  39.   if not fileexists(OwnDirectory+'DirectX\Graphics.dxg') then
  40.   begin
  41.     MessageDLG('DirectX\Graphics.dxg fehlt. Bitte installieren Sie SpaceMission erneut.', mtError, [mbOK], 0);
  42.     exit;
  43.   end;
  44.   Application.CreateForm(TMainForm, MainForm);
  45.   Application.CreateForm(TSpeicherungForm, SpeicherungForm);
  46.   Application.CreateForm(TInfoForm, InfoForm);
  47.   Application.CreateForm(TCheatForm, CheatForm);
  48.   Application.Run;
  49. end.
  50.  
  51.