hedgewars/hwengine.pas
changeset 4359 83ef50815535
parent 4357 a1fcfc341a52
child 4373 fe0e3903bb9e
equal deleted inserted replaced
4357:a1fcfc341a52 4359:83ef50815535
    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, uKeys, uSound,
    32 uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uKeys, uSound,
    33      uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions, uMobile,
    33      uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions, uMobile,
    34     sysutils, uTypes;
    34      sysutils, uTypes, uVariables;
    35 
    35 
    36 var isTerminated: boolean = false;
    36 var isTerminated: boolean = false;
    37     alsoShutdownFrontend: boolean = false;
    37     alsoShutdownFrontend: boolean = false;
    38 
    38 
    39 {$IFDEF HWLIBRARY}
    39 {$IFDEF HWLIBRARY}
   110     if flagMakeCapture then
   110     if flagMakeCapture then
   111     begin
   111     begin
   112         flagMakeCapture:= false;
   112         flagMakeCapture:= false;
   113         s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
   113         s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
   114         WriteLnToConsole('Saving ' + s + '...');
   114         WriteLnToConsole('Saving ' + s + '...');
       
   115         playSound(sndShutter);
   115         MakeScreenshot(s);
   116         MakeScreenshot(s);
   116         //SDL_SaveBMP_RW(SDLPrimSurface, SDL_RWFromFile(Str2PChar(s), 'wb'), 1)
   117         //SDL_SaveBMP_RW(SDLPrimSurface, SDL_RWFromFile(Str2PChar(s), 'wb'), 1)
   117     end;
   118     end;
   118 end;
   119 end;
   119 
   120 
   317 begin
   318 begin
   318     Randomize();
   319     Randomize();
   319 
   320 
   320     // uConsts does not need initialization as they are all consts
   321     // uConsts does not need initialization as they are all consts
   321     uMisc.initModule;
   322     uMisc.initModule;
       
   323     uVariables.initModule;
   322     uConsole.initModule;    // MUST happen after uMisc
   324     uConsole.initModule;    // MUST happen after uMisc
   323 
   325 
   324     uLand.initModule;
   326     uLand.initModule;
   325     uIO.initModule;
   327     uIO.initModule;
   326 
   328 
   385 
   387 
   386     uIO.freeModule;             //stub
   388     uIO.freeModule;             //stub
   387     uLand.freeModule;
   389     uLand.freeModule;
   388 
   390 
   389     uConsole.freeModule;
   391     uConsole.freeModule;
       
   392     uVariables.freeModule;
   390     uMisc.freeModule;           // uMisc closes the debug log.
   393     uMisc.freeModule;           // uMisc closes the debug log.
   391 end;
   394 end;
   392 
   395 
   393 /////////////////////////
   396 /////////////////////////
   394 procedure GenLandPreview{$IFDEF HWLIBRARY}(port: LongInt); cdecl; export{$ENDIF};
   397 procedure GenLandPreview{$IFDEF HWLIBRARY}(port: LongInt); cdecl; export{$ENDIF};