hedgewars/hwengine.pas
changeset 11151 5c40c65b619d
parent 11046 47a8c19ecb60
parent 11150 877de65e0e13
child 11155 a10143c3d87d
equal deleted inserted replaced
11077:1fb80cd8ba7b 11151:5c40c65b619d
    27 interface
    27 interface
    28 {$ELSE}
    28 {$ELSE}
    29 program hwengine;
    29 program hwengine;
    30 {$ENDIF}
    30 {$ENDIF}
    31 
    31 
    32 uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler
    32 uses {$IFDEF IPHONEOS}cmem, {$ENDIF} SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler
    33      , uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions
    33      , uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions
    34      , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
    34      , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
    35      , uPhysFSLayer, uCursor, uRandom, ArgParsers, uVisualGearsHandlers, uTextures, uRender
    35      , uPhysFSLayer, uCursor, uRandom, ArgParsers, uVisualGearsHandlers, uTextures, uRender
    36      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
    36      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
    37      {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
    37      {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
   539     uScript.freeModule;
   539     uScript.freeModule;
   540 end;
   540 end;
   541 
   541 
   542 ///////////////////////////////////////////////////////////////////////////////
   542 ///////////////////////////////////////////////////////////////////////////////
   543 procedure GenLandPreview;
   543 procedure GenLandPreview;
       
   544 {$IFDEF MOBILE}
       
   545 var Preview: TPreview;
       
   546 {$ELSE}
   544 var Preview: TPreviewAlpha;
   547 var Preview: TPreviewAlpha;
       
   548 {$ENDIF MOBILE}
   545 begin
   549 begin
   546     initEverything(false);
   550     initEverything(false);
   547 
   551 
   548     InitIPC;
   552     InitIPC;
   549     IPCWaitPongEvent;
   553     IPCWaitPongEvent;
   550     TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true);
   554     TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true);
   551 
   555 
   552     ScriptOnPreviewInit;
   556     ScriptOnPreviewInit;
       
   557 {$IFDEF MOBILE}
       
   558     GenPreview(Preview);
       
   559 {$ELSE}
   553     GenPreviewAlpha(Preview);
   560     GenPreviewAlpha(Preview);
       
   561 {$ENDIF MOBILE}
   554     WriteLnToConsole('Sending preview...');
   562     WriteLnToConsole('Sending preview...');
   555     SendIPCRaw(@Preview, sizeof(Preview));
   563     SendIPCRaw(@Preview, sizeof(Preview));
   556     SendIPCRaw(@MaxHedgehogs, sizeof(byte));
   564     SendIPCRaw(@MaxHedgehogs, sizeof(byte));
   557     WriteLnToConsole('Preview sent, disconnect');
   565     WriteLnToConsole('Preview sent, disconnect');
   558     freeEverything(false);
   566     freeEverything(false);
   600         halt(HaltTestUnexpected);
   608         halt(HaltTestUnexpected);
   601         {$ENDIF}
   609         {$ENDIF}
   602         end;
   610         end;
   603 
   611 
   604     {$IFDEF PAS2C}
   612     {$IFDEF PAS2C}
   605     exit(HaltNoError);
   613         exit(HaltNoError);
   606     {$ELSE}
   614     {$ELSE}
   607     halt(HaltNoError);
   615         {$IFDEF IPHONEOS}
       
   616             exit;
       
   617         {$ELSE}
       
   618             halt(HaltNoError);
       
   619         {$ENDIF}
   608     {$ENDIF}
   620     {$ENDIF}
   609 {$IFDEF HWLIBRARY}
   621 {$IFDEF HWLIBRARY}
   610 end;
   622 end;
   611 {$ENDIF}
   623 {$ENDIF}
   612 
   624