diff -r 34abd278344e -r 22c1f4833a86 hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Tue Jun 21 17:28:53 2011 -0400 +++ b/hedgewars/SDLh.pas Wed Jun 22 00:38:31 2011 +0200 @@ -35,13 +35,15 @@ {$ENDIF} {$IFDEF UNIX} - {$IFNDEF DARWIN} + {$IFNDEF DARWIN} {$linklib c} {$ENDIF} {$IFDEF HAIKU} {$linklib root} {$ELSE} - {$linklib pthread} + {$IFNDEF ANDROID} + {$linklib pthread} + {$ENDIF} {$ENDIF} {$ENDIF} @@ -74,18 +76,26 @@ SDL_ImageLibName = 'SDL_image.dll'; SDL_NetLibName = 'SDL_net.dll'; {$ELSE} - {$IFDEF DARWIN} + {$IFDEF DARWINN} SDLLibName = 'SDL'; SDL_TTFLibName = 'SDL_ttf'; SDL_MixerLibName = 'SDL_mixer'; SDL_ImageLibName = 'SDL_image'; SDL_NetLibName = 'SDL_net'; {$ELSE} - SDLLibName = 'libSDL.so'; - SDL_TTFLibName = 'libSDL_ttf.so'; - SDL_MixerLibName = 'libSDL_mixer.so'; - SDL_ImageLibName = 'libSDL_image.so'; - SDL_NetLibName = 'libSDL_net.so'; + {$IFDEF ANDROID} + SDLLibName = 'SDL'; + SDL_TTFLibName = 'libSDL_ttf.so'; + SDL_MixerLibName = 'libSDL_mixer.so'; + SDL_ImageLibName = 'libSDL_image.so'; + SDL_NetLibName = 'libSDL_net.so'; + {$ELSE} + SDLLibName = 'SDL'; + SDL_TTFLibName = 'libSDL_ttf.so'; + SDL_MixerLibName = 'libSDL_mixer.so'; + SDL_ImageLibName = 'libSDL_image.so'; + SDL_NetLibName = 'libSDL_net.so'; + {$ENDIF} {$ENDIF} {$ENDIF} @@ -345,7 +355,8 @@ alpha: Byte; {$ENDIF} end; - + + SDL_eventaction = (SDL_ADDEVENT = 0, SDL_PEEPEVENT, SDL_GETEVENT); PSDL_Surface = ^TSDL_Surface; TSDL_Surface = record @@ -473,7 +484,7 @@ type_: LongInt; windowID: LongInt; padding1, padding2: byte; - x, y, z, xrel, yrel : LongInt; + x, y, z,xrel, yrel : LongInt; pressure, pressure_max, pressure_min, rotation, tilt, cursor: LongInt; {$ELSE} @@ -784,8 +795,13 @@ function SDL_GetNumMice: LongInt; cdecl; external SDLLibName; function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName; -procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName; -function SDL_SetHint(name, value: PChar): boolean; cdecl; external SDLLibName; + +procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName ; + +function SDL_SetHint(name, value: PChar): boolean; cdecl; external SDLLibName; + +function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongInt): LongInt; cdecl; external SDLLibName; + {$ENDIF} function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; @@ -850,7 +866,11 @@ function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName; function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName; function TTF_RenderUTF8_Shaded(font: PTTF_Font; const text: PChar; fg, bg: TSDL_Color): PSDL_Surface; cdecl; external SDL_TTFLibName; - +(* +function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; +function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; +function TTF_RenderUTF8_Shaded(font: PTTF_Font; const text: PChar; fg, bg: TSDL_Color): PSDL_Surface; +*) function TTF_OpenFont(const filename: PChar; size: LongInt): PTTF_Font; cdecl; external SDL_TTFLibName; procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName; @@ -981,6 +1001,17 @@ (PByteArray(buf)^[1] shl 16) or (PByteArray(buf)^[0] shl 24) end; - +(* +function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; +begin +TTF_RenderUTF8_Solid:= SDL_CreateRGBSurface(SDL_SWSURFACE, 1, 1, 32, RMask, GMask, BMask, AMask); +end; +function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: TSDL_Color): PSDL_Surface; +begin +TTF_RenderUTF8_Blended:= SDL_CreateRGBSurface(SDL_SWSURFACE, 1, 1, 32, RMask, GMask, BMask, AMask); +end; +function TTF_RenderUTF8_Shaded(font: PTTF_Font; const text: PChar; fg, bg: TSDL_Color): PSDL_Surface; +begin +TTF_RenderUTF8_Shaded:= SDL_CreateRGBSurface(SDL_SWSURFACE, 1, 1, 32, RMask, GMask, BMask, AMask); +end;*) end. -