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