From 79be73f50733b78752ef35af7534eef7161b7e08 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 23 Aug 2001 20:28:41 +0000 Subject: [PATCH] we now require sdl 1.2 for sdl support --- acinclude.m4 | 96 ------------------------------------ configure.ac | 10 ++-- libs/video/targets/in_sdl.c | 3 -- libs/video/targets/vid_sgl.c | 13 ----- 4 files changed, 5 insertions(+), 117 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 19057763d..25f6e48a1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -184,102 +184,6 @@ int main (int argc, char *argv[]) rm -f conf.sdltest ]) -# Configure paths for SDL-GL -# Jeff Teunissen 11 Aug 2000 -# stolen from Sam Lantinga -# stolen from Manish Singh -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -dnl AM_CHECK_SGL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for SDL 1.1.x, do _not_ redefine any variables. -dnl ***MUST*** be run _after_ checking for SDL 1.0x, if used. -dnl -AC_DEFUN(AM_CHECK_SGL, -[dnl -dnl Get the cflags and libraries from the sdl-config script -dnl - min_sdl_version=ifelse([$1], ,1.1.0,$1) - AC_MSG_CHECKING(whether SDL is version >= $min_sdl_version) - no_sgl="" - if test "$SDL_CONFIG" = "no" ; then - no_sgl=yes - else - SGL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` - SGL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` - - sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SGL_CFLAGS" - LIBS="$LIBS $SGL_LIBS" -dnl -dnl Do nothing more than check if the installed SDL is sufficiently new, since -dnl we already did that in the SDL detection -dnl - AC_TRY_RUN([ -#include -#include -#include -#include - -char* -my_strdup (char *str) -{ - char *new_str; - - if (str) { - new_str = malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } else { - new_str = NULL; - } - - return new_str; -} - -int -main (int argc, char *argv[]) -{ - int major, minor, micro; - char *tmp_version; - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_sdl_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_sdl_version"); - exit(1); - } - - if (($sdl_major_version > major) || - (($sdl_major_version == major) && ($sdl_minor_version > minor)) || - (($sdl_major_version == major) && ($sdl_minor_version == minor) && - ($sdl_micro_version >= micro))) { - return 0; - } else { - return 1; - } -} - -],, no_sgl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - if test "x$no_sgl" = x; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - ifelse([$3], , :, [$3]) - fi -]) - dnl AM_PROG_LEX dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT AC_DEFUN(AM_PROG_LEX, diff --git a/configure.ac b/configure.ac index 5e4020315..0453b035b 100644 --- a/configure.ac +++ b/configure.ac @@ -545,11 +545,11 @@ AC_ARG_ENABLE(sdl, ) if test "x$enable_sdl" != xno; then - AM_PATH_SDL(1.0.1, HAVE_SDL=yes, HAVE_SDL=no) - - if test "x$HAVE_SDL" != xno; then - AM_CHECK_SGL(1.1.1, HAVE_SGL=yes, HAVE_SGL=no) - fi + AM_PATH_SDL(1.2.0, + HAVE_SDL=yes + HAVE_SGL=yes, + HAVE_SDL=no + HAVE_SGL=no) AC_SUBST(HAVE_SDL) AC_SUBST(HAVE_SGL) fi diff --git a/libs/video/targets/in_sdl.c b/libs/video/targets/in_sdl.c index 4a3374397..29d8678b8 100644 --- a/libs/video/targets/in_sdl.c +++ b/libs/video/targets/in_sdl.c @@ -744,12 +744,9 @@ IN_LL_SendKeyEvents (void) case SDLK_MODE: ksym = K_MODE; break; -#if SDL_VERSIONNUM(SDL_MAJOR_VERSION,SDL_MINOR_VERSION,SDL_PATCHLEVEL) \ - >= SDL_VERSIONNUM(1,1,5) case SDLK_COMPOSE: ksym = K_COMPOSE; break; -#endif case SDLK_HELP: ksym = K_HELP; break; diff --git a/libs/video/targets/vid_sgl.c b/libs/video/targets/vid_sgl.c index 08ff02716..9d3f478c4 100644 --- a/libs/video/targets/vid_sgl.c +++ b/libs/video/targets/vid_sgl.c @@ -77,22 +77,12 @@ extern void VID_Init8bitPalette (void); void VID_SDL_GammaCheck (void) { -#if SDL_VERSIONNUM(SDL_MAJOR_VERSION,SDL_MINOR_VERSION,SDL_PATCHLEVEL) \ - >= SDL_VERSIONNUM(1,1,5) -#if SDL_VERSIONNUM(SDL_MAJOR_VERSION,SDL_MINOR_VERSION,SDL_PATCHLEVEL) \ - >= SDL_VERSIONNUM(1,1,6) Uint16 redtable[256], greentable[256], bluetable[256]; -#else - Uint8 redtable[256], greentable[256], bluetable[256]; -#endif if (SDL_GetGammaRamp(redtable, greentable, bluetable) < 0) vid_gamma_avail = false; else vid_gamma_avail = true; -#else - vid_gamma_avail = false; -#endif } void @@ -268,8 +258,5 @@ VID_SetCaption (const char *text) qboolean VID_SetGamma (double gamma) { -#if SDL_VERSIONNUM(SDL_MAJOR_VERSION,SDL_MINOR_VERSION,SDL_PATCHLEVEL) \ - >= SDL_VERSIONNUM(1,1,5) return SDL_SetGamma((float) gamma, (float) gamma, (float) gamma); -#endif }