Browse Source

+ some work to complete SDL package support for MorphOS. more to come.

git-svn-id: trunk@16200 -
Károly Balogh 15 years ago
parent
commit
1811234b72

+ 1 - 0
.gitattributes

@@ -5266,6 +5266,7 @@ packages/sdl/src/jedi-sdl.inc svneol=native#text/plain
 packages/sdl/src/libxmlparser.pas svneol=native#text/plain
 packages/sdl/src/libxmlparser.pas svneol=native#text/plain
 packages/sdl/src/logger.pas svneol=native#text/plain
 packages/sdl/src/logger.pas svneol=native#text/plain
 packages/sdl/src/powersdl.inc svneol=native#text/plain
 packages/sdl/src/powersdl.inc svneol=native#text/plain
+packages/sdl/src/powersdl_image.inc svneol=native#text/plain
 packages/sdl/src/sdl.pas svneol=native#text/plain
 packages/sdl/src/sdl.pas svneol=native#text/plain
 packages/sdl/src/sdl_gfx.pas svneol=native#text/plain
 packages/sdl/src/sdl_gfx.pas svneol=native#text/plain
 packages/sdl/src/sdl_image.pas svneol=native#text/plain
 packages/sdl/src/sdl_image.pas svneol=native#text/plain

+ 1 - 0
packages/sdl/src/powersdl.inc

@@ -109,6 +109,7 @@ function SDL_GetCursor : pSDL_Cursor; syscall basesysv PowerSDLBase 646;
 procedure SDL_FreeCursor(cursor : pSDL_Cursor); syscall basesysv PowerSDLBase 652;
 procedure SDL_FreeCursor(cursor : pSDL_Cursor); syscall basesysv PowerSDLBase 652;
 function SDL_ShowCursor(toggle : LongInt) : LongInt; syscall basesysv PowerSDLBase 658;
 function SDL_ShowCursor(toggle : LongInt) : LongInt; syscall basesysv PowerSDLBase 658;
 function SDL_GetAppState : Byte; syscall basesysv PowerSDLBase 664;
 function SDL_GetAppState : Byte; syscall basesysv PowerSDLBase 664;
+procedure SDL_SetError(fmt: PChar); syscall basesysv PowerSDLBase 670;
 function SDL_GetError : pChar; syscall basesysv PowerSDLBase 676;
 function SDL_GetError : pChar; syscall basesysv PowerSDLBase 676;
 procedure SDL_ClearError; syscall basesysv PowerSDLBase 682;
 procedure SDL_ClearError; syscall basesysv PowerSDLBase 682;
 function SDL_AudioInit(const driver_name : pChar) : LongInt; syscall basesysv PowerSDLBase 688;
 function SDL_AudioInit(const driver_name : pChar) : LongInt; syscall basesysv PowerSDLBase 688;

+ 35 - 0
packages/sdl/src/powersdl_image.inc

@@ -0,0 +1,35 @@
+
+var PowerSDLImageBase : pLibrary;
+
+const
+    POWERSDL_IMAGENAME : PChar = 'powersdl_image.library';
+
+function IMG_LoadTyped_RW(src : pSDL_RWops; freesrc : LongInt; type_ : pChar) : pSDL_Surface; syscall r12base PowerSDLImageBase 028;
+function IMG_Load(const file_ : pChar) : pSDL_Surface; syscall r12base PowerSDLImageBase 034;
+function IMG_Load_RW(src : pSDL_RWops; freesrc : LongInt) : pSDL_Surface; syscall r12base PowerSDLImageBase 040;
+function IMG_InvertAlpha(on : LongInt) : LongInt; syscall r12base PowerSDLImageBase 046;
+function IMG_isBMP(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 052;
+function IMG_isPNM(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 058;
+function IMG_isXPM(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 064;
+function IMG_isXCF(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 070;
+function IMG_isPCX(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 076;
+function IMG_isGIF(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 082;
+function IMG_isJPG(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 088;
+function IMG_isTIF(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 094;
+function IMG_isPNG(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 100;
+function IMG_isLBM(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 106;
+function IMG_LoadBMP_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 112;
+function IMG_LoadPNM_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 118;
+function IMG_LoadXPM_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 124;
+function IMG_LoadXCF_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 130;
+function IMG_LoadPCX_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 136;
+function IMG_LoadGIF_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 142;
+function IMG_LoadJPG_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 148;
+function IMG_LoadTIF_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 154;
+function IMG_LoadPNG_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 160;
+function IMG_LoadTGA_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 166;
+function IMG_LoadLBM_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 172;
+function IMG_ReadXPMFromArray(var xpm : pShortInt) : pSDL_Surface; syscall r12base PowerSDLImageBase 178;
+function IMG_Linked_Version : pSDL_version; syscall r12base PowerSDLImageBase 184;
+function IMG_isXV(src : pSDL_RWops) : LongInt; syscall r12base PowerSDLImageBase 190;
+function IMG_LoadXV_RW(src : pSDL_RWops) : pSDL_Surface; syscall r12base PowerSDLImageBase 196;

+ 11 - 1
packages/sdl/src/sdl_image.pas

@@ -136,6 +136,9 @@ interface
 uses
 uses
 {$IFDEF __GPC__}
 {$IFDEF __GPC__}
   gpc,
   gpc,
+{$ENDIF}
+{$IFDEF MORPHOS}
+  exec,
 {$ENDIF}
 {$ENDIF}
   sdl;
   sdl;
 
 
@@ -160,6 +163,10 @@ const
   SDL_ImageLibName = 'SDL_image';
   SDL_ImageLibName = 'SDL_image';
 {$ENDIF}
 {$ENDIF}
 
 
+{$IFDEF MORPHOS}
+  SDL_ImageLibName = 'powersdl_image.library';
+{$ENDIF}
+
   // Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
   // Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
   SDL_IMAGE_MAJOR_VERSION = 1;
   SDL_IMAGE_MAJOR_VERSION = 1;
 {$EXTERNALSYM SDL_IMAGE_MAJOR_VERSION}
 {$EXTERNALSYM SDL_IMAGE_MAJOR_VERSION}
@@ -168,6 +175,9 @@ const
   SDL_IMAGE_PATCHLEVEL    = 5;
   SDL_IMAGE_PATCHLEVEL    = 5;
 {$EXTERNALSYM SDL_IMAGE_PATCHLEVEL}
 {$EXTERNALSYM SDL_IMAGE_PATCHLEVEL}
 
 
+{$IFDEF MORPHOS}
+{$INCLUDE powersdl_image.inc}
+{$ELSE MORPHOS}
 { This macro can be used to fill a version structure with the compile-time
 { This macro can be used to fill a version structure with the compile-time
   version of the SDL_image library. }
   version of the SDL_image library. }
 procedure SDL_IMAGE_VERSION( var X : TSDL_Version );
 procedure SDL_IMAGE_VERSION( var X : TSDL_Version );
@@ -305,7 +315,7 @@ function IMG_ReadXPMFromArray( xpm : PPChar ): PSDL_Surface;
 cdecl; external {$IFDEF __GPC__}name 'IMG_ReadXPMFromArray'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
 cdecl; external {$IFDEF __GPC__}name 'IMG_ReadXPMFromArray'{$ELSE} SDL_ImageLibName{$ENDIF __GPC__};
 {$EXTERNALSYM IMG_ReadXPMFromArray}
 {$EXTERNALSYM IMG_ReadXPMFromArray}
 
 
-
+{$ENDIF MORPHOS}
 
 
 
 
 { used internally, NOT an exported function }
 { used internally, NOT an exported function }