Merge gameServer2 changes
authorWuzzy <Wuzzy2@mail.ru>
Thu, 12 Jul 2018 14:46:16 +0200
changeset 13490 c85b324c4c2d
parent 13489 480ea997036b (diff)
parent 13488 e1543ad2fac9 (current diff)
child 13491 4ef83bcb850b
child 13525 1ee192f13456
Merge gameServer2 changes
--- a/hedgewars/uDebug.pas	Wed Jul 11 18:36:21 2018 -0400
+++ b/hedgewars/uDebug.pas	Thu Jul 12 14:46:16 2018 +0200
@@ -69,7 +69,7 @@
     if not Assert then
     begin
         s:= SDL_GetError();
-        OutError(Msg + ': ' + s, false)
+        OutError(Msg + ': ' + s, isFatal)
     end;
 
     allOK:= allOK and (Assert or (not isFatal));
--- a/hedgewars/uLandObjects.pas	Wed Jul 11 18:36:21 2018 -0400
+++ b/hedgewars/uLandObjects.pas	Thu Jul 12 14:46:16 2018 +0200
@@ -731,7 +731,8 @@
 s:= cPathz[ptCurrTheme] + '/' + cThemeCFGFilename;
 WriteLnToConsole('Reading objects info...');
 f:= pfsOpenRead(s);
-if checkFails(f <> nil, 'Bad data or cannot access file ' + s, true) then exit;
+if (f = nil) then
+    OutError('Error loading theme. File could not be opened: ' + s, true);
 
 ThemeObjects.Count:= 0;
 SprayObjects.Count:= 0;
--- a/hedgewars/uStore.pas	Wed Jul 11 18:36:21 2018 -0400
+++ b/hedgewars/uStore.pas	Thu Jul 12 14:46:16 2018 +0200
@@ -624,10 +624,11 @@
 function LoadImage(const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
 var tmpsurf: PSDL_Surface;
     s: shortstring;
+    logMsg: shortstring;
     rwops: PSDL_RWops;
 begin
     LoadImage:= nil;
-    WriteToConsole(msgLoading + filename + '.png [flags: ' + inttostr(imageFlags) + '] ');
+    logMsg:= msgLoading + filename + '.png [flags: ' + inttostr(imageFlags) + ']';
 
     s:= filename + '.png';
 
@@ -651,20 +652,22 @@
         if rwops <> nil then
             begin
             // anounce that loading failed
-            OutError(msgFailed, false);
+            OutError(logMsg + ' ' + msgFailed, false);
 
-            if SDLCheck(false, 'LoadImage', (imageFlags and ifCritical) <> 0) then exit;
+            if SDLCheck(false, 'LoadImage: ' + logMsg + ' ' + msgFailed, (imageFlags and ifCritical) <> 0) then
+                exit;
             // rwops was already freed by IMG_Load_RW
             rwops:= nil;
-            end else
-            OutError(msgFailed, (imageFlags and ifCritical) <> 0);
+            end
+        else
+            OutError(logMsg + ' ' + msgFailed, (imageFlags and ifCritical) <> 0);
         exit;
         end;
 
     if ((imageFlags and ifIgnoreCaps) = 0) and ((tmpsurf^.w > MaxTextureSize) or (tmpsurf^.h > MaxTextureSize)) then
         begin
         SDL_FreeSurface(tmpsurf);
-        OutError(msgFailedSize, ((not cOnlyStats) and ((imageFlags and ifCritical) <> 0)));
+        OutError(logMsg + ' ' + 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;
@@ -675,7 +678,8 @@
     if (imageFlags and ifColorKey) <> 0 then
         if checkFails(SDL_SetColorKey(tmpsurf, SDL_TRUE, 0) = 0, errmsgTransparentSet, true) then exit;
 
-    WriteLnToConsole(msgOK + ' (' + inttostr(tmpsurf^.w) + 'x' + inttostr(tmpsurf^.h) + ')');
+    // log success
+    WriteLnToConsole(logMsg + ' ' + msgOK + ' (' + inttostr(tmpsurf^.w) + 'x' + inttostr(tmpsurf^.h) + ')');
 
     LoadImage:= tmpsurf //Result
 end;