hedgewars/hwengine.pas
changeset 2825 db7c35a0e9c1
parent 2803 1f446fc5c8ec
child 2905 f3c79f7193a9
equal deleted inserted replaced
2824:2d25e49bc2e8 2825:db7c35a0e9c1
   435 	WriteLn('Read documentation online at http://www.hedgewars.org/node/1465 for more information');
   435 	WriteLn('Read documentation online at http://www.hedgewars.org/node/1465 for more information');
   436 	Write('parsed command: ');
   436 	Write('parsed command: ');
   437 	for i:=0 to ParamCount do
   437 	for i:=0 to ParamCount do
   438 		Write(ParamStr(i) + ' ');
   438 		Write(ParamStr(i) + ' ');
   439 	WriteLn();
   439 	WriteLn();
   440 	halt(1);
       
   441 end;
   440 end;
   442 
   441 
   443 ////////////////////
   442 ////////////////////
   444 procedure GetParams;
   443 procedure GetParams;
   445 {$IFDEF DEBUGFILE}
   444 {$IFDEF DEBUGFILE}
   507 					begin
   506 					begin
   508 						cLocaleFName:= ParamStr(4);
   507 						cLocaleFName:= ParamStr(4);
   509 						cFullScreen:= ParamStr(5) = '1';
   508 						cFullScreen:= ParamStr(5) = '1';
   510 						cShowFPS:= ParamStr(6) = '1';
   509 						cShowFPS:= ParamStr(6) = '1';
   511 					end
   510 					end
   512 					else DisplayUsage;
   511 					else GameType:= gmtSyntax;
   513 				end
   512 				end
   514 			end;
   513 			end;
   515 		end;
   514 		end;
   516 		11: begin
   515 		11: begin
   517 			PathPrefix:= ParamStr(1);
   516 			PathPrefix:= ParamStr(1);
   529 				isMusicEnabled:= ParamStr(8) = '1';
   528 				isMusicEnabled:= ParamStr(8) = '1';
   530 				isSoundEnabled:= ParamStr(9) = '1';
   529 				isSoundEnabled:= ParamStr(9) = '1';
   531 				cLocaleFName:= ParamStr(10);
   530 				cLocaleFName:= ParamStr(10);
   532 				cFullScreen:= ParamStr(11) = '1';
   531 				cFullScreen:= ParamStr(11) = '1';
   533 			end
   532 			end
   534 			else DisplayUsage;
   533 			else GameType:= gmtSyntax;
   535 		end;
   534 		end;
   536 		15: begin
   535 		15: begin
   537 			PathPrefix:= ParamStr(1);
   536 			PathPrefix:= ParamStr(1);
   538 			recordFileName:= ParamStr(2);
   537 			recordFileName:= ParamStr(2);
   539 			if ParamStr(3) = '--set-everything' then
   538 			if ParamStr(3) = '--set-everything' then
   552 				cAltDamage:= ParamStr(12) = '1';
   551 				cAltDamage:= ParamStr(12) = '1';
   553 				cShowFPS:= ParamStr(13) = '1';
   552 				cShowFPS:= ParamStr(13) = '1';
   554 				val(ParamStr(14), cTimerInterval);
   553 				val(ParamStr(14), cTimerInterval);
   555 				cReducedQuality:= ParamStr(15) = '1';
   554 				cReducedQuality:= ParamStr(15) = '1';
   556 			end
   555 			end
   557 			else DisplayUsage;
   556 			else GameType:= gmtSyntax;
   558 		end;
   557 		end;
   559 		else DisplayUsage;
   558 		else GameType:= gmtSyntax;
   560 	end;
   559 	end;
   561 
   560 
   562 {$IFDEF DEBUGFILE}
   561 {$IFDEF DEBUGFILE}
   563 	AddFileLog('Prefix: "' + PathPrefix +'"');
   562 	AddFileLog('Prefix: "' + PathPrefix +'"');
   564 	for i:= 0 to ParamCount do
   563 	for i:= 0 to ParamCount do
   578 	
   577 	
   579 	GetParams();
   578 	GetParams();
   580 	Randomize();
   579 	Randomize();
   581 
   580 
   582 	if GameType = gmtLandPreview then GenLandPreview()
   581 	if GameType = gmtLandPreview then GenLandPreview()
       
   582 	else if GameType = gmtSyntax then DisplayUsage()
   583 	else Game();
   583 	else Game();
   584 	freeEverything();
   584 	freeEverything();
   585 	ExitCode:= 0;
   585 	
       
   586 	if GameType = gmtSyntax then
       
   587 		ExitCode:= 1
       
   588 	else
       
   589 		ExitCode:= 0;
   586 {$ENDIF}
   590 {$ENDIF}
   587 end.
   591 end.