Subversion Repositories spacemission

Rev

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

  1. program LevEdit;
  2.  
  3. {$Description 'SpaceMission Leveleditor 1.1'}
  4.  
  5. {%ToDo 'LevEdit.todo'}
  6.  
  7. uses
  8.   Windows,
  9.   Forms,
  10.   Dialogs,
  11.   SysUtils,
  12.   MMSystem,
  13.   LevMain in 'LevMain.pas' {MainForm},
  14.   LevText in 'LevText.pas' {TextForm},
  15.   LevSplash in 'LevSplash.pas' {SplashForm},
  16.   LevSpeicherung in 'LevSpeicherung.pas' {SpeicherungForm},
  17.   SplInfo in 'SplInfo.pas' {InfoForm},
  18.   LevSource in 'LevSource.pas' {SourceForm},
  19.   LevOptions in 'LevOptions.pas' {LevelForm},
  20.   Global in 'Global.pas';
  21.  
  22. {$R *.RES}
  23.  
  24. var
  25.   Fehler: boolean;
  26.   Sem: THandle;
  27.   directory: string;
  28.  
  29. begin
  30.   { Programm schon gestartet? }
  31.   Sem := CreateSemaphore(nil, 0, 1, 'SpaceMission Leveleditor');
  32.   if (Sem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS) then
  33.   begin
  34.     CloseHandle(Sem);
  35.     MessageDlg('Der Editor wurde bereits gestartet.', mtInformation, [mbOK], 0);
  36.     exit;
  37.   end;
  38.   SplashForm := TSplashForm.Create(Application);
  39.   SplashForm.Show;
  40.   SplashForm.Update;                                        
  41.   Application.Initialize;
  42.   Application.showmainform := False;
  43.   Application.Title := 'SpaceMission 1.1 - Leveleditor';
  44.   Fehler := false;
  45.   directory := extractfilepath(paramstr(0));
  46.   // if not fileexists(directory+'Bilder\Auswahl.bmp') then Fehler := true;
  47.   if not fileexists(directory+'DirectX\Graphic.dxg') then Fehler := true;
  48.   // if not fileexists(directory+'Texte\Mitwirkende.txt') then Fehler := true;
  49.   // if not fileexists(directory+'Dateien.doc') then Fehler := true;
  50.   if Fehler then
  51.   begin
  52.     MessageDLG('Dateien, die die Programmstabilität gewährleisten, sind ' +
  53.       'nicht mehr vorhanden!'+#13#10+'Bitte installieren Sie SpaceMission erneut...',
  54.       mtWarning, [mbOK], 0);
  55.     exit;
  56.   end;
  57.   Application.CreateForm(TMainForm, MainForm);
  58.   Application.CreateForm(TTextForm, TextForm);
  59.   Application.CreateForm(TSpeicherungForm, SpeicherungForm);
  60.   Application.CreateForm(TInfoForm, InfoForm);
  61.   Application.CreateForm(TSourceForm, SourceForm);
  62.   Application.CreateForm(TLevelForm, LevelForm);
  63.   Application.Run;
  64. end.
  65.  
  66.