1,34 → 1,43 |
program SpaceMission; |
|
{$Description 'SpaceMission 1.1'} |
|
uses |
Windows, |
{$IF CompilerVersion >= 23.0} |
System.UITypes, |
{$IFEND } |
Forms, |
Dialogs, |
SysUtils, |
MMSystem, |
SplMain in 'SplMain.pas' {MainForm}, |
SplText in 'SplText.pas' {TextForm}, |
SplSplash in 'SplSplash.pas' {SplashForm}, |
SplSpeicherung in 'SplSpeicherung.pas' {SpeicherungForm}, |
SplInfo in 'SplInfo.pas' {InfoForm}, |
SplCheat in 'SplCheat.pas' {CheatForm}; |
GamMain in 'GamMain.pas' {MainForm}, |
GamSplash in 'GamSplash.pas' {SplashForm}, |
GamSpeicherung in 'GamSpeicherung.pas' {SpeicherungForm}, |
ComInfo in 'ComInfo.pas' {InfoForm}, |
GamCheat in 'GamCheat.pas' {CheatForm}, |
ComLevelReader in 'ComLevelReader.pas', |
Global in 'Global.pas', |
ComHilfe in 'ComHilfe.pas' {HilfeForm}; |
|
{$R *.RES} |
|
var |
Fehler: boolean; |
Sem: THandle; |
directory: string; |
|
resourcestring |
SAlreadyStarted = 'Das Spiel wurde bereits gestartet.'; |
STitel = 'SpaceMission'; |
SFileMissing = '%s fehlt. Bitte installieren Sie SpaceMission erneut.'; |
|
const |
SemaphoreName = 'SpaceMission'; |
|
begin |
SpaceMission_SwitchLanguage; |
{ Programm schon gestartet? } |
Sem := CreateSemaphore(nil, 0, 1, 'SpaceMission'); |
Sem := CreateSemaphore(nil, 0, 1, SemaphoreName); |
if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then |
begin |
CloseHandle(Sem); |
MessageDlg('Das Spiel wurde bereits gestartet.', mtInformation, [mbOK], 0); |
MessageDlg(SAlreadyStarted, mtInformation, [mbOK], 0); |
exit; |
end; |
SplashForm := TSplashForm.Create(Application); |
35,38 → 44,19 |
SplashForm.Show; |
SplashForm.Update; |
Application.Initialize; |
Application.showmainform := False; |
Application.Title := 'SpaceMission'; |
{ Dateien vorhanden? } |
Fehler := false; |
directory := extractfilepath(paramstr(0)); |
if not fileexists(directory+'Bilder\Delphi.bmp') then Fehler := true; |
if not fileexists(directory+'Bilder\SplSplash.jpg') then Fehler := true; |
if not fileexists(directory+'DirectX\Graphic.dxg') then Fehler := true; |
if not fileexists(directory+'DirectX\Sound.dxw') then Fehler := true; |
if not fileexists(directory+'Musik\Boss.mid') then Fehler := true; |
if not fileexists(directory+'Musik\Game.mid') then Fehler := true; |
if not fileexists(directory+'Musik\Scene.mid') then Fehler := true; |
if not fileexists(directory+'Musik\Title.mid') then Fehler := true; |
//if not fileexists(directory+'Texte\Mitwirkende.txt') then Fehler := true; |
if Fehler then |
Application.ShowMainform := False; |
Application.MainFormOnTaskBar := true; |
Application.Title := STitel; |
if not fileexists(OwnDirectory+DxgFile) then |
begin |
MessageDLG('Dateien, die die Programmstabilität gewährleisten, sind ' + |
'nicht mehr vorhanden!'+#13#10+'Bitte installieren Sie SpaceMission erneut...', |
mtWarning, [mbOK], 0); |
MessageDLG(Format(SFileMissing, [DxgFile]), mtError, [mbOK], 0); |
exit; |
end; |
{ Keine Soundkarte?! } |
if WaveOutGetNumDevs < 1 then |
MessageDlg('Es wurde keine Soundkarte gefunden!' + #13#10 + |
'Entweder ist keine Soundkarte angeschlossen oder sie ist nicht ' + |
'ordnungsgemäß installiert.' + #13#10 + 'Es können daher keine Musik und ' + |
'keine Geräusche abgespielt werden.', mtError, [mbOK], 0); |
Application.CreateForm(TMainForm, MainForm); |
Application.CreateForm(TTextForm, TextForm); |
Application.CreateForm(TSpeicherungForm, SpeicherungForm); |
Application.CreateForm(TInfoForm, InfoForm); |
Application.CreateForm(TCheatForm, CheatForm); |
Application.CreateForm(THilfeForm, HilfeForm); |
Application.Run; |
end. |
|