hedgewars/hwengine.pas
changeset 7186 013deb83086b
parent 7138 f8248bcba8f1
parent 7151 ec15d9e1a7e3
child 7304 8b3575750cd2
equal deleted inserted replaced
7138:f8248bcba8f1 7186:013deb83086b
   102     SwapBuffers;
   102     SwapBuffers;
   103 
   103 
   104     if flagMakeCapture then
   104     if flagMakeCapture then
   105         begin
   105         begin
   106         flagMakeCapture:= false;
   106         flagMakeCapture:= false;
       
   107         {$IFDEF PAS2C}
       
   108         s:= 'hw';
       
   109         {$ELSE}
   107         s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
   110         s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
       
   111         {$ENDIF}
   108 
   112 
   109         playSound(sndShutter);
   113         playSound(sndShutter);
   110         
   114         
   111         if MakeScreenshot(s) then
   115         if MakeScreenshot(s) then
   112             WriteLnToConsole('Screenshot saved: ' + s)
   116             WriteLnToConsole('Screenshot saved: ' + s)
   265 begin
   269 begin
   266 {$IFDEF HWLIBRARY}
   270 {$IFDEF HWLIBRARY}
   267     cBits:= 32;
   271     cBits:= 32;
   268     cTimerInterval:= 8;
   272     cTimerInterval:= 8;
   269     cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF};
   273     cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF};
   270     val(gameArgs[0], ipcPort);
   274     ipcPort:= StrToInt(gameArgs[0]);
   271     val(gameArgs[1], cScreenWidth);
   275     cScreenWidth:= StrToInt(gameArgs[1]);
   272     val(gameArgs[2], cScreenHeight);
   276     cScreenHeight:= StrToInt(gameArgs[2]);
   273     val(gameArgs[3], cReducedQuality);
   277     cReducedQuality:= StrToInt(gameArgs[3]);
   274     cLocaleFName:= gameArgs[4];
   278     cLocaleFName:= gameArgs[4];
   275     // cFullScreen functionality is platform dependent, ifdef it if you need to modify it
   279     // cFullScreen functionality is platform dependent, ifdef it if you need to modify it
   276     cFullScreen:= false;
   280     cFullScreen:= false;
   277     
   281     
   278     if (Length(cLocaleFName) > 6) then
   282     if (Length(cLocaleFName) > 6) then
   491 {$IFNDEF HWLIBRARY}
   495 {$IFNDEF HWLIBRARY}
   492 /////////////////////
   496 /////////////////////
   493 procedure DisplayUsage;
   497 procedure DisplayUsage;
   494 var i: LongInt;
   498 var i: LongInt;
   495 begin
   499 begin
   496     WriteLn('Wrong argument format: correct configurations is');
   500     WriteLn(stdout, 'Wrong argument format: correct configurations is');
   497     WriteLn();
   501     WriteLn(stdout, '');
   498     WriteLn('  hwengine <path to user hedgewars folder> <path to global data folder> <path to replay file> [options]');
   502     WriteLn(stdout, '  hwengine <path to user hedgewars folder> <path to global data folder> <path to replay file> [options]');
   499     WriteLn();
   503     WriteLn(stdout, '');
   500     WriteLn('where [options] must be specified either as:');
   504     WriteLn(stdout, 'where [options] must be specified either as:');
   501     WriteLn(' --set-video [screen width] [screen height] [color dept]');
   505     WriteLn(stdout, ' --set-video [screen width] [screen height] [color dept]');
   502     WriteLn(' --set-audio [volume] [enable music] [enable sounds]');
   506     WriteLn(stdout, ' --set-audio [volume] [enable music] [enable sounds]');
   503     WriteLn(' --set-other [language file] [full screen] [show FPS]');
   507     WriteLn(stdout, ' --set-other [language file] [full screen] [show FPS]');
   504     WriteLn(' --set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]');
   508     WriteLn(stdout, ' --set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]');
   505     WriteLn(' --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]');
   509     WriteLn(stdout, ' --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]');
   506     WriteLn(' --stats-only');
   510     WriteLn(stdout, ' --stats-only');
   507     WriteLn();
   511     WriteLn(stdout, '');
   508     WriteLn('Read documentation online at http://code.google.com/p/hedgewars/wiki/CommandLineOptions for more information');
   512     WriteLn(stdout, 'Read documentation online at http://code.google.com/p/hedgewars/wiki/CommandLineOptions for more information');
   509     WriteLn();
   513     WriteLn(stdout, '');
   510     Write('PARSED COMMAND: ');
   514     Write(stdout, 'PARSED COMMAND: ');
   511     
   515     
   512     for i:=0 to ParamCount do
   516     for i:=0 to ParamCount do
   513         Write(ParamStr(i) + ' ');
   517         Write(stdout, ParamStr(i) + ' ');
   514         
   518         
   515     WriteLn();
   519     WriteLn(stdout, '');
   516 end;
   520 end;
   517 
   521 
   518 ////////////////////
   522 ////////////////////
   519 {$INCLUDE "ArgParsers.inc"}
   523 {$INCLUDE "ArgParsers.inc"}
   520 
   524 
   547     else if GameType = gmtSyntax then
   551     else if GameType = gmtSyntax then
   548         DisplayUsage()
   552         DisplayUsage()
   549     else Game();
   553     else Game();
   550 
   554 
   551     // return 1 when engine is not called correctly
   555     // return 1 when engine is not called correctly
   552     ExitCode:= LongInt(GameType = gmtSyntax);
   556     halt(LongInt(GameType = gmtSyntax));
   553 {$ENDIF}
   557 {$ENDIF}
   554 end.
   558 end.