--- a/hedgewars/SDLh.pas Fri Sep 30 13:17:34 2011 +0400
+++ b/hedgewars/SDLh.pas Fri Sep 30 12:55:04 2011 +0200
@@ -228,6 +228,8 @@
SDL_HWPALETTE = $20000000;
SDL_DOUBLEBUF = $40000000;
SDL_FULLSCREEN = $80000000;
+
+ SDL_ALLEVENTS = $FFFFFFFF;
{$ENDIF}
{$IFDEF ENDIAN_LITTLE}
@@ -279,9 +281,6 @@
IMG_INIT_TIF = $00000004;
{* SDL_EventMask type definition *}
-{$IFNDEF SDL13}
- SDL_ALLEVENTS = $FFFFFFFF;
-{$ENDIF}
/////////////////////////////////////////////////////////////////
/////////////////////// TYPE DEFINITIONS ///////////////////////
@@ -872,8 +871,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;
@@ -904,8 +903,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;
@@ -964,13 +963,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;