hedgewars/uMisc.pas
branchwebgl
changeset 8026 4a4f21070479
parent 7848 775a72905708
child 9127 e350500c4edb
--- a/hedgewars/uMisc.pas	Sun Nov 11 16:53:16 2012 +0100
+++ b/hedgewars/uMisc.pas	Sun Nov 11 17:15:19 2012 +0100
@@ -49,7 +49,7 @@
          size: QWord;
          end;
 
-var conversionFormat: PSDL_PixelFormat;
+var conversionFormat : PSDL_PixelFormat;
 
 procedure movecursor(dx, dy: LongInt);
 var x, y: LongInt;
@@ -68,7 +68,7 @@
 var i: LongInt;
     png_ptr: ^png_struct;
     info_ptr: ^png_info;
-    f: file;
+    f: File;
     image: PScreenshot;
 begin
 image:= PScreenshot(screenshot);
@@ -141,6 +141,7 @@
     );
     image: PScreenshot;
     size: QWord;
+    writeResult:LongInt;
 begin
 image:= PScreenshot(screenshot);
 
@@ -168,8 +169,8 @@
 Rewrite(f, 1);
 if IOResult = 0 then
     begin
-    BlockWrite(f, head, sizeof(head));
-    BlockWrite(f, image^.buffer^, size);
+    BlockWrite(f, head, sizeof(head), writeResult);
+    BlockWrite(f, image^.buffer^, size, writeResult);
     Close(f);
     end
 else
@@ -275,6 +276,7 @@
 var convertedSurf: PSDL_Surface;
 begin
     doSurfaceConversion:= tmpsurf;
+{$IFNDEF WEBGL}
     if ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) or
        (tmpsurf^.format^.bitsperpixel = 24) then
     begin
@@ -282,6 +284,7 @@
         SDL_FreeSurface(tmpsurf);
         doSurfaceConversion:= convertedSurf;
     end;
+{$ENDIF}
 end;
 
 {$IFDEF SDL13}
@@ -314,4 +317,4 @@
     SDL_FreeFormat(conversionFormat);
 end;
 
-end.
+end.