--- a/hedgewars/uMisc.pas Thu Apr 04 20:31:41 2013 -0400
+++ b/hedgewars/uMisc.pas Fri Apr 05 18:25:23 2013 +0200
@@ -38,8 +38,7 @@
implementation
uses SysUtils, uVariables, uUtils
- {$IFDEF PNG_SCREENSHOTS}, PNGh, png {$ENDIF}
- {$IFNDEF USE_SDLTHREADS} {$IFDEF UNIX}, cthreads{$ENDIF} {$ENDIF};
+ {$IFDEF PNG_SCREENSHOTS}, PNGh, png {$ENDIF};
type PScreenshot = ^TScreenshot;
TScreenshot = record
@@ -64,7 +63,7 @@
{$IFDEF PNG_SCREENSHOTS}
// this funtion will be executed in separate thread
-function SaveScreenshot(screenshot: pointer): PtrInt;
+function SaveScreenshot(screenshot: pointer): LongInt; cdecl; export;
var i: LongInt;
png_ptr: ^png_struct;
info_ptr: ^png_info;
@@ -119,7 +118,7 @@
{$ELSE} // no PNG_SCREENSHOTS
// this funtion will be executed in separate thread
-function SaveScreenshot(screenshot: pointer): PtrInt;
+function SaveScreenshot(screenshot: pointer): LongInt; cdecl; export;
var f: file;
// Windows Bitmap Header
head: array[0..53] of Byte = (
@@ -262,11 +261,7 @@
image^.size:= size;
image^.buffer:= p;
-{$IFDEF USE_SDLTHREADS}
-SDL_CreateThread(@SaveScreenshot{$IFDEF SDL13}, nil{$ENDIF}, image);
-{$ELSE}
-BeginThread(@SaveScreenshot, image);
-{$ENDIF}
+SDL_CreateThread(@SaveScreenshot{$IFDEF SDL13}, 'snapshot'{$ENDIF}, image);
MakeScreenshot:= true; // possibly it is not true but we will not wait for thread to terminate
end;