and now it even works for sdl12 \o/ hedgeroid
authorXeli
Sat, 12 Nov 2011 18:02:55 +0100
branchhedgeroid
changeset 6338 633af6fec34f
parent 6336 cf4c65f9cbbe
child 6340 9dd921c0c7e7
child 6341 ccc0a58e123d
and now it even works for sdl12 \o/
hedgewars/SDLh.pas
hedgewars/uAI.pas
--- a/hedgewars/SDLh.pas	Sat Nov 12 17:55:23 2011 +0100
+++ b/hedgewars/SDLh.pas	Sat Nov 12 18:02:55 2011 +0100
@@ -865,7 +865,9 @@
 procedure SDL_StartTextInput; cdecl; external SDLLibName;
 
 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName;
+function  SDL_CreateThread(fn: pointer; name: PChar; data: pointer): PSDL_Thread; cdecl; external SDLLibName;
 {$ELSE}
+function  SDL_CreateThread(fn: pointer; data: pointer): PSDL_Thread; cdecl; external SDLLibName;
 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName;
 {$ENDIF}
 
@@ -883,7 +885,6 @@
 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName;
 function  SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
 
-function  SDL_CreateThread(fn: pointer; name: PChar; data: pointer): PSDL_Thread; cdecl; external SDLLibName;
 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
--- a/hedgewars/uAI.pas	Sat Nov 12 17:55:23 2011 +0100
+++ b/hedgewars/uAI.pas	Sat Nov 12 18:02:55 2011 +0100
@@ -320,7 +320,10 @@
 //TODO: sdl_thread works on device but crashes in simulator, most likely because of outdated toolchain
 BeginThread(@Think, Me, ThinkThread);
 {$ELSE}
+{$IFDEF SDL13}
 ThinkThread := SDL_CreateThread(@Think, nil, Me);
+{$ELSE}
+ThinkThread := SDL_CreateThread(@Think, Me);
 {$ENDIF}
 AddFileLog('Thread started');
 end;