Subversion Repositories spacemission

Rev

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

  1. program SpaceMission;
  2.  
  3. {$Description 'SpaceMission 1.1'}
  4.  
  5. uses
  6.   Windows,
  7.   Forms,
  8.   Dialogs,
  9.   SysUtils,
  10.   MMSystem,
  11.   SplMain in 'SplMain.pas' {MainForm},
  12.   SplText in 'SplText.pas' {TextForm},
  13.   SplSplash in 'SplSplash.pas' {SplashForm},
  14.   SplSpeicherung in 'SplSpeicherung.pas' {SpeicherungForm},
  15.   SplInfo in 'SplInfo.pas' {InfoForm},
  16.   SplCheat in 'SplCheat.pas' {CheatForm};
  17.  
  18. {$R *.RES}
  19.  
  20. var
  21.   Fehler: boolean;
  22.   Sem: THandle;
  23.   directory: string;
  24.  
  25. begin
  26.   { Programm schon gestartet? }
  27.   Sem := CreateSemaphore(nil, 0, 1, 'SpaceMission');
  28.   if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then
  29.   begin
  30.     CloseHandle(Sem);
  31.     MessageDlg('Das Spiel wurde bereits gestartet.', mtInformation, [mbOK], 0);
  32.     exit;
  33.   end;
  34.   SplashForm := TSplashForm.Create(Application);
  35.   SplashForm.Show;
  36.   SplashForm.Update;
  37.   Application.Initialize;
  38.   Application.showmainform := False;
  39.   Application.Title := 'SpaceMission';
  40.   { Dateien vorhanden? }
  41.   Fehler := false;
  42.   directory := extractfilepath(paramstr(0));
  43.   if not fileexists(directory+'Bilder\Delphi.bmp') then Fehler := true;
  44.   if not fileexists(directory+'Bilder\SplSplash.jpg') then Fehler := true;
  45.   if not fileexists(directory+'DirectX\Graphic.dxg') then Fehler := true;
  46.   if not fileexists(directory+'DirectX\Sound.dxw') then Fehler := true;
  47.   if not fileexists(directory+'Musik\Boss.mid') then Fehler := true;
  48.   if not fileexists(directory+'Musik\Game.mid') then Fehler := true;
  49.   if not fileexists(directory+'Musik\Scene.mid') then Fehler := true;
  50.   if not fileexists(directory+'Musik\Title.mid') then Fehler := true;
  51.   //if not fileexists(directory+'Texte\Mitwirkende.txt') then Fehler := true;
  52.   if Fehler then
  53.   begin
  54.     MessageDLG('Dateien, die die Programmstabilität gewährleisten, sind ' +
  55.       'nicht mehr vorhanden!'+#13#10+'Bitte installieren Sie SpaceMission erneut...',
  56.       mtWarning, [mbOK], 0);
  57.     exit;
  58.   end;
  59.   { Keine Soundkarte?! }
  60.   if WaveOutGetNumDevs < 1 then
  61.     MessageDlg('Es wurde keine Soundkarte gefunden!' + #13#10 +
  62.     'Entweder ist keine Soundkarte angeschlossen oder sie ist nicht ' +
  63.     'ordnungsgemäß installiert.' + #13#10 + 'Es können daher keine Musik und ' +
  64.     'keine Geräusche abgespielt werden.', mtError, [mbOK], 0);
  65.   Application.CreateForm(TMainForm, MainForm);
  66.   Application.CreateForm(TTextForm, TextForm);
  67.   Application.CreateForm(TSpeicherungForm, SpeicherungForm);
  68.   Application.CreateForm(TInfoForm, InfoForm);
  69.   Application.CreateForm(TCheatForm, CheatForm);
  70.   Application.Run;
  71. end.
  72.  
  73.