Subversion Repositories spacemission

Rev

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.  
  6.  
  7. uses
  8.   Windows,
  9.   Forms,
  10.   Dialogs,
  11.   SysUtils,
  12.   MMSystem,
  13.   LevMain in 'LevMain.pas' {MainForm},
  14.   LevSplash in 'LevSplash.pas' {SplashForm},
  15.   LevSpeicherung in 'LevSpeicherung.pas' {SpeicherungForm},
  16.   ComInfo in 'ComInfo.pas' {InfoForm},
  17.   LevSource in 'LevSource.pas' {SourceForm},
  18.   LevOptions in 'LevOptions.pas' {LevelForm},
  19.   Global in 'Global.pas',
  20.   System.UITypes;
  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(TSpeicherungForm, SpeicherungForm);
  59.   Application.CreateForm(TInfoForm, InfoForm);
  60.   Application.CreateForm(TSourceForm, SourceForm);
  61.   Application.CreateForm(TLevelForm, LevelForm);
  62.   Application.Run;
  63. end.
  64.  
  65.