hedgewars/hwengine.pas
changeset 2948 3f21a9dc93d0
parent 2947 803b277e4894
child 2990 b62e567f17b9
equal deleted inserted replaced
2947:803b277e4894 2948:3f21a9dc93d0
    26 unit hwengine;
    26 unit hwengine;
    27 interface
    27 interface
    28 {$ELSE}
    28 {$ELSE}
    29 program hwengine;
    29 program hwengine;
    30 {$ENDIF}
    30 {$ENDIF}
    31 uses	SDLh in 'SDLh.pas',
    31 uses    SDLh in 'SDLh.pas',
    32     uConsts in 'uConsts.pas',
    32     uConsts in 'uConsts.pas',
    33     uGame in 'uGame.pas',
    33     uGame in 'uGame.pas',
    34     uMisc in 'uMisc.pas',
    34     uMisc in 'uMisc.pas',
    35     uStore in 'uStore.pas',
    35     uStore in 'uStore.pas',
    36     uWorld in 'uWorld.pas',
    36     uWorld in 'uWorld.pas',
   227 {$IFDEF HWLIBRARY}
   227 {$IFDEF HWLIBRARY}
   228 procedure Game(gameArgs: arrayofpchar); cdecl; export;
   228 procedure Game(gameArgs: arrayofpchar); cdecl; export;
   229 {$ELSE}
   229 {$ELSE}
   230 procedure Game;cdecl; export;
   230 procedure Game;cdecl; export;
   231 {$ENDIF}
   231 {$ENDIF}
   232 var	p: TPathType;
   232 var p: TPathType;
   233     s: shortstring;
   233     s: shortstring;
   234 begin
   234 begin
   235 {$IFDEF HWLIBRARY}
   235 {$IFDEF HWLIBRARY}
   236     initEverything();
   236     initEverything();
   237     Randomize();
   237     Randomize();
   319 
   319 
   320 procedure initEverything;
   320 procedure initEverything;
   321 begin
   321 begin
   322     init_uConsts();
   322     init_uConsts();
   323     init_uMisc();
   323     init_uMisc();
   324     init_uConsole();	// MUST happen after uMisc
   324     init_uConsole();    // MUST happen after uMisc
   325     
   325     
   326     init_uAI();
   326     init_uAI();
   327     //uAIActions does not need initialization
   327     //uAIActions does not need initialization
   328     //uAIAmmoTests does not need initialization
   328     //uAIAmmoTests does not need initialization
   329     init_uAIMisc();
   329     init_uAIMisc();
   339     //uLandGraphics does not need initialization
   339     //uLandGraphics does not need initialization
   340     //uLandObjects does not need initialization
   340     //uLandObjects does not need initialization
   341     //uLandTemplates does not need initialization
   341     //uLandTemplates does not need initialization
   342     //uLandTexture does not need initialization
   342     //uLandTexture does not need initialization
   343     //uLocale does not need initialization
   343     //uLocale does not need initialization
   344     init_uRandom();	
   344     init_uRandom(); 
   345     //uSHA does not need initialization
   345     //uSHA does not need initialization
   346     init_uSound();
   346     init_uSound();
   347     init_uStats();
   347     init_uStats();
   348     init_uStore();
   348     init_uStore();
   349     init_uTeams();
   349     init_uTeams();
   354 end;
   354 end;
   355 
   355 
   356 procedure freeEverything;
   356 procedure freeEverything;
   357 begin
   357 begin
   358     free_uWorld();
   358     free_uWorld();
   359     free_uVisualGears();	//stub
   359     free_uVisualGears();    //stub
   360     free_uTriggers();	//stub
   360     free_uTriggers();   //stub
   361     free_uTeams();
   361     free_uTeams();
   362     free_uStore();
   362     free_uStore();
   363     free_uStats();		//stub
   363     free_uStats();      //stub
   364     free_uSound();		//stub
   364     free_uSound();      //stub
   365     //uSHA does not need to be freed
   365     //uSHA does not need to be freed
   366     free_uRandom();		//stub
   366     free_uRandom();     //stub
   367     //uLocale does not need to be freed
   367     //uLocale does not need to be freed
   368     //uLandTemplates does not need to be freed
   368     //uLandTemplates does not need to be freed
   369     //uLandTexture does not need to be freed
   369     //uLandTexture does not need to be freed
   370     //uLandObjects does not need to be freed
   370     //uLandObjects does not need to be freed
   371     //uLandGraphics does not need to be freed
   371     //uLandGraphics does not need to be freed
   372     free_uLand();
   372     free_uLand();
   373     free_uKeys();		//stub
   373     free_uKeys();       //stub
   374     free_uIO();
   374     free_uIO();
   375     free_uGears();
   375     free_uGears();
   376     //uGame does not need to be freed
   376     //uGame does not need to be freed
   377     //uFloat does not need to be freed
   377     //uFloat does not need to be freed
   378     free_uCollisions();
   378     free_uCollisions();
   379     free_uChat();
   379     free_uChat();
   380     free_uAmmos();
   380     free_uAmmos();
   381     free_uAIMisc();		//stub
   381     free_uAIMisc();     //stub
   382     //uAIAmmoTests does not need to be freed
   382     //uAIAmmoTests does not need to be freed
   383     //uAIActions does not need to be freed
   383     //uAIActions does not need to be freed
   384     free_uAI();		//stub
   384     free_uAI();     //stub
   385 
   385 
   386     free_uConsole();
   386     free_uConsole();
   387     free_uMisc();
   387     free_uMisc();
   388     free_uConsts();		//stub
   388     free_uConsts();     //stub
   389     free_uScript();
   389     free_uScript();
   390 end;
   390 end;
   391 
   391 
   392 {$IFNDEF HWLIBRARY}
   392 {$IFNDEF HWLIBRARY}
   393 /////////////////////////
   393 /////////////////////////
   483         end;
   483         end;
   484         6: begin
   484         6: begin
   485             PathPrefix:= ParamStr(1);
   485             PathPrefix:= ParamStr(1);
   486             recordFileName:= ParamStr(2);
   486             recordFileName:= ParamStr(2);
   487 
   487 
   488             if ParamStr(3) = '--set-video'	then
   488             if ParamStr(3) = '--set-video'  then
   489             begin
   489             begin
   490                 val(ParamStr(4), cScreenWidth);
   490                 val(ParamStr(4), cScreenWidth);
   491                 val(ParamStr(5), cScreenHeight);
   491                 val(ParamStr(5), cScreenHeight);
   492                 cInitWidth:= cScreenWidth;
   492                 cInitWidth:= cScreenWidth;
   493                 cInitHeight:= cScreenHeight;
   493                 cInitHeight:= cScreenHeight;