we now require sdl 1.2 for sdl support

This commit is contained in:
Bill Currie 2001-08-23 20:28:41 +00:00
parent 90849100fe
commit 79be73f507
4 changed files with 5 additions and 117 deletions

View file

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <SDL.h>
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, &micro) != 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,

View file

@ -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

View file

@ -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;

View file

@ -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
}