Subversion Repositories spacemission

Rev

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