--- a/WhatsNew Wed Mar 06 05:37:21 2002 +0000
+++ b/WhatsNew Wed Mar 06 11:05:47 2002 +0000
@@ -3,18 +3,6 @@
Version 1.0:
-1.2.4:
- Added a new header file: SDL_loadso.h
- It contains the following functions:
- SDL_LoadObject(), SDL_LoadFunction(), SDL_UnloadObject()
- The UNIX esd and arts audio code use these to dynamically load
- their respective audio libraries.
-
- Added SDL_LockRect() and SDL_UnlockRect() to lock a portion of a
- surface. This may be more efficient than a full lock if you are
- using a hardware surface and plan to make a few changes to small
- areas in the surface.
-
1.2.0:
Added SDL_VIDEOEXPOSE event to signal that the screen needs to
be redrawn. This is currently only delivered to OpenGL windows
--- a/configure.in Wed Mar 06 05:37:21 2002 +0000
+++ b/configure.in Wed Mar 06 11:05:47 2002 +0000
@@ -15,7 +15,7 @@
SDL_MAJOR_VERSION=1
SDL_MINOR_VERSION=2
SDL_MICRO_VERSION=4
-SDL_INTERFACE_AGE=0
+SDL_INTERFACE_AGE=4
SDL_BINARY_AGE=4
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
@@ -328,11 +328,15 @@
AM_PATH_ESD(0.2.8, use_esd=yes)
if test x$use_esd = xyes; then
AC_ARG_ENABLE(esd-shared,
-[ --enable-esd-shared dynamically load ESD support [default=yes]],
- , enable_esd_shared=yes)
+[ --enable-esd-shared dynamically load ESD audio support [default=no]],
+ , enable_esd_shared=no)
esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
esd_lib=`ls $esd_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
echo "-- $esd_lib_spec -> $esd_lib"
+ if test x$enable_dlopen != xyes && \
+ test x$enable_esd_shared = xyes; then
+ AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
+ fi
if test x$enable_dlopen = xyes && \
test x$enable_esd_shared = xyes && test x$esd_lib != x; then
CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
@@ -374,11 +378,15 @@
AC_MSG_RESULT($audio_arts)
if test x$audio_arts = xyes; then
AC_ARG_ENABLE(arts-shared,
-[ --enable-arts-shared dynamically load ESD support [default=yes]],
- , enable_arts_shared=yes)
+[ --enable-arts-shared dynamically load aRts audio support [default=no]],
+ , enable_arts_shared=no)
arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libarts.so.*/'`
arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
echo "-- $arts_lib_spec -> $arts_lib"
+ if test x$enable_dlopen != xyes && \
+ test x$enable_arts_shared = xyes; then
+ AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
+ fi
if test x$enable_dlopen = xyes && \
test x$enable_arts_shared = xyes && test x$arts_lib != x; then
CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
@@ -998,7 +1006,9 @@
AC_MSG_RESULT($video_opengl)
if test x$video_opengl = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
- AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
+ if test x$use_dlopen != xyes; then
+ AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
+ fi
fi
fi
}
@@ -1383,8 +1393,8 @@
CheckDLOPEN()
{
AC_ARG_ENABLE(dlopen,
-[ --enable-dlopen use dlopen for shared object loading [default=yes]],
- , enable_dlopen=yes)
+[ --enable-dlopen use dlopen for shared object loading [default=no]],
+ , enable_dlopen=no)
if test x$enable_dlopen = xyes; then
AC_MSG_CHECKING(for dlopen)
use_dlopen=no
@@ -1398,7 +1408,7 @@
if test x$use_dlopen = xyes; then
CFLAGS="$CFLAGS -DUSE_DLOPEN"
- SYSTEM_LIBS="$SYSTEM_LIBS -ldl"
+ AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
fi
fi
}
--- a/docs.html Wed Mar 06 05:37:21 2002 +0000
+++ b/docs.html Wed Mar 06 11:05:47 2002 +0000
@@ -16,8 +16,6 @@
Major changes since SDL 1.0.0:
</H2>
<UL>
- <LI> 1.2.4: Added shared object loading functions in SDL_loadso.h
- <LI> 1.2.4: Added SDL_LockRect() and SDL_UnlockRect()
<LI> 1.2.4: Incorporated XFree86 extension libraries into the source
<LI> 1.2.4: Added initial support for Atari (thanks Patrice!)
<LI> 1.2.4: Added support for joysticks on *BSD (thanks Wilbern!)
--- a/include/Makefile.am Wed Mar 06 05:37:21 2002 +0000
+++ b/include/Makefile.am Wed Mar 06 11:05:47 2002 +0000
@@ -18,7 +18,6 @@
SDL_joystick.h \
SDL_keyboard.h \
SDL_keysym.h \
- SDL_loadso.h \
SDL_main.h \
SDL_mouse.h \
SDL_mutex.h \
--- a/include/SDL.h Wed Mar 06 05:37:21 2002 +0000
+++ b/include/SDL.h Wed Mar 06 11:05:47 2002 +0000
@@ -34,7 +34,6 @@
#include "SDL_types.h"
#include "SDL_getenv.h"
#include "SDL_error.h"
-#include "SDL_loadso.h"
#include "SDL_rwops.h"
#include "SDL_timer.h"
#include "SDL_audio.h"
--- a/include/SDL_loadso.h Wed Mar 06 05:37:21 2002 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifdef SAVE_RCSID
-static char rcsid =
- "@(#) $Id$";
-#endif
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#ifndef _SDL_loadso_h
-#define _SDL_loadso_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This function dynamically loads a shared object and returns a pointer
- * to the object handle (or NULL if there was an error).
- * The 'sofile' parameter is a system dependent name of the object file.
- */
-extern DECLSPEC void *SDL_LoadObject(const char *sofile);
-
-/* Given an object handle, this function looks up the address of the
- * named function in the shared object and returns it. This address
- * is no longer valid after calling SDL_UnloadObject().
- */
-extern DECLSPEC void *SDL_LoadFunction(void *handle, const char *name);
-
-/* Unload a shared object from memory */
-extern DECLSPEC void SDL_UnloadObject(void *handle);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_loadso_h */
--- a/include/SDL_video.h Wed Mar 06 05:37:21 2002 +0000
+++ b/include/SDL_video.h Wed Mar 06 11:05:47 2002 +0000
@@ -532,26 +532,6 @@
extern DECLSPEC void SDL_UnlockSurface(SDL_Surface *surface);
/*
- * SDL_LockRect() locks a portion of the surface designated by the 'rect'
- * parameter, and saves the resulting pixels and pitch in the arguments.
- * The rect will be clipped if it extends beyond the bounds of the surface
- *
- * This may be more efficient than a full lock if you are using a hardware
- * surface and plan to make a few changes to small areas in the surface.
- *
- * While a rectangle is locked, no other lock or blit call may be called
- * on the surface. No operating system or library calls should be made
- * between lock/unlock pairs, as critical system locks may be held during
- * this time.
- *
- * After the surface is unlocked, the pixels pointer is no longer valid.
- *
- * SDL_LockRect() returns 0, or -1 if the surface couldn't be locked.
- */
-extern DECLSPEC int SDL_LockRect(SDL_Surface *surface, SDL_Rect *rect, void **pixels, int *pitch);
-extern DECLSPEC void SDL_UnlockRect(SDL_Surface *surface);
-
-/*
* Load a surface from a seekable SDL data source (memory or file.)
* If 'freesrc' is non-zero, the source will be closed after being read.
* Returns the new surface, or NULL if there was an error.
--- a/sdl-config.in Wed Mar 06 05:37:21 2002 +0000
+++ b/sdl-config.in Wed Mar 06 11:05:47 2002 +0000
@@ -5,7 +5,7 @@
exec_prefix_set=no
usage="\
-Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
+Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
--- a/src/Makefile.am Wed Mar 06 05:37:21 2002 +0000
+++ b/src/Makefile.am Wed Mar 06 11:05:47 2002 +0000
@@ -38,5 +38,6 @@
SDL_fatal.c \
SDL_fatal.h \
SDL_getenv.c \
- SDL_loadso.c
+ SDL_loadso.c \
+ SDL_loadso.h
--- a/src/SDL_loadso.c Wed Mar 06 05:37:21 2002 +0000
+++ b/src/SDL_loadso.c Wed Mar 06 11:05:47 2002 +0000
@@ -44,6 +44,7 @@
/*#error Unsupported dynamic link environment*/
#endif /* system type */
+#include "SDL_types.h"
#include "SDL_error.h"
#include "SDL_loadso.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/SDL_loadso.h Wed Mar 06 11:05:47 2002 +0000
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id$";
+#endif
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+/* Note: This API isn't meant for public release until SDL 1.3 */
+
+#ifndef _SDL_loadso_h
+#define _SDL_loadso_h
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This function dynamically loads a shared object and returns a pointer
+ * to the object handle (or NULL if there was an error).
+ * The 'sofile' parameter is a system dependent name of the object file.
+ */
+extern DECLSPEC void *SDL_LoadObject(const char *sofile);
+
+/* Given an object handle, this function looks up the address of the
+ * named function in the shared object and returns it. This address
+ * is no longer valid after calling SDL_UnloadObject().
+ */
+extern DECLSPEC void *SDL_LoadFunction(void *handle, const char *name);
+
+/* Unload a shared object from memory */
+extern DECLSPEC void SDL_UnloadObject(void *handle);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_loadso_h */
--- a/src/main/beos/exports/Makefile Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/beos/exports/Makefile Wed Mar 06 11:05:47 2002 +0000
@@ -12,7 +12,6 @@
../../../../include/SDL_joystick.h \
../../../../include/SDL_keyboard.h \
../../../../include/SDL_keysym.h \
- ../../../../include/SDL_loadso.h \
../../../../include/SDL_main.h \
../../../../include/SDL_mouse.h \
../../../../include/SDL_mutex.h \
--- a/src/main/beos/exports/SDL.exp Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/beos/exports/SDL.exp Wed Mar 06 11:05:47 2002 +0000
@@ -74,9 +74,6 @@
_SDL_GetModState
_SDL_SetModState
_SDL_GetKeyName
-_SDL_LoadObject
-_SDL_LoadFunction
-_SDL_UnloadObject
_SDL_SetModuleHandle
_SDL_RegisterApp
_SDL_InitQuickDraw
@@ -147,8 +144,6 @@
_SDL_FreeSurface
_SDL_LockSurface
_SDL_UnlockSurface
-_SDL_LockRect
-_SDL_UnlockRect
_SDL_LoadBMP_RW
_SDL_SaveBMP_RW
_SDL_SetColorKey
--- a/src/main/macos/exports/Makefile Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/macos/exports/Makefile Wed Mar 06 11:05:47 2002 +0000
@@ -14,7 +14,6 @@
../../../../include/SDL_joystick.h \
../../../../include/SDL_keyboard.h \
../../../../include/SDL_keysym.h \
- ../../../../include/SDL_loadso.h \
../../../../include/SDL_mouse.h \
../../../../include/SDL_mutex.h \
../../../../include/SDL_quit.h \
--- a/src/main/macos/exports/SDL.x Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/macos/exports/SDL.x Wed Mar 06 11:05:47 2002 +0000
@@ -76,9 +76,6 @@
SDL_GetModState
SDL_SetModState
SDL_GetKeyName
- SDL_LoadObject
- SDL_LoadFunction
- SDL_UnloadObject
SDL_GetMouseState
SDL_GetRelativeMouseState
SDL_WarpMouse
@@ -146,8 +143,6 @@
SDL_FreeSurface
SDL_LockSurface
SDL_UnlockSurface
- SDL_LockRect
- SDL_UnlockRect
SDL_LoadBMP_RW
SDL_SaveBMP_RW
SDL_SetColorKey
--- a/src/main/macosx/exports/Makefile Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/macosx/exports/Makefile Wed Mar 06 11:05:47 2002 +0000
@@ -13,7 +13,6 @@
../../../../include/SDL_joystick.h \
../../../../include/SDL_keyboard.h \
../../../../include/SDL_keysym.h \
- ../../../../include/SDL_loadso.h \
../../../../include/SDL_mouse.h \
../../../../include/SDL_mutex.h \
../../../../include/SDL_quit.h \
--- a/src/main/macosx/exports/SDL.x Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/macosx/exports/SDL.x Wed Mar 06 11:05:47 2002 +0000
@@ -74,9 +74,6 @@
_SDL_GetModState
_SDL_SetModState
_SDL_GetKeyName
- _SDL_LoadObject
- _SDL_LoadFunction
- _SDL_UnloadObject
_SDL_GetMouseState
_SDL_GetRelativeMouseState
_SDL_WarpMouse
@@ -144,8 +141,6 @@
_SDL_FreeSurface
_SDL_LockSurface
_SDL_UnlockSurface
- _SDL_LockRect
- _SDL_UnlockRect
_SDL_LoadBMP_RW
_SDL_SaveBMP_RW
_SDL_SetColorKey
--- a/src/main/win32/exports/Makefile Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/win32/exports/Makefile Wed Mar 06 11:05:47 2002 +0000
@@ -13,7 +13,6 @@
../../../../include/SDL_joystick.h \
../../../../include/SDL_keyboard.h \
../../../../include/SDL_keysym.h \
- ../../../../include/SDL_loadso.h \
../../../../include/SDL_main.h \
../../../../include/SDL_mouse.h \
../../../../include/SDL_mutex.h \
--- a/src/main/win32/exports/SDL.def Wed Mar 06 05:37:21 2002 +0000
+++ b/src/main/win32/exports/SDL.def Wed Mar 06 11:05:47 2002 +0000
@@ -74,9 +74,6 @@
SDL_GetModState
SDL_SetModState
SDL_GetKeyName
- SDL_LoadObject
- SDL_LoadFunction
- SDL_UnloadObject
SDL_SetModuleHandle
SDL_RegisterApp
SDL_InitQuickDraw
@@ -147,8 +144,6 @@
SDL_FreeSurface
SDL_LockSurface
SDL_UnlockSurface
- SDL_LockRect
- SDL_UnlockRect
SDL_LoadBMP_RW
SDL_SaveBMP_RW
SDL_SetColorKey
--- a/src/video/SDL_surface.c Wed Mar 06 05:37:21 2002 +0000
+++ b/src/video/SDL_surface.c Wed Mar 06 11:05:47 2002 +0000
@@ -630,10 +630,6 @@
*/
int SDL_LockSurface (SDL_Surface *surface)
{
- if ( surface->locked < 0 ) {
- SDL_SetError("Surface has a rectangle lock");
- return(-1);
- }
if ( ! surface->locked ) {
/* Perform the lock */
if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) {
@@ -657,78 +653,6 @@
/* Ready to go.. */
return(0);
}
-int SDL_LockRect (SDL_Surface *surface, SDL_Rect *rect, void **pixels, int *pitch)
-{
- int retval = 0;
-
- /* Check to see if the surface is already locked */
- *pixels = NULL;
- if ( surface->locked != 0 ) {
- SDL_SetError("Surface is already locked");
- return(-1);
- }
-
- /* Clip the lock to the clipping rectangle of the surface */
- {
- SDL_Rect *clip = &surface->clip_rect;
- int dx, dy;
- int h = rect->h;
- int w = rect->w;
-
- dx = clip->x - rect->x;
- if(dx > 0) {
- w -= dx;
- rect->x += dx;
- }
- dx = rect->x + w - clip->x - clip->w;
- if(dx > 0)
- w -= dx;
-
- dy = clip->y - rect->y;
- if(dy > 0) {
- h -= dy;
- rect->y += dy;
- }
- dy = rect->y + h - clip->y - clip->h;
- if(dy > 0)
- h -= dy;
-
- if(w > 0 && h > 0) {
- rect->w = w;
- rect->h = h;
- } else {
- rect->w = 0;
- rect->h = 0;
- SDL_SetError("Rectangle was clipped");
- return(-1);
- }
- }
-
- /* Perform the lock */
- if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- if ( video->LockHWSurfaceRect ) {
- retval = video->LockHWSurfaceRect(this, surface, rect, pixels, pitch);
- if ( retval == 0 ) {
- surface->locked = -1;
- return 0;
- }
- }
- }
- if ( SDL_MUSTLOCK(surface) ) {
- retval = SDL_LockSurface(surface);
- if ( retval < 0 ) {
- return retval;
- }
- }
- surface->locked = -1;
- *pixels = (Uint8 *)surface->pixels + rect->y * surface->pitch + rect->x * surface->format->BytesPerPixel;
- *pitch = surface->pitch;
-
- /* Ready to go.. */
- return(0);
-}
/*
* Unlock a previously locked surface
* -- Do not call this from any blit function, as SDL_DrawCursor() may recurse
@@ -739,9 +663,6 @@
void SDL_UnlockSurface (SDL_Surface *surface)
{
/* Only perform an unlock if we are locked */
- if ( surface->locked < 0 ) {
- return;
- }
if ( ! surface->locked || (--surface->locked > 0) ) {
return;
}
@@ -762,29 +683,6 @@
}
}
}
-void SDL_UnlockRect (SDL_Surface *surface)
-{
- /* Only perform an unlock if we are locked */
- if ( surface->locked != -1 ) {
- return;
- }
-
- /* Perform the unlock */
- if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- if ( video->LockHWSurfaceRect ) {
- video->UnlockHWSurfaceRect(this, surface);
- return;
- }
- }
- if ( SDL_MUSTLOCK(surface) ) {
- surface->locked = 1;
- SDL_UnlockSurface(surface);
- } else {
- surface->locked = 0;
- }
-}
/*
* Convert a surface into the specified pixel format.
--- a/src/video/SDL_sysvideo.h Wed Mar 06 05:37:21 2002 +0000
+++ b/src/video/SDL_sysvideo.h Wed Mar 06 11:05:47 2002 +0000
@@ -153,8 +153,6 @@
/* Returns a readable/writable surface */
int (*LockHWSurface)(_THIS, SDL_Surface *surface);
void (*UnlockHWSurface)(_THIS, SDL_Surface *surface);
- int (*LockHWSurfaceRect)(_THIS, SDL_Surface *surface, SDL_Rect *rect, void **pixels, int *pitch);
- void (*UnlockHWSurfaceRect)(_THIS, SDL_Surface *surface);
/* Performs hardware flipping */
int (*FlipHWSurface)(_THIS, SDL_Surface *surface);
--- a/src/video/windx5/SDL_dx5video.c Wed Mar 06 05:37:21 2002 +0000
+++ b/src/video/windx5/SDL_dx5video.c Wed Mar 06 11:05:47 2002 +0000
@@ -421,7 +421,6 @@
static int DX5_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
static int DX5_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha);
static int DX5_LockHWSurface(_THIS, SDL_Surface *surface);
-static int DX5_LockHWSurfaceRect(_THIS, SDL_Surface *surface, SDL_Rect *rect, void **pixels, int *pitch);
static void DX5_UnlockHWSurface(_THIS, SDL_Surface *surface);
static int DX5_FlipHWSurface(_THIS, SDL_Surface *surface);
static void DX5_FreeHWSurface(_THIS, SDL_Surface *surface);
@@ -592,9 +591,7 @@
device->SetHWColorKey = DX5_SetHWColorKey;
device->SetHWAlpha = DX5_SetHWAlpha;
device->LockHWSurface = DX5_LockHWSurface;
- device->LockHWSurfaceRect = DX5_LockHWSurfaceRect;
device->UnlockHWSurface = DX5_UnlockHWSurface;
- device->UnlockHWSurfaceRect = DX5_UnlockHWSurface;
device->FlipHWSurface = DX5_FlipHWSurface;
device->FreeHWSurface = DX5_FreeHWSurface;
#ifdef IID_IDirectDrawGammaControl
@@ -1913,43 +1910,6 @@
surface->pixels = ddsd.lpSurface;
return(0);
}
-static int DX5_LockHWSurfaceRect(_THIS, SDL_Surface *surface, SDL_Rect *rect, void **pixels, int *pitch)
-{
- HRESULT result;
- LPDIRECTDRAWSURFACE3 dd_surface;
- DDSURFACEDESC ddsd;
- RECT ddrect;
-
- /* Calculate the lock rectangle */
- ddrect.top = rect->y;
- ddrect.bottom = rect->y+rect->h;
- ddrect.left = rect->x;
- ddrect.right = rect->x+rect->w;
-
- /* Lock and load! */
- dd_surface = surface->hwdata->dd_writebuf;
- memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- result = IDirectDrawSurface3_Lock(dd_surface, &ddrect, &ddsd,
- (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
- if ( result == DDERR_SURFACELOST ) {
- result = IDirectDrawSurface3_Restore(
- surface->hwdata->dd_surface);
- result = IDirectDrawSurface3_Lock(dd_surface, &ddrect, &ddsd,
- (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
- }
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::Lock", result);
- return(-1);
- }
- *pixels = ddsd.lpSurface;
-#if defined(NONAMELESSUNION)
- *pitch = ddsd.u1.lPitch;
-#else
- *pitch = (Uint16)ddsd.lPitch;
-#endif
- return(0);
-}
static void DX5_UnlockHWSurface(_THIS, SDL_Surface *surface)
{