hedgewars/hwengine.pas
changeset 5912 d31eba29e706
parent 5825 a6eab1b7c00d
child 5932 5164d17b6374
child 5968 4e8bb227be9a
--- a/hedgewars/hwengine.pas	Thu Sep 15 09:19:56 2011 +0200
+++ b/hedgewars/hwengine.pas	Thu Sep 15 10:11:38 2011 +0200
@@ -111,10 +111,18 @@
     if flagMakeCapture then
     begin
         flagMakeCapture:= false;
+        {$IFNDEF IPHONEOS}
         s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
-        WriteLnToConsole('Saving ' + s + '...');
+
         playSound(sndShutter);
-        {$IFNDEF IPHONEOS}MakeScreenshot(s);{$ENDIF}
+        if not MakeScreenshot(s) then
+        begin
+            WriteLnToConsole('Screenshot failed.');
+            AddChatString(#5 + 'screen capture failed (lack of memory or write permissions)');
+        end
+        else
+            WriteLnToConsole('Screenshot saved: ' + s);
+        {$ENDIF}
     end;
 end;