From 205c3f5e8b03a65d6afacbdc1a35da05fba6b9a5 Mon Sep 17 00:00:00 2001 From: Scott McCreary Date: Thu, 12 Mar 2009 05:33:42 +0000 Subject: [PATCH] Added Adrian Panasiuk's fix to the fullscreen, and top/left blacked out areas. --- media-libs/libsdl/SDL-1.2-haiku-2.diff | 188 +++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 media-libs/libsdl/SDL-1.2-haiku-2.diff diff --git a/media-libs/libsdl/SDL-1.2-haiku-2.diff b/media-libs/libsdl/SDL-1.2-haiku-2.diff new file mode 100644 index 000000000..d58cc0d38 --- /dev/null +++ b/media-libs/libsdl/SDL-1.2-haiku-2.diff @@ -0,0 +1,188 @@ +Index: src/video/bwindow/SDL_sysyuv.cc +=================================================================== +--- src/video/bwindow/SDL_sysyuv.cc (revision 4458) ++++ src/video/bwindow/SDL_sysyuv.cc (working copy) +@@ -94,7 +94,7 @@ + + // See [btw: Cb=U, Cr=V] + // See also http://www.fourcc.org/indexyuv.htm +-enum color_space convert_color_space(Uint32 format) { ++color_space convert_color_space(Uint32 format) { + switch (format) { + case SDL_YV12_OVERLAY: + return B_YUV9; +Index: src/video/bwindow/SDL_sysyuv.h +=================================================================== +--- src/video/bwindow/SDL_sysyuv.h (revision 4458) ++++ src/video/bwindow/SDL_sysyuv.h (working copy) +@@ -62,7 +62,7 @@ + }; + + extern BBitmap * BE_GetOverlayBitmap(BRect bounds, color_space cs); +-extern SDL_Overlay* BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display); ++SDL_Overlay* BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display); + extern int BE_LockYUVOverlay(_THIS, SDL_Overlay* overlay); + extern void BE_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay); + extern int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst); +Index: src/video/bwindow/SDL_sysvideo.cc +=================================================================== +--- src/video/bwindow/SDL_sysvideo.cc (revision 4458) ++++ src/video/bwindow/SDL_sysvideo.cc (working copy) +@@ -57,7 +57,7 @@ + static void BE_FreeHWSurface(_THIS, SDL_Surface *surface); + + static int BE_ToggleFullScreen(_THIS, int fullscreen); +-static SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); ++SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); + + /* OpenGL functions */ + #if SDL_VIDEO_OPENGL +@@ -446,8 +446,11 @@ + * of the BBitmap due to the InhibitResize call above. Thus the + * bitmap (pixel data) never changes. + */ +- SDL_Win->ResizeTo(width, height); + bounds = bscreen.Frame(); ++ if (fullscreen) ++ SDL_Win->ResizeTo(bounds.Width(), bounds.Height()); ++ else ++ SDL_Win->ResizeTo(width, height); + /* Calculate offsets - used either to center window + * (windowed mode) or to set drawing offsets (fullscreen mode) + */ +@@ -460,10 +463,13 @@ + } else { + SDL_Win->SetXYOffset(0, 0); + } +- if ( ! needs_unlock || was_fullscreen ) { ++ if ( ! needs_unlock || (was_fullscreen && !fullscreen)) { + /* Center the window the first time */ + SDL_Win->MoveTo(cx, cy); + } ++ if (fullscreen) ++ SDL_Win->MoveTo(0,0); ++ + SDL_Win->Show(); + + /* Unlock the window manually after the first Show() */ +@@ -637,8 +643,12 @@ + int32 cookie = 0; + while (get_next_image_info(0,&cookie,&info) == B_OK) { + void *location = NULL; +- if (get_image_symbol((image_id)cookie,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { +- _this->gl_config.dll_handle = (void*)cookie; ++#ifdef __HAIKU__ ++ if (get_image_symbol(info.id,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { // This is how it actually works in Haiku ++#else ++ if (get_image_symbol((image_id)cookie,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { // I don't know if that *did* work in BeOS ++#endif ++ _this->gl_config.dll_handle = (void*)info.id; + _this->gl_config.driver_loaded = 1; + SDL_strlcpy(_this->gl_config.driver_path, "libGL.so", SDL_arraysize(_this->gl_config.driver_path)); + } +Index: test/configure.in +=================================================================== +--- test/configure.in (revision 4458) ++++ test/configure.in (working copy) +@@ -20,7 +20,7 @@ + MATHLIB="" + SYS_GL_LIBS="-lopengl32" + ;; +- *-*-beos*) ++ *-*-beos* | *-*-haiku*) + EXE="" + MATHLIB="" + SYS_GL_LIBS="-lGL" +Index: test/testplatform.c +=================================================================== +--- test/testplatform.c (revision 4458) ++++ test/testplatform.c (working copy) +@@ -162,6 +162,8 @@ + "Dreamcast" + #elif __FREEBSD__ + "FreeBSD" ++#elif __HAIKU__ ++ "Haiku" + #elif __HPUX__ + "HP-UX" + #elif __IRIX__ +Index: include/begin_code.h +=================================================================== +--- include/begin_code.h (revision 4458) ++++ include/begin_code.h (working copy) +@@ -33,7 +33,7 @@ + + /* Some compilers use a special export keyword */ + #ifndef DECLSPEC +-# if defined(__BEOS__) ++# if defined(__BEOS__) || defined(__HAIKU__) + # if defined(__GNUC__) + # define DECLSPEC __declspec(dllexport) + # else +Index: include/SDL_platform.h +=================================================================== +--- include/SDL_platform.h (revision 4458) ++++ include/SDL_platform.h (working copy) +@@ -33,6 +33,10 @@ + #undef __BEOS__ + #define __BEOS__ 1 + #endif ++#if defined(__HAIKU__) ++#undef __HAIKU__ ++#define __HAIKU__ 1 ++#endif + #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) + #undef __BSDI__ + #define __BSDI__ 1 +@@ -45,6 +49,10 @@ + #undef __FREEBSD__ + #define __FREEBSD__ 1 + #endif ++#if defined(__HAIKU__) ++#undef __HAIKU__ ++#define __HAIKU__ 1 ++#endif + #if defined(hpux) || defined(__hpux) || defined(__hpux__) + #undef __HPUX__ + #define __HPUX__ 1 +Index: configure.in +=================================================================== +--- configure.in (revision 4458) ++++ configure.in (working copy) +@@ -40,7 +40,7 @@ + AC_SUBST(LT_AGE) + + dnl Detect the canonical build and host environments +-AC_CONFIG_AUX_DIRS($srcdir/build-scripts) ++AC_CONFIG_AUX_DIR([build-scripts]) + AC_CANONICAL_HOST + AC_C_BIGENDIAN + if test x$ac_cv_c_bigendian = xyes; then +@@ -2493,7 +2493,7 @@ + SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420" + SDL_LIBS="-lSDLmain $SDL_LIBS" + ;; +- *-*-beos*) ++ *-*-beos* | *-*-haiku*) + ARCH=beos + ac_default_prefix=/boot/develop/tools/gnupro + CheckDummyVideo +@@ -2536,8 +2536,16 @@ + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then +- AC_DEFINE(SDL_LOADSO_BEOS) +- SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c" ++ case "$host" in ++ *-*-beos*) ++ AC_DEFINE(SDL_LOADSO_BEOS) ++ SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c" ++ ;; ++ *-*-haiku*) ++ AC_DEFINE(SDL_LOADSO_DLOPEN) ++ SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c" ++ ;; ++ esac + have_loadso=yes + fi + # The BeOS platform requires special setup.