another tweak tomake --stats-only work on headless servers
authorXeli
Thu, 15 Nov 2012 16:46:46 +0100
changeset 8039 a3b86c1f63b4
parent 8036 89740f927254
child 8042 644231dded72
another tweak tomake --stats-only work on headless servers
hedgewars/hwengine.pas
hedgewars/uStore.pas
--- a/hedgewars/hwengine.pas	Thu Nov 15 13:58:49 2012 +0400
+++ b/hedgewars/hwengine.pas	Thu Nov 15 16:46:46 2012 +0100
@@ -108,7 +108,7 @@
             exit(false);
             end;
 
-    SwapBuffers;
+    if not cOnlyStats then SwapBuffers;
 
 {$IFDEF USE_VIDEO_RECORDING}
     if flagPrerecording then
@@ -354,7 +354,7 @@
             Pathz[p]:= PathPrefix + '/' + Pathz[p];
 
     WriteToConsole('Init SDL... ');
-    SDLTry(SDL_Init(SDL_INIT_VIDEO or SDL_INIT_NOPARACHUTE) >= 0, true);
+    if not cOnlyStats then SDLTry(SDL_Init(SDL_INIT_VIDEO or SDL_INIT_NOPARACHUTE) >= 0, true);
     WriteLnToConsole(msgOK);
 
     SDL_EnableUNICODE(1);
--- a/hedgewars/uStore.pas	Thu Nov 15 13:58:49 2012 +0400
+++ b/hedgewars/uStore.pas	Thu Nov 15 16:46:46 2012 +0100
@@ -576,7 +576,7 @@
     if ((imageFlags and ifIgnoreCaps) = 0) and ((tmpsurf^.w > MaxTextureSize) or (tmpsurf^.h > MaxTextureSize)) then
     begin
         SDL_FreeSurface(tmpsurf);
-        OutError(msgFailedSize, (imageFlags and ifCritical) <> 0);
+        OutError(msgFailedSize, ((not cOnlyStats) and ((imageFlags and ifCritical) <> 0)));
         // dummy surface to replace non-critical textures that failed to load due to their size
         LoadImage:= SDL_CreateRGBSurface(SDL_SWSURFACE, 2, 2, 32, RMask, GMask, BMask, AMask);
         exit;