--- a/hedgewars/SDLh.pas Fri Oct 28 17:41:39 2011 +0200
+++ b/hedgewars/SDLh.pas Fri Oct 28 18:26:17 2011 +0200
@@ -233,6 +233,8 @@
SDL_HWPALETTE = $20000000;
SDL_DOUBLEBUF = $40000000;
SDL_FULLSCREEN = $80000000;
+
+ SDL_ALLEVENTS = $FFFFFFFF;
{$ENDIF}
{$IFDEF ENDIAN_LITTLE}
@@ -284,9 +286,6 @@
IMG_INIT_TIF = $00000004;
{* SDL_EventMask type definition *}
-{$IFNDEF SDL13}
- SDL_ALLEVENTS = $FFFFFFFF;
-{$ENDIF}
/////////////////////////////////////////////////////////////////
/////////////////////// TYPE DEFINITIONS ///////////////////////
@@ -898,8 +897,8 @@
procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName;
(* SDL_mixer *)
-function Mix_Init(flags: LongInt): LongInt; cdecl; external SDL_MixerLibName;
-procedure Mix_Quit; cdecl; external SDL_MixerLibName;
+function Mix_Init(flags: LongInt): LongInt; {$IFDEF SDL_MIXER_NEWER}cdecl; external SDL_MixerLibName;{$ENDIF}
+procedure Mix_Quit; {$IFDEF SDL_MIXER_NEWER}cdecl; external SDL_MixerLibName;{$ENDIF}
function Mix_OpenAudio(frequency: LongInt; format: Word; channels: LongInt; chunksize: LongInt): LongInt; cdecl; external SDL_MixerLibName;
procedure Mix_CloseAudio; cdecl; external SDL_MixerLibName;
@@ -930,8 +929,8 @@
function Mix_FadeOutChannel(channel: LongInt; fadems: LongInt): LongInt; cdecl; external SDL_MixerLibName;
(* SDL_image *)
-function IMG_Init(flags: LongInt): LongInt; cdecl; external SDL_ImageLibName;
-procedure IMG_Quit; cdecl; external SDL_ImageLibName;
+function IMG_Init(flags: LongInt): LongInt; {$IFDEF SDL_IMAGE_NEWER}cdecl; external SDL_ImageLibName;{$ENDIF}
+procedure IMG_Quit; {$IFDEF SDL_IMAGE_NEWER}cdecl; external SDL_ImageLibName;{$ENDIF}
function IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
function IMG_Load_RW(rwop: PSDL_RWops; freesrc: LongInt): PSDL_Surface; cdecl; external SDL_ImageLibName;
@@ -990,13 +989,36 @@
function SDL_MustLock(Surface: PSDL_Surface): Boolean;
begin
+ SDL_MustLock:=
{$IFDEF SDL13}
- SDL_MustLock:= ((surface^.flags and SDL_RLEACCEL) <> 0)
+ ((surface^.flags and SDL_RLEACCEL) <> 0)
{$ELSE}
- SDL_MustLock:= ( surface^.offset <> 0 ) or (( surface^.flags and (SDL_HWSURFACE or SDL_ASYNCBLIT or SDL_RLEACCEL)) <> 0)
+ ( surface^.offset <> 0 ) or (( surface^.flags and (SDL_HWSURFACE or SDL_ASYNCBLIT or SDL_RLEACCEL)) <> 0)
{$ENDIF}
end;
+{$IFNDEF SDL_MIXER_NEWER}
+function Mix_Init(flags: LongInt): LongInt;
+begin
+ exit(flags);
+end;
+
+procedure Mix_Quit;
+begin
+end;
+{$ENDIF}
+
+{$IFNDEF SDL_IMAGE_NEWER}
+function IMG_Init(flags: LongInt): LongInt;
+begin
+ exit(flags);
+end;
+
+procedure IMG_Quit;
+begin
+end;
+{$ENDIF}
+
procedure SDLNet_Write16(value: Word; buf: pointer);
begin
PByteArray(buf)^[1]:= value;