Subversion Repositories spacemission

Rev

Rev 1 | Rev 3 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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