diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2012-03-24 16:25:42 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2012-03-24 16:25:42 +0000 |
commit | bd9e73ccc750dde42343639e55224facedaab0ca (patch) | |
tree | be28a2ce03a8482346ddff34e3ea10cb6fa83fca /games/scorched3d/files | |
parent | c57053cf0ea711439dd9950ad0ee5d1ae8b11097 (diff) |
Notes
Diffstat (limited to 'games/scorched3d/files')
4 files changed, 206 insertions, 20 deletions
diff --git a/games/scorched3d/files/patch-configure-al.m4 b/games/scorched3d/files/patch-configure-al.m4 index f2ed2880a5f7..73c5ca668787 100644 --- a/games/scorched3d/files/patch-configure-al.m4 +++ b/games/scorched3d/files/patch-configure-al.m4 @@ -1,31 +1,125 @@ ---- configure-al.m4.orig 2009-12-26 18:48:59.000000000 +0100 -+++ configure-al.m4 2009-12-26 18:50:56.000000000 +0100 -@@ -7,25 +7,9 @@ - [ --disable-openaltest Do not try to compile and run a test OpenAL program], - , enable_openaltest=yes) - AC_MSG_CHECKING(for OpenAL support) +--- configure-al.m4.orig 2011-12-31 23:51:36.000000000 +0900 ++++ configure-al.m4 2012-03-08 02:09:57.000000000 +0900 +@@ -1,118 +1,8 @@ + dnl Checking for OpenAL +-AC_ARG_WITH([openal-static], +- AC_HELP_STRING([--with-openal-static], +- [enable static linking for openal (default no)]), +- [use_static_openal=${withval}],,) +-AC_ARG_ENABLE(openaltest, +- [ --disable-openaltest Do not try to compile and run a test OpenAL program], +- , enable_openaltest=yes) +-AC_MSG_CHECKING(for OpenAL support) -AC_PATH_PROG(OPENAL_CONFIG, openal-config, no) -if test x$OPENAL_CONFIG = xno; then -- echo "*** The openal-config script installed by OpenAL could not be found" -- echo "*** Make sure openal-config is in your path, or set the OPENAL_CONFIG" -- echo "*** environment variable to the full path to openal-config." +- echo "The openal-config script installed by OpenAL could not be found" +- echo "Make sure openal-config is in your path, or set the OPENAL_CONFIG" +- echo "environment variable to the full path to openal-config." +- echo "Trying pkg-config instead." - -- AC_MSG_ERROR([*** Can't find the openal library. Try: http://www.openal.org/]) --else +- AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +- if test x$PKG_CONFIG = xno; then +- echo "The pkg-config script could not be found" +- echo "Make sure pkg-config is in your path, or set the PKG_CONFIG" +- echo "environment variable to the full path to pkg-config." - -- if test x"$use_static_openal" = x"yes"; then -- AL_LIBS="/usr/local/lib/libopenal.a" +- AC_MSG_ERROR([*** Can't find the openal library. Try: http://www.openal.org/]) - else -- AL_LIBS="`$OPENAL_CONFIG --libs`" +- OPENAL_CONFIG="$PKG_CONFIG openal"; - fi +-fi - -- AL_CFLAGS="`$OPENAL_CONFIG --cflags`" +-if test x"$use_static_openal" = x"yes"; then +- AL_LIBS="/usr/local/lib/libopenal.a" +-else +- AL_LIBS="`$OPENAL_CONFIG --libs`" +-fi +- +-AL_CFLAGS="`$OPENAL_CONFIG --cflags`" +- +-AC_MSG_RESULT(yes) +- +-AC_MSG_CHECKING(for Freealut support) +-AC_PATH_PROG(FREEALUT_CONFIG, freealut-config, no) +-if test x$FREEALUT_CONFIG = xno; then +- echo "*** Warning: The freealut-config script installed by OpenAL could not be found." +- echo "*** The alut library is required, however some older OpenAL distribitions may include it." +- echo "*** If Scorched3D fails to link check alut is in the link line." +- echo "*** Alternatively, make sure freealut-config is in your path, or set the FREEALUT_CONFIG" +- echo "*** environment variable to the full path to openal-config." +-else +- +- AL_LIBS="$AL_LIBS `$FREEALUT_CONFIG --libs`" +- AL_CFLAGS="$AL_CFLAGS `$FREEALUT_CONFIG --cflags`" - - AC_MSG_RESULT(yes) -fi -+AL_LIBS="`pkg-config --libs openal`" -+AL_CFLAGS="`pkg-config --cflags openal`" -+AC_MSG_RESULT(yes) +- +-AC_MSG_CHECKING(for OpenAL compilation) +-if test "x$enable_openaltest" = "xyes" ; then +- +- ac_save_CFLAGS="$CFLAGS" +- ac_save_LIBS="$LIBS" +- CFLAGS="$CFLAGS $AL_CFLAGS" +- LIBS="$AL_LIBS $LIBS" +- +- AC_TRY_COMPILE([ +-#ifdef __APPLE__ +- #include <OpenAL/al.h> +- #include <OpenAL/alc.h> +-#else +- #include <AL/al.h> +- #include <AL/alut.h> +- #include <AL/alc.h> +-#endif +- +- ],[ +- ],[ +- have_openal=yes +- ],[ +- echo "*** Failed to compile using the OpenAL library." +- echo "*** CFLAGS = $AL_CFLAGS"; +- AC_MSG_ERROR([*** Check the OpenAL library is correctly installed.]) +- ]) +- +- AC_TRY_LINK([ +-#ifdef __APPLE__ +- #include <OpenAL/al.h> +- #include <OpenAL/alc.h> +-#else +- #include <AL/al.h> +- #include <AL/alut.h> +- #include <AL/alc.h> +-#endif +- +- int main(int argc, char *argv[]) +- { +- alutInit(argc, argv); +- return 0; +- } +-#undef main +-#define main K_and_R_C_main +- +- ],[ +- ],[ +- have_openal=yes +- ],[ +- echo "*** Compiled but failed to link using the OpenAL library." +- echo "*** LIBS = $AL_LIBS"; +- echo "*** Check the OpenAL library is on the LD_LIBRARY_PATH"; +- AC_MSG_ERROR([*** Check the OpenAL library is correctly installed.]) +- ]) +- +- CFLAGS="$ac_save_CFLAGS" +- LIBS="$ac_save_LIBS" +- +- AC_MSG_RESULT(yes) +-fi +- ++PKG_CHECK_MODULES([OPENAL], [openal]) ++PKG_CHECK_MODULES([FREEALUT], [freealut]) ++AL_CFLAGS="$OPENAL_CFLAGS $FREEALUT_CFLAGS" ++AL_LIBS="$OPENAL_LIBS $FREEALUT_LIBS" + AC_SUBST(AL_CFLAGS) + AC_SUBST(AL_LIBS) - AC_MSG_CHECKING(for Freealut support) - AC_PATH_PROG(FREEALUT_CONFIG, freealut-config, no) diff --git a/games/scorched3d/files/patch-src__client__client__LoadPNG.cpp b/games/scorched3d/files/patch-src__client__client__LoadPNG.cpp new file mode 100644 index 000000000000..8db4ee8ad643 --- /dev/null +++ b/games/scorched3d/files/patch-src__client__client__LoadPNG.cpp @@ -0,0 +1,63 @@ +--- src/client/client/LoadPNG.cpp.orig 2010-08-16 08:26:36.000000000 +0900 ++++ src/client/client/LoadPNG.cpp 2012-03-07 19:25:24.000000000 +0900 +@@ -28,6 +28,8 @@ + int row, i; + volatile int ckey = -1; + png_color_16 *transv; ++ png_colorp png_palette; ++ int num_palette; + + if ( !src ) { + /* The error message has been set in SDL_RWFromFile */ +@@ -58,7 +60,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in png_create_read_struct() earlier. + */ +- if ( setjmp(png_ptr->jmpbuf) ) { ++ if ( setjmp(png_jmpbuf(png_ptr)) ) { + error = "Error reading the PNG file."; + goto done; + } +@@ -127,9 +129,9 @@ + Rmask = 0x000000FF; + Gmask = 0x0000FF00; + Bmask = 0x00FF0000; +- Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0; ++ Amask = (png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0; + } else { +- int s = (info_ptr->channels == 4) ? 0 : 8; ++ int s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8; + Rmask = 0xFF000000 >> s; + Gmask = 0x00FF0000 >> s; + Bmask = 0x0000FF00 >> s; +@@ -137,7 +139,7 @@ + } + } + surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, +- bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask); ++ bit_depth*png_get_channels(png_ptr, info_ptr), Rmask,Gmask,Bmask,Amask); + if ( surface == NULL ) { + error = "Out of memory"; + goto done; +@@ -185,12 +187,15 @@ + palette->colors[i].g = i; + palette->colors[i].b = i; + } +- } else if (info_ptr->num_palette > 0 ) { +- palette->ncolors = info_ptr->num_palette; +- for( i=0; i<info_ptr->num_palette; ++i ) { +- palette->colors[i].b = info_ptr->palette[i].blue; +- palette->colors[i].g = info_ptr->palette[i].green; +- palette->colors[i].r = info_ptr->palette[i].red; ++ } else { ++ png_get_PLTE(png_ptr, info_ptr, &png_palette, &num_palette); ++ if (num_palette > 0 ) { ++ palette->ncolors = num_palette; ++ for( i=0; i<num_palette; ++i ) { ++ palette->colors[i].b = png_palette[i].blue; ++ palette->colors[i].g = png_palette[i].green; ++ palette->colors[i].r = png_palette[i].red; ++ } + } + } + } diff --git a/games/scorched3d/files/patch-src__common__image__ImagePngFactory.cpp b/games/scorched3d/files/patch-src__common__image__ImagePngFactory.cpp new file mode 100644 index 000000000000..43ad7a9ca254 --- /dev/null +++ b/games/scorched3d/files/patch-src__common__image__ImagePngFactory.cpp @@ -0,0 +1,11 @@ +--- src/common/image/ImagePngFactory.cpp.orig 2012-01-10 09:52:15.000000000 +0900 ++++ src/common/image/ImagePngFactory.cpp 2012-03-07 18:31:12.000000000 +0900 +@@ -62,7 +62,7 @@ +
+ static void user_png_error(png_structp png_ptr, png_const_charp msg)
+ {
+- longjmp(png_ptr->jmpbuf,1);
++ longjmp(png_jmpbuf(png_ptr),1);
+ }
+
+ static void user_png_warning(png_structp png_ptr, png_const_charp msg)
diff --git a/games/scorched3d/files/patch-src__common__porting__windows.h b/games/scorched3d/files/patch-src__common__porting__windows.h new file mode 100644 index 000000000000..7c591c924c22 --- /dev/null +++ b/games/scorched3d/files/patch-src__common__porting__windows.h @@ -0,0 +1,18 @@ +--- src/common/porting/windows.h.orig 2008-03-03 03:47:36.000000000 +0900 ++++ src/common/porting/windows.h 2012-03-07 18:29:31.000000000 +0900 +@@ -9,6 +9,7 @@ + #include <ctype.h>
+ #include <common/Defines.h>
+
++#if defined(_WIN32)
+ typedef char * LPSTR;
+ typedef const char * LPCTSTR;
+ typedef unsigned int DWORD;
+@@ -27,6 +28,7 @@ + typedef int LRESULT;
+ typedef void * HDC;
+ typedef void * HGLRC;
++#endif
+
+ #define _strnicmp(a,b,c) strncasecmp(a,b,c)
+ #define stricmp(a,b) strcasecmp(a,b)
|