diff --git a/Makefile.in b/Makefile.in index 82f4d0c..30fb033 100644 --- a/Makefile.in +++ b/Makefile.in @@ -102,7 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -322,8 +322,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/aclocal.m4 b/aclocal.m4 index c54dafe..01dbba5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1447,5 +1447,5 @@ m4_include([macros/ltversion.m4]) m4_include([macros/lt~obsolete.m4]) m4_include([macros/ogg.m4]) m4_include([macros/progtest.m4]) -m4_include([macros/sdl.m4]) +m4_include([macros/sdl2.m4]) m4_include([macros/vorbis.m4]) diff --git a/config.h.in b/config.h.in index 33e1af1..6753ba0 100644 --- a/config.h.in +++ b/config.h.in @@ -186,12 +186,6 @@ /* define this if you use SDL joystick interface */ #undef HAVE_SDLJOY -/* define this if you have SDLRALPHA */ -#undef HAVE_SDLRALPHA - -/* define this if you have SDLRLE */ -#undef HAVE_SDLRLE - /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD diff --git a/configure b/configure index 453f800..8f7aa26 100755 --- a/configure +++ b/configure @@ -665,9 +665,9 @@ FT2_CONFIG JOY_S SRC_GRAPHDEV SDL +SDL2_CONFIG SDL_LIBS SDL_CFLAGS -SDL_CONFIG SRC_MIDI SRC_CDROM SRC_AUDIO @@ -929,7 +929,9 @@ CPP XMKMF PKG_CONFIG PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR' +PKG_CONFIG_LIBDIR +SDL_CFLAGS +SDL_LIBS' ac_subdirs_all='libltdl' # Initialize some variables set by options. @@ -1670,6 +1672,8 @@ Some influential environment variables: directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path + SDL_CFLAGS C compiler flags for SDL, overriding pkg-config + SDL_LIBS linker flags for SDL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -17093,9 +17097,6 @@ else fi if test "x$enable_sdl" = xyes ; then - KEEPLIBS=$LIBS - KEEPCFLAGS=$CFLAGS - KEEPLDFLAGS=$LDFLAGS # Check whether --with-sdl-prefix was given. if test "${with_sdl_prefix+set}" = set; then : @@ -17120,33 +17121,114 @@ else fi - if test x$sdl_exec_prefix != x ; then - sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + min_sdl_version=2.0.0 + + if test "x$sdl_prefix$sdl_exec_prefix" = x ; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL" >&5 +$as_echo_n "checking for SDL... " >&6; } + +if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2 >= $min_sdl_version" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2 >= $min_sdl_version" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl2 >= $min_sdl_version" 2>&1` + else + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl2 >= $min_sdl_version" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_PKG_ERRORS" >&5 + + sdl_pc=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + sdl_pc=no +else + SDL_CFLAGS=$pkg_cv_SDL_CFLAGS + SDL_LIBS=$pkg_cv_SDL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + sdl_pc=yes +fi + else + sdl_pc=no + if test x$sdl_exec_prefix != x ; then + sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + fi fi - fi - if test x$sdl_prefix != x ; then - sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_prefix/bin/sdl-config + if test x$sdl_prefix != x ; then + sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + fi fi fi - as_save_PATH="$PATH" - if test "x$prefix" != xNONE; then - PATH="$prefix/bin:$prefix/usr/bin:$PATH" - fi - # Extract the first word of "sdl-config", so it can be a program name with args. -set dummy sdl-config; ac_word=$2 + if test "x$sdl_pc" = xyes ; then + no_sdl="" + SDL2_CONFIG="pkg-config sdl2" + else + as_save_PATH="$PATH" + if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + fi + # Extract the first word of "sdl2-config", so it can be a program name with args. +set dummy sdl2-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SDL_CONFIG+:} false; then : +if ${ac_cv_path_SDL2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - case $SDL_CONFIG in + case $SDL2_CONFIG in [\\/]* | ?:[\\/]*) - ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. + ac_cv_path_SDL2_CONFIG="$SDL2_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -17156,7 +17238,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_SDL2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -17164,44 +17246,44 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" + test -z "$ac_cv_path_SDL2_CONFIG" && ac_cv_path_SDL2_CONFIG="no" ;; esac fi -SDL_CONFIG=$ac_cv_path_SDL_CONFIG -if test -n "$SDL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL_CONFIG" >&5 -$as_echo "$SDL_CONFIG" >&6; } +SDL2_CONFIG=$ac_cv_path_SDL2_CONFIG +if test -n "$SDL2_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL2_CONFIG" >&5 +$as_echo "$SDL2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - PATH="$as_save_PATH" - min_sdl_version=1.0.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL - version >= $min_sdl_version" >&5 + PATH="$as_save_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL - version >= $min_sdl_version" >&5 $as_echo_n "checking for SDL - version >= $min_sdl_version... " >&6; } - no_sdl="" - if test "$SDL_CONFIG" = "no" ; then - no_sdl=yes - else - SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs` + no_sdl="" - sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - sdl_minor_version=`$SDL_CONFIG $sdl_config_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/'` - if test "x$enable_sdltest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" + if test "$SDL2_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + + sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" rm -f conf.sdltest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" @@ -17255,11 +17337,11 @@ int main (int argc, char *argv[]) } else { - printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); - printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); + printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } @@ -17276,23 +17358,27 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi fi if test "x$no_sdl" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } have_sdl=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "$SDL_CONFIG" = "no" ; then - echo "*** The sdl-config script installed by SDL could not be found" + if test "$SDL2_CONFIG" = "no" ; then + echo "*** The sdl2-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL_CONFIG environment variable to the" - echo "*** full path to sdl-config." + echo "*** your path, or set the SDL2_CONFIG environment variable to the" + echo "*** full path to sdl2-config." else if test -f conf.sdltest ; then : @@ -17334,7 +17420,7 @@ else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl-config script: $SDL_CONFIG" + echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -17393,82 +17479,6 @@ if test "x$ac_cv_lib_SDL_SDL_NumJoysticks" = xyes; then : have_sdljoy=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL RLE accell" >&5 -$as_echo_n "checking for SDL RLE accell... " >&6; } - sdlrle=no - sdlralpha=no - if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"unknown\"" >&5 -$as_echo "\"unknown\"" >&6; } - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int main( int argc,char **argv) { -#ifndef SDL_RLEACCEL - exit(1); -#else - exit(0); -#endif -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"yes\"" >&5 -$as_echo "\"yes\"" >&6; };sdlrle=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5 -$as_echo "\"no\"" >&6; } -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - if test "x$sdlrle" = xyes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL alpha value" >&5 -$as_echo_n "checking for SDL alpha value... " >&6; } - if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"unknown\"" >&5 -$as_echo "\"unknown\"" >&6; } - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int main( int argc,char **argv) { - SDL_Surface *s1,*s2; - unsigned short *x; - s1=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); - s2=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); - SDL_FillRect(s1,NULL,0); - SDL_FillRect(s2,NULL,0xFFFF); - SDL_SetAlpha(s2,SDL_SRCALPHA|SDL_RLEACCEL,255); - SDL_BlitSurface(s2,NULL,s1,NULL); - x=s1->pixels; - if( *x ) - exit(1); - exit(0); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"normal\"" >&5 -$as_echo "\"normal\"" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"revese\"" >&5 -$as_echo "\"revese\"" >&6; };sdlralpha=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi - LIBS=$KEEPLIBS - CFLAGS=$KEEPCFLAGS - LDFLAGS=$KEEPLDFLAGS fi if test "x$have_sdl" = xyes ; then @@ -17477,16 +17487,6 @@ $as_echo "#define ENABLE_SDL 1" >>confdefs.h SDL=1 SRC_GRAPHDEV="sdl_video.c sdl_mode.c sdl_draw.c sdl_event.c sdl_image.c sdl_cursor.c image.c" - if test "x$sdlrle" = xyes ; then - -$as_echo "#define HAVE_SDLRLE 1" >>confdefs.h - - fi - if test "x$sdlralpha" = xyes ; then - -$as_echo "#define HAVE_SDLRALPHA 1" >>confdefs.h - - fi fi diff --git a/configure.ac b/configure.ac index 90e07fb..c4eb65a 100644 --- a/configure.ac +++ b/configure.ac @@ -605,63 +605,16 @@ AC_ARG_ENABLE(sdl, [ --enable-sdl SDL [default=no] ],, [ enable_sdl=no ]) if test "x$enable_sdl" = xyes ; then - KEEPLIBS=$LIBS - KEEPCFLAGS=$CFLAGS - KEEPLDFLAGS=$LDFLAGS - AM_PATH_SDL(1.0.0,have_sdl=yes,have_sdl=no) + AM_PATH_SDL2(2.0.0,have_sdl=yes,have_sdl=no) LIBS=$SDL_LIBS CFLAGS=$SDL_CFLAGS AC_CHECK_LIB(SDL,SDL_NumJoysticks,have_sdljoy=yes) - AC_MSG_CHECKING(for SDL RLE accell) - sdlrle=no - sdlralpha=no - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -int main( int argc,char **argv) { -#ifndef SDL_RLEACCEL - exit(1); -#else - exit(0); -#endif -} - ]])],[AC_MSG_RESULT("yes");sdlrle=yes],[AC_MSG_RESULT("no")],[AC_MSG_RESULT("unknown") - ]) - if test "x$sdlrle" = xyes ; then - AC_MSG_CHECKING(for SDL alpha value) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -int main( int argc,char **argv) { - SDL_Surface *s1,*s2; - unsigned short *x; - s1=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); - s2=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); - SDL_FillRect(s1,NULL,0); - SDL_FillRect(s2,NULL,0xFFFF); - SDL_SetAlpha(s2,SDL_SRCALPHA|SDL_RLEACCEL,255); - SDL_BlitSurface(s2,NULL,s1,NULL); - x=s1->pixels; - if( *x ) - exit(1); - exit(0); -} - ]])],[AC_MSG_RESULT("normal")],[AC_MSG_RESULT("revese");sdlralpha=yes],[AC_MSG_RESULT("unknown") - ]) - fi - LIBS=$KEEPLIBS - CFLAGS=$KEEPCFLAGS - LDFLAGS=$KEEPLDFLAGS fi if test "x$have_sdl" = xyes ; then AC_DEFINE(ENABLE_SDL,1,[define this if you use SDL]) SDL=1 SRC_GRAPHDEV="sdl_video.c sdl_mode.c sdl_draw.c sdl_event.c sdl_image.c sdl_cursor.c image.c" AC_SUBST(SDL) - if test "x$sdlrle" = xyes ; then - AC_DEFINE(HAVE_SDLRLE,1,[define this if you have SDLRLE]) - fi - if test "x$sdlralpha" = xyes ; then - AC_DEFINE(HAVE_SDLRALPHA,1,[define this if you have SDLRALPHA]) - fi fi AC_SUBST(SRC_GRAPHDEV) diff --git a/macros/Makefile.am b/macros/Makefile.am index fd3110b..5fcbc82 100644 --- a/macros/Makefile.am +++ b/macros/Makefile.am @@ -29,7 +29,7 @@ MACROS= \ ltversion.m4 \ ogg.m4 \ progtest.m4 \ - sdl.m4 \ + sdl2.m4 \ stdint_h.m4 \ uintmax_t.m4 \ ulonglong.m4 \ diff --git a/macros/Makefile.in b/macros/Makefile.in index d066332..9b6aa93 100644 --- a/macros/Makefile.in +++ b/macros/Makefile.in @@ -97,7 +97,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -237,8 +237,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -355,7 +355,7 @@ MACROS = \ ltversion.m4 \ ogg.m4 \ progtest.m4 \ - sdl.m4 \ + sdl2.m4 \ stdint_h.m4 \ uintmax_t.m4 \ ulonglong.m4 \ diff --git a/macros/sdl.m4 b/macros/sdl2.m4 similarity index 55% rename from macros/sdl.m4 rename to macros/sdl2.m4 index 639eb85..a03b2d2 100644 --- a/macros/sdl.m4 +++ b/macros/sdl2.m4 @@ -7,12 +7,12 @@ # serial 1 -dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl -AC_DEFUN([AM_PATH_SDL], +AC_DEFUN([AM_PATH_SDL2], [dnl -dnl Get the cflags and libraries from the sdl-config script +dnl Get the cflags and libraries from the sdl2-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") @@ -21,50 +21,63 @@ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , enable_sdltest=yes) - if test x$sdl_exec_prefix != x ; then - sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config - fi - fi - if test x$sdl_prefix != x ; then - sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_prefix/bin/sdl-config - fi - fi + min_sdl_version=ifelse([$1], ,2.0.0,$1) - as_save_PATH="$PATH" - if test "x$prefix" != xNONE; then - PATH="$prefix/bin:$prefix/usr/bin:$PATH" - fi - AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH]) - PATH="$as_save_PATH" - min_sdl_version=ifelse([$1], ,0.11.0,$1) - AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) - no_sdl="" - if test "$SDL_CONFIG" = "no" ; then - no_sdl=yes + if test "x$sdl_prefix$sdl_exec_prefix" = x ; then + PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version], + [sdl_pc=yes], + [sdl_pc=no]) else - SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs` + sdl_pc=no + if test x$sdl_exec_prefix != x ; then + sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + fi + fi + fi - sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL_CONFIG $sdl_config_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/'` - if test "x$enable_sdltest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" + if test "x$sdl_pc" = xyes ; then + no_sdl="" + SDL2_CONFIG="pkg-config sdl2" + else + as_save_PATH="$PATH" + if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + fi + AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH]) + PATH="$as_save_PATH" + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + + if test "$SDL2_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + + sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity -dnl checks the results of sdl-config to some extent +dnl checks the results of sdl2-config to some extent dnl rm -f conf.sdltest AC_TRY_RUN([ @@ -114,32 +127,36 @@ int main (int argc, char *argv[]) } else { - printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); - printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); + printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi fi if test "x$no_sdl" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) + ifelse([$2], , :, [$2]) else - AC_MSG_RESULT(no) - if test "$SDL_CONFIG" = "no" ; then - echo "*** The sdl-config script installed by SDL could not be found" + if test "$SDL2_CONFIG" = "no" ; then + echo "*** The sdl2-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL_CONFIG environment variable to the" - echo "*** full path to sdl-config." + echo "*** your path, or set the SDL2_CONFIG environment variable to the" + echo "*** full path to sdl2-config." else if test -f conf.sdltest ; then : @@ -169,7 +186,7 @@ int main(int argc, char *argv[]) [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" diff --git a/modules/AliceLogo/Makefile.in b/modules/AliceLogo/Makefile.in index 83e5b30..858acfb 100644 --- a/modules/AliceLogo/Makefile.in +++ b/modules/AliceLogo/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/Confirm/Makefile.in b/modules/Confirm/Makefile.in index d6c1b77..8867eb4 100644 --- a/modules/Confirm/Makefile.in +++ b/modules/Confirm/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/Gpx/Makefile.in b/modules/Gpx/Makefile.in index 5e4657c..dce6276 100644 --- a/modules/Gpx/Makefile.in +++ b/modules/Gpx/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/Makefile.in b/modules/Makefile.in index 16952a8..40e7ba4 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -97,7 +97,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -297,8 +297,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/Math/Makefile.in b/modules/Math/Makefile.in index 0d276eb..d18b32a 100644 --- a/modules/Math/Makefile.in +++ b/modules/Math/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/MsgSkip/Makefile.in b/modules/MsgSkip/Makefile.in index 900bf2f..3fef343 100644 --- a/modules/MsgSkip/Makefile.in +++ b/modules/MsgSkip/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -323,8 +323,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/NIGHTDLL/Makefile.in b/modules/NIGHTDLL/Makefile.in index 77d0858..1c76152 100644 --- a/modules/NIGHTDLL/Makefile.in +++ b/modules/NIGHTDLL/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -320,8 +320,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/NightDemonDemo/Makefile.in b/modules/NightDemonDemo/Makefile.in index 4d4a2ab..4c5d43b 100644 --- a/modules/NightDemonDemo/Makefile.in +++ b/modules/NightDemonDemo/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -319,8 +319,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/RandMT/Makefile.in b/modules/RandMT/Makefile.in index 9bc4db4..d4933f3 100644 --- a/modules/RandMT/Makefile.in +++ b/modules/RandMT/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/SACT/Makefile.in b/modules/SACT/Makefile.in index e06da5f..1a68d17 100644 --- a/modules/SACT/Makefile.in +++ b/modules/SACT/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -324,8 +324,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/ShArray/Makefile.in b/modules/ShArray/Makefile.in index a5f942b..7a9629c 100644 --- a/modules/ShArray/Makefile.in +++ b/modules/ShArray/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/ShCalc/Makefile.in b/modules/ShCalc/Makefile.in index 07246d6..9d709bd 100644 --- a/modules/ShCalc/Makefile.in +++ b/modules/ShCalc/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/ShGraph/Makefile.in b/modules/ShGraph/Makefile.in index ed8046a..afe84f3 100644 --- a/modules/ShGraph/Makefile.in +++ b/modules/ShGraph/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/ShPort/Makefile.in b/modules/ShPort/Makefile.in index 58e6a5b..7e95481 100644 --- a/modules/ShPort/Makefile.in +++ b/modules/ShPort/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/ShSound/Makefile.in b/modules/ShSound/Makefile.in index 18496db..4ddfeea 100644 --- a/modules/ShSound/Makefile.in +++ b/modules/ShSound/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/ShString/Makefile.in b/modules/ShString/Makefile.in index 5269f4c..eca467d 100644 --- a/modules/ShString/Makefile.in +++ b/modules/ShString/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/dDemo/Makefile.in b/modules/dDemo/Makefile.in index 214d1c5..dc0904e 100644 --- a/modules/dDemo/Makefile.in +++ b/modules/dDemo/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/eDemo/Makefile.in b/modules/eDemo/Makefile.in index d77fa35..c17e843 100644 --- a/modules/eDemo/Makefile.in +++ b/modules/eDemo/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/eeDemo/Makefile.in b/modules/eeDemo/Makefile.in index f3aa510..87a1198 100644 --- a/modules/eeDemo/Makefile.in +++ b/modules/eeDemo/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/lib/Makefile.in b/modules/lib/Makefile.in index 588c7c7..ccc538c 100644 --- a/modules/lib/Makefile.in +++ b/modules/lib/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -302,8 +302,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/nDEMO/Makefile.in b/modules/nDEMO/Makefile.in index 57ea6ec..3a8f4ff 100644 --- a/modules/nDEMO/Makefile.in +++ b/modules/nDEMO/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/nDEMOE/Makefile.in b/modules/nDEMOE/Makefile.in index 7c36037..2ceeb60 100644 --- a/modules/nDEMOE/Makefile.in +++ b/modules/nDEMOE/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/oDEMO/Makefile.in b/modules/oDEMO/Makefile.in index 2d0be93..d69bb70 100644 --- a/modules/oDEMO/Makefile.in +++ b/modules/oDEMO/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/oujimisc/Makefile.in b/modules/oujimisc/Makefile.in index 53f88a1..d7d51be 100644 --- a/modules/oujimisc/Makefile.in +++ b/modules/oujimisc/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/modules/tDemo/Makefile.in b/modules/tDemo/Makefile.in index 25071bf..ea142a7 100644 --- a/modules/tDemo/Makefile.in +++ b/modules/tDemo/Makefile.in @@ -98,7 +98,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -317,8 +317,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/src/Makefile.in b/src/Makefile.in index b4b82dc..274c1f1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -103,7 +103,7 @@ am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ - $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/macros/sdl2.m4 $(top_srcdir)/macros/vorbis.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -329,8 +329,8 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL = @SDL@ +SDL2_CONFIG = @SDL2_CONFIG@ SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/src/font_sdlttf.c b/src/font_sdlttf.c index 82df508..f346871 100644 --- a/src/font_sdlttf.c +++ b/src/font_sdlttf.c @@ -1,7 +1,7 @@ #include "config.h" -#include -#include +#include +#include #include "portab.h" #include "system.h" diff --git a/src/joystick_sdl.c b/src/joystick_sdl.c index 27e74ee..b2f7397 100644 --- a/src/joystick_sdl.c +++ b/src/joystick_sdl.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "portab.h" #include "joystick.h" diff --git a/src/sdl_core.h b/src/sdl_core.h index 6e87175..da81cbb 100644 --- a/src/sdl_core.h +++ b/src/sdl_core.h @@ -25,7 +25,7 @@ #include "config.h" #include -#include +#include #include "portab.h" #include "ags.h" #include "cursor.h" diff --git a/src/sdl_cursor.c b/src/sdl_cursor.c index bd3feb8..e692fa3 100644 --- a/src/sdl_cursor.c +++ b/src/sdl_cursor.c @@ -23,7 +23,7 @@ #include "config.h" #include -#include +#include #include "portab.h" #include "system.h" @@ -149,7 +149,7 @@ boolean sdl_cursorNew(BYTE* data, int no, CursorImage *cursorImage, TCursorDirEn /* マウスの位置の移動 */ void sdl_setCursorLocation(int x, int y) { - if (ms_active) SDL_WarpMouse(x, y); + if (ms_active) SDL_WarpMouseInWindow(sdl_window, x, y); } /* マウスカーソルの形状の設定 */ diff --git a/src/sdl_draw.c b/src/sdl_draw.c index 6795048..66ddb88 100644 --- a/src/sdl_draw.c +++ b/src/sdl_draw.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include "portab.h" @@ -61,6 +61,14 @@ static void sdl_pal_check(void) { } } +void sdl_updateScreen(void) { + SDL_Texture *texture = SDL_CreateTextureFromSurface(sdl_renderer, sdl_display); + SDL_RenderClear(sdl_renderer); + SDL_RenderCopy(sdl_renderer, texture, NULL, NULL); + SDL_RenderPresent(sdl_renderer); + SDL_DestroyTexture(texture); +} + /* off-screen の指定領域を Main Window へ転送 */ void sdl_updateArea(MyRectangle *src, MyPoint *dst) { SDL_Rect rect_s, rect_d; @@ -70,8 +78,7 @@ void sdl_updateArea(MyRectangle *src, MyPoint *dst) { SDL_BlitSurface(sdl_dib, &rect_s, sdl_display, &rect_d); - SDL_UpdateRect(sdl_display, winoffset_x + dst->x, winoffset_y + dst->y, - src->width, src->height); + sdl_updateScreen(); } /* 全画面更新 */ @@ -81,9 +88,8 @@ static void sdl_updateAll() { setRect(rect, winoffset_x, winoffset_y, view_w, view_h); SDL_BlitSurface(sdl_dib, &sdl_view, sdl_display, &rect); - - SDL_UpdateRect(sdl_display, 0, 0, 0, 0); + sdl_updateScreen(); } /* Color の複数個指定 */ @@ -97,7 +103,7 @@ void sdl_setPallet(Pallet256 *pal, int src, int cnt) { } if (sdl_dib->format->BitsPerPixel == 8) { - SDL_SetColors(sdl_dib, sdl_col, src, cnt); + SDL_SetPaletteColors(sdl_dib->format->palette, sdl_col, src, cnt); } } @@ -162,13 +168,13 @@ void sdl_copyAreaSP(int sx, int sy, int w, int h, int dx, int dy, int sp) { sdl_col[sp].b & 0xf8); } - SDL_SetColorKey(sdl_dib, SDL_SRCCOLORKEY, sp); + SDL_SetColorKey(sdl_dib, SDL_TRUE, sp); setRect(r_src, sx, sy, w, h); setRect(r_dst, dx, dy, w, h); SDL_BlitSurface(sdl_dib, &r_src, sdl_dib, &r_dst); - SDL_SetColorKey(sdl_dib, 0, 0); + SDL_SetColorKey(sdl_dib, SDL_FALSE, 0); } void sdl_drawImage8_fromData(cgdata *cg, int dx, int dy, int w, int h) { @@ -220,7 +226,7 @@ void sdl_drawImage8_fromData(cgdata *cg, int dx, int dy, int w, int h) { } if (cg->spritecolor != -1) { - SDL_SetColorKey(s, SDL_SRCCOLORKEY, cg->spritecolor); + SDL_SetColorKey(s, SDL_TRUE, cg->spritecolor); } setRect(r_src, 0, 0, w, h); @@ -309,7 +315,7 @@ static SDL_Surface *com2alphasurface(agsurface_t *src, int cl) { #endif for (x = 0; x < src->width; x++) { - *dp = R_ALPHA(*sp); + *dp = *sp; sp++; dp += s->format->BytesPerPixel; } @@ -347,7 +353,7 @@ int sdl_drawString(int x, int y, char *msg, u_long col) { memcpy(src->format->palette->colors + i, &sdl_col[col], sizeof(SDL_Color)); } - SDL_SetColorKey(src, SDL_SRCCOLORKEY, 0); + SDL_SetColorKey(src, SDL_TRUE, 0); SDL_BlitSurface(src, &r_src, sdl_dib, &r_dst); SDL_FreeSurface(src); } @@ -378,7 +384,7 @@ static void setBligtness(SDL_Surface *s, int val) { cl->b = (val * (*(b++))) / 255; cl++; } - SDL_SetColors(s, sdl_col, 0, 256); + SDL_SetPaletteColors(s->format->palette, sdl_col, 0, 256); } static void setWhiteness(SDL_Surface *s, int val) { @@ -393,7 +399,7 @@ static void setWhiteness(SDL_Surface *s, int val) { cl->b = (((255- *b) * val) / 256) + *b; b++; cl++; } - SDL_SetColors(s, sdl_col, 0, 256); + SDL_SetPaletteColors(s->format->palette, sdl_col, 0, 256); } static void fader_in(int n) { @@ -433,7 +439,7 @@ static void fader_in(int n) { SDL_UnlockSurface(sdl_display); SDL_UnlockSurface(s_fader); - SDL_UpdateRect(sdl_display,0,0,0,0); + sdl_updateScreen(); } static void fader_out(int n,Uint32 c) { @@ -455,7 +461,7 @@ static void fader_out(int n,Uint32 c) { SDL_UnlockSurface(sdl_display); - SDL_UpdateRect(sdl_display,0,0,0,0); + sdl_updateScreen(); } static __inline void sdl_fade_blit(void) { @@ -463,13 +469,11 @@ static __inline void sdl_fade_blit(void) { setRect(r_dst, winoffset_x, winoffset_y, view_w, view_h); SDL_BlitSurface(sdl_dib, &sdl_view, sdl_display, &r_dst); - SDL_UpdateRect(sdl_display, 0, 0, view_w, view_h); + sdl_updateScreen(); } void sdl_fadeIn(int step) { - if (sdl_display->flags & SDL_HWPALETTE) { - setBligtness(sdl_display, fadestep[step]); - } else if (sdl_dib->format->BitsPerPixel == 8) { + if (sdl_dib->format->BitsPerPixel == 8) { setBligtness(sdl_dib, fadestep[step]); sdl_fade_blit(); } else { @@ -478,9 +482,7 @@ void sdl_fadeIn(int step) { } void sdl_fadeOut(int step) { - if (sdl_display->flags & SDL_HWPALETTE) { - setBligtness(sdl_display, fadestep[255 - step]); - } else if (sdl_dib->format->BitsPerPixel == 8) { + if (sdl_dib->format->BitsPerPixel == 8) { setBligtness(sdl_dib, fadestep[255 - step]); sdl_fade_blit(); } else { @@ -489,9 +491,7 @@ void sdl_fadeOut(int step) { } void sdl_whiteIn(int step) { - if (sdl_display->flags & SDL_HWPALETTE) { - setWhiteness(sdl_display, fadestep[step]); - } else if (sdl_dib->format->BitsPerPixel == 8) { + if (sdl_dib->format->BitsPerPixel == 8) { setWhiteness(sdl_dib, fadestep[255 - step]); /* ??? */ sdl_fade_blit(); } else { @@ -500,9 +500,7 @@ void sdl_whiteIn(int step) { } void sdl_whiteOut(int step) { - if (sdl_display->flags & SDL_HWPALETTE) { - setWhiteness(sdl_display, fadestep[255 - step]); - } else if (sdl_dib->format->BitsPerPixel == 8) { + if (sdl_dib->format->BitsPerPixel == 8) { setWhiteness(sdl_dib, fadestep[step]); /* ??? */ sdl_fade_blit(); } else { @@ -530,7 +528,8 @@ void sdl_wrapColor(int sx, int sy, int w, int h, int cl, int rate) { setRect(r_src, 0, 0, w, h); SDL_FillRect(s, &r_src, cl); - SDL_SetAlpha(s, RLEFLAG(SDL_SRCALPHA), R_ALPHA(rate)); + SDL_SetSurfaceBlendMode(s, SDL_BLENDMODE_BLEND); + SDL_SetSurfaceAlphaMod(s, rate); setRect(r_dst, sx, sy, w, h); SDL_BlitSurface(s, &r_src, sdl_dib, &r_dst); SDL_FreeSurface(s); diff --git a/src/sdl_event.c b/src/sdl_event.c index 1db0416..407b9ce 100644 --- a/src/sdl_event.c +++ b/src/sdl_event.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "portab.h" #include "system.h" @@ -69,22 +69,23 @@ static void sdl_getEvent(void) { while (SDL_PollEvent(&e)) { switch (e.type) { - case SDL_ACTIVEEVENT: - if (e.active.state & SDL_APPMOUSEFOCUS) { - ms_active = e.active.gain; + case SDL_WINDOWEVENT: + switch (e.window.event) { + case SDL_WINDOWEVENT_ENTER: + ms_active = true; #if 0 - if (sdl_fs_on) { - if (ms_active) { - SDL_WM_GrabInput(SDL_GRAB_ON); - } else { - SDL_WM_GrabInput(SDL_GRAB_OFF); - } - } + if (sdl_fs_on) + SDL_WM_GrabInput(SDL_GRAB_ON); #endif + break; + case SDL_WINDOWEVENT_LEAVE: + ms_active = false; +#if 0 + if (sdl_fs_on) + SDL_WM_GrabInput(SDL_GRAB_OFF); +#endif + break; } - if (e.active.state & SDL_APPINPUTFOCUS) { - } - break; case SDL_KEYDOWN: keyEventProsess(&e.key, TRUE); @@ -93,8 +94,8 @@ static void sdl_getEvent(void) { keyEventProsess(&e.key, FALSE); if (e.key.keysym.sym == SDLK_F1) msg_skip = TRUE; if (e.key.keysym.sym == SDLK_F4) { - SDL_WM_ToggleFullScreen(sdl_display); sdl_fs_on = !sdl_fs_on; + SDL_SetWindowFullscreen(sdl_window, sdl_fs_on ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); } break; case SDL_MOUSEMOTION: @@ -183,7 +184,7 @@ int sdl_keywait(int msec, boolean cancel) { /* キー情報の取得 */ static void keyEventProsess(SDL_KeyboardEvent *e, boolean bool) { - RawKeyInfo[sdl_keytable[e->keysym.sym]] = bool; + RawKeyInfo[sdl_keytable[e->keysym.scancode]] = bool; } int sdl_getKeyInfo() { diff --git a/src/sdl_image.c b/src/sdl_image.c index 95f3ba3..f093e8b 100644 --- a/src/sdl_image.c +++ b/src/sdl_image.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "portab.h" @@ -147,7 +147,7 @@ void sdl_scaledCopyArea(SDL_Surface *src, SDL_Surface *dst, int sx, int sy, int void sdl_zoom(int x, int y, int w, int h) { sdl_scaledCopyArea(sdl_dib, sdl_display, x, y, w, h, 0, 0, view_w, view_h, 0); - SDL_UpdateRect(sdl_display, 0, 0, view_w, view_h); + sdl_updateScreen(); } @@ -172,11 +172,6 @@ void sdl_drawImage16_fromData(cgdata *cg, int dx, int dy, int w, int h) { #else s = SDL_AllocSurface(SDL_ANYFORMAT,w, h, 32, 0xf800, 0x07e0, 0x001f, 0xFF000000); -#endif -#if 0 -#ifdef HAVE_SDLRLE - SDL_SetAlpha(s,RLEFLAG(SDL_SRCALPHA),0); -#endif #endif SDL_LockSurface(s); p_ds = s->pixels; @@ -187,9 +182,9 @@ void sdl_drawImage16_fromData(cgdata *cg, int dx, int dy, int w, int h) { for (x = 0; x < w; x++) { #ifndef WORDS_BIGENDIAN *(p_dst++) = *(p_src++); - *(p_dst++) = R_ALPHA(*(a_src++)); + *(p_dst++) = *(a_src++); #else - *(p_dst++) = R_ALPHA(*(a_src++)); + *(p_dst++) = *(a_src++); *(p_dst++) = *(p_src++); #endif } @@ -237,7 +232,7 @@ void sdl_shadow_init(void) { for (i = 0; i < 255; i++) { for (j = 0; j < 256; j++) { - *(c++) = (unsigned char)(R_ALPHA(i * j / 255)); + *(c++) = (unsigned char)(i * j / 255); } } } @@ -269,7 +264,7 @@ void sdl_copyAreaSP16_shadow(int sx, int sy, int w, int h, int dx, int dy, int l p_src = adata; p_dst = p_ds; for (x = 0; x < w; x++) { - *p_dst = R_ALPHA(*(p_src++)); + *p_dst = *(p_src++); p_dst += 4; } adata += sdl_dibinfo->width; @@ -293,11 +288,6 @@ void sdl_copyAreaSP16_shadow(int sx, int sy, int w, int h, int dx, int dy, int l break; } SDL_UnlockSurface(s); -#if 0 -#ifdef HAVE_SDLRLE - SDL_SetAlpha(s, RLEFLAG(SDL_SRCALPHA), 0); -#endif -#endif setRect(r_dst, dx, dy, w, h); SDL_BlitSurface(s, &r_src, sdl_dib, &r_dst); @@ -309,28 +299,25 @@ void sdl_copyAreaSP16_alphaBlend(int sx, int sy, int w, int h, int dx, int dy, i setRect(r_src, sx, sy, w, h); setRect(r_dst, dx, dy, w, h); - SDL_SetAlpha(sdl_dib, RLEFLAG(SDL_SRCALPHA), R_ALPHA(lv)); + SDL_SetSurfaceBlendMode(sdl_dib, SDL_BLENDMODE_BLEND); + SDL_SetSurfaceAlphaMod(sdl_dib, lv); SDL_BlitSurface(sdl_dib, &r_src, sdl_dib, &r_dst); - SDL_SetAlpha(sdl_dib, 0, 0); + SDL_SetSurfaceBlendMode(sdl_dib, SDL_BLENDMODE_NONE); } #define copyAreaSP_level(fn, cn, v) void sdl_copyAreaSP16_##fn(int sx, int sy, int w, int h, int dx, int dy, int lv) { \ SDL_Rect r_src,r_dst; \ setRect(r_src, sx, sy, w, h); \ setRect(r_dst, dx, dy, w, h); \ - SDL_SetAlpha(sdl_dib, RLEFLAG(SDL_SRCALPHA), v); \ + SDL_SetSurfaceBlendMode(sdl_dib, SDL_BLENDMODE_BLEND); \ + SDL_SetSurfaceAlphaMod(sdl_dib, v); \ SDL_FillRect(sdl_dib, &r_dst, cn); \ SDL_BlitSurface(sdl_dib, &r_src, sdl_dib, &r_dst); \ - SDL_SetAlpha(sdl_dib, 0, 0); \ + SDL_SetSurfaceBlendMode(sdl_dib, SDL_BLENDMODE_NONE); \ } -#ifdef HAVE_SDLRALPHA copyAreaSP_level(alphaLevel, 0, lv); copyAreaSP_level(whiteLevel, sdl_white, 255 - lv); -#else -copyAreaSP_level(alphaLevel, 0, 255 - lv); -copyAreaSP_level(whiteLevel, sdl_white, lv); -#endif void sdl_copy_from_alpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag) { SDL_LockSurface(sdl_dib); diff --git a/src/sdl_input.c b/src/sdl_input.c index 374347c..7206d58 100644 --- a/src/sdl_input.c +++ b/src/sdl_input.c @@ -1,82 +1,73 @@ -static int sdl_keytable[SDLK_LAST] = { +static int sdl_keytable[SDL_NUM_SCANCODES] = { 0, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_BACKSPACE, KEY_TAB, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_CLEAR, KEY_RETURN, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_PAUSE, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_ESCAPE, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_SPACE, 33, 34, 35, - 36, KEY_UNDEFINED, 38, 39, - 40, 41, 42, 43, - 44, 45, 46, 47, - KEY_0, KEY_1, KEY_2, KEY_3, - KEY_4, KEY_5, KEY_6, KEY_7, - KEY_8, KEY_9, 58, 59, - 60, 61, 62, 63, - 64, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, 91, - 92, 93, 94, 95, - 96, KEY_A, KEY_B, KEY_C, - KEY_D, KEY_E, KEY_F, KEY_G, - KEY_H, KEY_I, KEY_J, KEY_K, - KEY_L, KEY_M, KEY_N, KEY_O, - KEY_P, KEY_Q, KEY_R, KEY_S, - KEY_T, KEY_U, KEY_V, KEY_W, - KEY_X, KEY_Y, KEY_Z, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_DELETE, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - 0 /* SDL_WORLD_0 */, 0 /* SDL_WORLD_1 */, 0 /* SDL_WORLD_2 */, 0 /* SDL_WORLD_3 */, - 0 /* SDL_WORLD_4 */, 0 /* SDL_WORLD_5 */, 0 /* SDL_WORLD_6 */, 0 /* SDL_WORLD_7 */, - 0 /* SDL_WORLD_8 */, 0 /* SDL_WORLD_9 */, 0 /* SDL_WORLD_10 */, 0 /* SDL_WORLD_11 */, - 0 /* SDL_WORLD_12 */, 0 /* SDL_WORLD_13 */, 0 /* SDL_WORLD_14 */, 0 /* SDL_WORLD_15 */, - 0 /* SDL_WORLD_16 */, 0 /* SDL_WORLD_17 */, 0 /* SDL_WORLD_18 */, 0 /* SDL_WORLD_19 */, - 0 /* SDL_WORLD_20 */, 0 /* SDL_WORLD_21 */, 0 /* SDL_WORLD_22 */, 0 /* SDL_WORLD_23 */, - 0 /* SDL_WORLD_24 */, 0 /* SDL_WORLD_25 */, 0 /* SDL_WORLD_26 */, 0 /* SDL_WORLD_27 */, - 0 /* SDL_WORLD_28 */, 0 /* SDL_WORLD_29 */, 0 /* SDL_WORLD_30 */, 0 /* SDL_WORLD_31 */, - 0 /* SDL_WORLD_32 */, 0 /* SDL_WORLD_33 */, 0 /* SDL_WORLD_34 */, 0 /* SDL_WORLD_35 */, - 0 /* SDL_WORLD_36 */, 0 /* SDL_WORLD_37 */, 0 /* SDL_WORLD_38 */, 0 /* SDL_WORLD_39 */, - 0 /* SDL_WORLD_40 */, 0 /* SDL_WORLD_41 */, 0 /* SDL_WORLD_42 */, 0 /* SDL_WORLD_43 */, - 0 /* SDL_WORLD_44 */, 0 /* SDL_WORLD_45 */, 0 /* SDL_WORLD_46 */, 0 /* SDL_WORLD_47 */, - 0 /* SDL_WORLD_48 */, 0 /* SDL_WORLD_49 */, 0 /* SDL_WORLD_50 */, 0 /* SDL_WORLD_51 */, - 0 /* SDL_WORLD_52 */, 0 /* SDL_WORLD_53 */, 0 /* SDL_WORLD_54 */, 0 /* SDL_WORLD_55 */, - 0 /* SDL_WORLD_56 */, 0 /* SDL_WORLD_57 */, 0 /* SDL_WORLD_58 */, 0 /* SDL_WORLD_59 */, - 0 /* SDL_WORLD_60 */, 0 /* SDL_WORLD_61 */, 0 /* SDL_WORLD_62 */, 0 /* SDL_WORLD_63 */, - 0 /* SDL_WORLD_64 */, 0 /* SDL_WORLD_65 */, 0 /* SDL_WORLD_66 */, 0 /* SDL_WORLD_67 */, - 0 /* SDL_WORLD_68 */, 0 /* SDL_WORLD_69 */, 0 /* SDL_WORLD_70 */, 0 /* SDL_WORLD_71 */, - 0 /* SDL_WORLD_72 */, 0 /* SDL_WORLD_73 */, 0 /* SDL_WORLD_74 */, 0 /* SDL_WORLD_75 */, - 0 /* SDL_WORLD_76 */, 0 /* SDL_WORLD_77 */, 0 /* SDL_WORLD_78 */, 0 /* SDL_WORLD_79 */, - 0 /* SDL_WORLD_80 */, 0 /* SDL_WORLD_81 */, 0 /* SDL_WORLD_82 */, 0 /* SDL_WORLD_83 */, - 0 /* SDL_WORLD_84 */, 0 /* SDL_WORLD_85 */, 0 /* SDL_WORLD_86 */, 0 /* SDL_WORLD_87 */, - 0 /* SDL_WORLD_88 */, 0 /* SDL_WORLD_89 */, 0 /* SDL_WORLD_90 */, 0 /* SDL_WORLD_91 */, - 0 /* SDL_WORLD_92 */, 0 /* SDL_WORLD_93 */, 0 /* SDL_WORLD_94 */, 0 /* SDL_WORLD_95 */, - KEY_PAD_0, KEY_PAD_1, KEY_PAD_2, KEY_PAD_3, - KEY_PAD_4, KEY_PAD_5, KEY_PAD_6, KEY_PAD_7, - KEY_PAD_8, KEY_PAD_9, KEY_PAD_PERIOD, KEY_PAD_DIVIDE, - KEY_PAD_MULTIPLY, KEY_PAD_MINUS, KEY_PAD_PLUS, KEY_PAD_ENTER, - KEY_PAD_EQUALS, KEY_UP, KEY_DOWN, KEY_RIGHT, - KEY_LEFT, KEY_INSERT, KEY_HOME, KEY_END, - KEY_PAGEUP, KEY_PAGEDOWN, KEY_F1, KEY_F2, + KEY_A, KEY_B, KEY_C, KEY_D, + KEY_E, KEY_F, KEY_G, KEY_H, + KEY_I, KEY_J, KEY_K, KEY_L, + KEY_M, KEY_N, KEY_O, KEY_P, + KEY_Q, KEY_R, KEY_S, KEY_T, + KEY_U, KEY_V, KEY_W, KEY_X, + KEY_Y, KEY_Z, KEY_1, KEY_2, + KEY_3, KEY_4, KEY_5, KEY_6, + KEY_7, KEY_8, KEY_9, KEY_0, + KEY_RETURN, KEY_ESCAPE, KEY_BACKSPACE, KEY_TAB, + KEY_SPACE, 45, 46, 47, + 48, 49, 50, 51, + 52, 53, 54, 55, + 56, KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, - KEY_F11, KEY_F12, KEY_F13, KEY_F14, - KEY_F15, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, - KEY_NUMLOCK, KEY_CAPSLOCK, KEY_SCROLLOCK, KEY_RSHIFT, - KEY_RSHIFT, KEY_RCTRL, KEY_RCTRL, KEY_RALT, - KEY_RALT, 0 /* SDL_RMETA */, 0 /* SDL_LMETA */, 0 /* SDL_LSUPER */, - 0 /* SDL_RSUPER */, 0 /* SDL_MODE */, KEY_UNDEFINED, KEY_HELP, - 0 /* SDL_PRINT */, 0 /* SDL_SYSREQ */, 0 /* SDL_BREAK */, 0 /* SDL_MENU */, - 0 /* SDL_POWER */, 0 /* SDL_EURO */, }; + KEY_F11, KEY_F12, KEY_PRINTSCREEN, 71, + KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, + KEY_DELETE, KEY_END, KEY_PAGEDOWN, KEY_RIGHT, + KEY_LEFT, KEY_DOWN, KEY_UP, 83, + KEY_PAD_DIVIDE, KEY_PAD_MULTIPLY, KEY_PAD_MINUS, KEY_PAD_PLUS, + KEY_PAD_ENTER, KEY_PAD_1, KEY_PAD_2, KEY_PAD_3, + KEY_PAD_4, KEY_PAD_5, KEY_PAD_6, KEY_PAD_7, + KEY_PAD_8, KEY_PAD_9, KEY_PAD_0, KEY_PAD_PERIOD, + 0 /* SDL_NONUSBACKSLASH */, 0 /* SDL_APPLICATION */, 0 /* SDL_POWER */, KEY_PAD_EQUALS, + KEY_F13, KEY_F14, KEY_F15, KEY_F16, + KEY_F17, KEY_F18, KEY_F19, KEY_F20, + KEY_F21, KEY_F22, KEY_F23, KEY_F24, + KEY_EXECUTE, KEY_HELP, 0 /* SDL_MENU */, KEY_SELECT, + 0 /* SDL_STOP */, 0 /* SDL_AGAIN */, 0 /* SDL_UNDO */, 0 /* SDL_CUT */, + 0 /* SDL_COPY */, 0 /* SDL_PASTE */, 0 /* SDL_FIND */, 0 /* SDL_MUTE */, + 0 /* SDL_VOLUMEUP */, 0 /* SDL_VOLUMEDOWN */, 0 /* SDL_LOCKINGCAPSLOCK */, 0 /* SDL_LOCKINGNUMLOCK */, + 0 /* SDL_LOCKINGSCROLLLOCK */, 0 /* SDL_PAD_COMMA */, 0 /* SDL_PAD_EQUALSAS400 */, 0 /* SDL_INTERNATIONAL1 */, + 0 /* SDL_INTERNATIONAL2 */, 0 /* SDL_INTERNATIONAL3 */, 0 /* SDL_INTERNATIONAL4 */, 0 /* SDL_INTERNATIONAL5 */, + 0 /* SDL_INTERNATIONAL6 */, 0 /* SDL_INTERNATIONAL7 */, 0 /* SDL_INTERNATIONAL8 */, 0 /* SDL_INTERNATIONAL9 */, + 0 /* SDL_LANG1 */, 0 /* SDL_LANG2 */, 0 /* SDL_LANG3 */, 0 /* SDL_LANG4 */, + 0 /* SDL_LANG5 */, 0 /* SDL_LANG6 */, 0 /* SDL_LANG7 */, 0 /* SDL_LANG8 */, + 0 /* SDL_LANG9 */, 0 /* SDL_ALTERASE */, 0 /* SDL_SYSREQ */, 0 /* SDL_CANCEL */, + KEY_CLEAR, 0 /* SDL_PRIOR */, 0 /* SDL_RETURN2 */, 0 /* SDL_SEPARATOR */, + 0 /* SDL_OUT */, 0 /* SDL_OPER */, 0 /* SDL_CLEARAGAIN */, 0 /* SDL_CRSEL */, + 0 /* SDL_EXSEL */, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + 0 /* SDL_PAD_00 */, 0 /* SDL_PAD_000 */, 0 /* SDL_THOUSANDSSEPARATOR */, 0 /* SDL_DECIMALSEPARATOR */, + 0 /* SDL_CURRENCYUNIT */, 0 /* SDL_CURRENCYSUBUNIT */, 0 /* SDL_PAD_LEFTPAREN */, 0 /* SDL_PAD_RIGHTPAREN */, + 0 /* SDL_PAD_LEFTBRACE */, 0 /* SDL_PAD_RIGHTBRACE */, 0 /* SDL_PAD_TAB */, 0 /* SDL_PAD_BACKSPACE */, + 0 /* SDL_PAD_A */, 0 /* SDL_PAD_B */, 0 /* SDL_PAD_C */, 0 /* SDL_PAD_D */, + 0 /* SDL_PAD_E */, 0 /* SDL_PAD_F */, 0 /* SDL_PAD_XOR */, 0 /* SDL_PAD_POWER */, + 0 /* SDL_PAD_PERCENT */, 0 /* SDL_PAD_LESS */, 0 /* SDL_PAD_GREATER */, 0 /* SDL_PAD_AMPERSAND */, + 0 /* SDL_PAD_DBLAMPERSAND */, 0 /* SDL_PAD_VERTICALBAR */, 0 /* SDL_PAD_DBLVERTICALBAR */, 0 /* SDL_PAD_COLON */, + 0 /* SDL_PAD_HASH */, 0 /* SDL_PAD_SPACE */, 0 /* SDL_PAD_AT */, 0 /* SDL_PAD_EXCLAM */, + 0 /* SDL_PAD_MEMSTORE */, 0 /* SDL_PAD_MEMRECALL */, 0 /* SDL_PAD_MEMCLEAR */, 0 /* SDL_PAD_MEMADD */, + 0 /* SDL_PAD_MEMSUBTRACT */, 0 /* SDL_PAD_MEMMULTIPLY */, 0 /* SDL_PAD_MEMDIVIDE */, 0 /* SDL_PAD_PLUSMINUS */, + 0 /* SDL_PAD_CLEAR */, 0 /* SDL_PAD_CLEARENTRY */, 0 /* SDL_PAD_BINARY */, 0 /* SDL_PAD_OCTAL */, + 0 /* SDL_PAD_DECIMAL */, 0 /* SDL_PAD_HEXADECIMAL */, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_RCTRL, KEY_RSHIFT, KEY_RALT, 0 /* SDL_LGUI */, + KEY_RCTRL, KEY_RSHIFT, KEY_RALT, 0 /* SDL_RGUI */, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, 0 /* SDL_MODE */, 0 /* SDL_AUDIONEXT */, 0 /* SDL_AUDIOPREV */, + 0 /* SDL_AUDIOSTOP */, 0 /* SDL_AUDIOPLAY */, 0 /* SDL_AUDIOMUTE */, 0 /* SDL_MEDIASELECT */, + 0 /* SDL_WWW */, 0 /* SDL_MAIL */, 0 /* SDL_CALCULATOR */, 0 /* SDL_COMPUTER */, + 0 /* SDL_AC_SEARCH */, 0 /* SDL_AC_HOME */, 0 /* SDL_AC_BACK */, 0 /* SDL_AC_FORWARD */, + 0 /* SDL_AC_STOP */, 0 /* SDL_AC_REFRESH */, 0 /* SDL_AC_BOOKMARKS */, 0 /* SDL_BRIGHTNESSDOWN */, + 0 /* SDL_BRIGHTNESSUP */, 0 /* SDL_DISPLAYSWITCH */, 0 /* SDL_KBDILLUMTOGGLE */, 0 /* SDL_KBDILLUMDOWN */, + 0 /* SDL_KBDILLUMUP */, 0 /* SDL_EJECT */, 0 /* SDL_SLEEP */, 0 /* SDL_APP1 */, + 0 /* SDL_APP2 */, }; diff --git a/src/sdl_mode.c b/src/sdl_mode.c index 99a5164..aa4c623 100644 --- a/src/sdl_mode.c +++ b/src/sdl_mode.c @@ -24,85 +24,30 @@ #include #include -#include +#include #include "portab.h" #include "system.h" #include "sdl_private.h" -static SDL_Rect **modes; - - void sdl_vm_init(void) { - modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE); - - /* Check is there are any modes available */ - if (modes == (SDL_Rect **)0) { - SYSERROR("No modes available!\n"); - } - - /* Check if or resolution is restricted */ - if (modes == (SDL_Rect **)-1){ - NOTICE("All resolutions available.\n"); - } else { - int i; - /* Print valid modes */ - NOTICE("Available Modes\n"); - for(i = 0; modes[i]; i++) { - NOTICE(" %d x %d\n", modes[i]->w, modes[i]->h); - } - } - } -static int search_preferable_fullscreen_mode() { - int i, vm = 0, delta = INT_MAX; - - /* すべてのmodeのなかで最も適切なモードを選択 */ - for (i = 0; modes[i]; i++) { - if (modes[i]->w >= view_w && - modes[i]->h >= view_y) { - int deltaw = modes[i]->w - view_w; - int deltah = modes[i]->h - view_h; - if (delta > (deltaw + deltah)) { - vm = i; - delta = deltaw + deltah; - } - } - } - return vm; -} - -static void enter_fullscreen() { - Uint32 mode = sdl_vflag; - - mode |= SDL_FULLSCREEN; - - sdl_display = SDL_SetVideoMode(view_w, view_h, sdl_vinfo->vfmt->BitsPerPixel, mode); -} - -static void quit_fullscreen() { - -} - - void sdl_FullScreen(boolean on) { if (on && !sdl_fs_on) { sdl_fs_on = TRUE; - enter_fullscreen(); + SDL_SetWindowFullscreen(sdl_window, SDL_WINDOW_FULLSCREEN_DESKTOP); } else if (!on && sdl_fs_on) { - quit_fullscreen(); sdl_fs_on = FALSE; + SDL_SetWindowFullscreen(sdl_window, 0); } } /* Windowの大きさの変更 */ void sdl_setWindowSize(int x, int y, int w, int h) { - Uint32 mode = sdl_vflag; - view_x = x; view_y = y; @@ -111,21 +56,8 @@ void sdl_setWindowSize(int x, int y, int w, int h) { view_w = w; view_h = h; - if (sdl_fs_on) { - int m = search_preferable_fullscreen_mode(); - - if (modes[m]->w != view_w || modes[m]->h != view_h) { - winoffset_x = (modes[m]->w - view_w) / 2; - winoffset_y = (modes[m]->h - view_h) / 2; - w = modes[m]->w; - h = modes[m]->h; - } else { - winoffset_x = winoffset_y = 0; - } - - mode |= SDL_FULLSCREEN; - } - - sdl_display = SDL_SetVideoMode(w, h, sdl_vinfo->vfmt->BitsPerPixel, mode); - ms_active = (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ? TRUE : FALSE; + SDL_SetWindowSize(sdl_window, w, h); + sdl_display = SDL_CreateRGBSurface(0, w, h, 32, 0, 0, 0, 0); + + //ms_active = (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ? TRUE : FALSE; } diff --git a/src/sdl_private.h b/src/sdl_private.h index d752168..4d91316 100644 --- a/src/sdl_private.h +++ b/src/sdl_private.h @@ -25,19 +25,17 @@ #include "config.h" -#include +#include #include "portab.h" #include "ags.h" #include "font.h" struct sdl_private_data { - const SDL_VideoInfo *vf; /* sdl video information */ - + SDL_Window *window; + SDL_Renderer *renderer; SDL_Surface *dsp; /* toplevel surface */ - Uint32 vflag; /* video mode flag */ - SDL_Surface *dib; /* offscreen surface */ SDL_Color col[256]; /* color pallet */ @@ -62,13 +60,15 @@ struct sdl_private_data { extern void sdl_cursor_init(void); extern void sdl_shadow_init(void); extern void sdl_vm_init(void); +extern void sdl_updateScreen(void); +#define SDL_AllocSurface(flags,w,h,d,r,g,b,a) SDL_CreateRGBSurface(0,w,h,d,r,g,b,a) extern struct sdl_private_data *sdl_videodev; -#define sdl_vinfo (sdl_videodev->vf) +#define sdl_window (sdl_videodev->window) +#define sdl_renderer (sdl_videodev->renderer) #define sdl_display (sdl_videodev->dsp) -#define sdl_vflag (sdl_videodev->vflag) #define sdl_dib (sdl_videodev->dib) #define sdl_col (sdl_videodev->col) #define sdl_white (sdl_videodev->white) @@ -87,16 +87,4 @@ extern struct sdl_private_data *sdl_videodev; #define setRect(r,xx,yy,ww,hh) (r).x=(xx),(r).y=(yy),(r).w=(ww),(r).h=(hh) #define setOffset(s,x,y) (s->pixels) + (x) * (s->format->BytesPerPixel) + (y) * s->pitch -#ifdef HAVE_SDLRLE -#define RLEFLAG(v) ((v)|SDL_RLEACCEL) -#ifdef HAVE_SDLRALPHA -#define R_ALPHA(v) (v) -#else -#define R_ALPHA(v) (255-(v)) -#endif -#else -#define RLEFLAG(v) (v) -#define R_ALPHA(v) (v) -#endif - #endif /* __SDL_PRIVATE_H__ */ diff --git a/src/sdl_video.c b/src/sdl_video.c index a8af4bd..1111a18 100644 --- a/src/sdl_video.c +++ b/src/sdl_video.c @@ -23,7 +23,7 @@ #include "config.h" #include -#include +#include #include #include "portab.h" @@ -53,9 +53,6 @@ int sdl_Initilize(void) { /* offscreen Pixmap */ makeDIB(SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, SYS35_DEFAULT_DEPTH); - /* title */ - SDL_WM_SetCaption("XSystem3.5 Version "VERSION, NULL); - /* init cursor */ sdl_cursor_init(); @@ -78,6 +75,8 @@ void sdl_Remove(void) { NOTICE("Now SDL shutdown ... "); SDL_FreeSurface(sdl_dib); + + SDL_DestroyRenderer(sdl_renderer); joy_close(); @@ -89,12 +88,11 @@ void sdl_Remove(void) { /* name is UTF-8 */ void sdl_setWindowTitle(char *name) { - SDL_WM_SetCaption(name, NULL); + SDL_SetWindowTitle(sdl_window, name); } /* Visual に応じて Window を生成する */ static void window_init(void) { - char s[256]; SDL_Init(SDL_INIT_VIDEO #ifdef HAVE_SDLJOY @@ -102,61 +100,21 @@ static void window_init(void) { #endif ); - sdl_vinfo = SDL_GetVideoInfo(); - - SDL_VideoDriverName(s, 256); - - NOTICE("Video Info %s\n", s); - NOTICE(" hw_available %d\n", sdl_vinfo->hw_available); - NOTICE(" wm_available %d\n", sdl_vinfo->wm_available); - NOTICE(" Accelerated blits HW --> HW %d\n", sdl_vinfo->blit_hw); - NOTICE(" Accelerated blits with Colorkey %d\n", sdl_vinfo->blit_hw_CC); - NOTICE(" Accelerated blits with Alpha %d\n", sdl_vinfo->blit_hw_A); - NOTICE(" Accelerated blits SW --> HW %d\n", sdl_vinfo->blit_sw); - NOTICE(" Accelerated blits with Colorkey %d\n", sdl_vinfo->blit_sw_CC); - NOTICE(" Accelerated blits with Alpha %d\n", sdl_vinfo->blit_sw_A); - NOTICE(" Accelerated color fill %d\n", sdl_vinfo->blit_fill); - NOTICE(" The total amount of video memory %dK\n", sdl_vinfo->video_mem); - NOTICE(" BitsPerPixel %d\n", sdl_vinfo->vfmt->BitsPerPixel); - NOTICE(" R %04x G %04x B %04x A %04x\n", - sdl_vinfo->vfmt->Rmask, sdl_vinfo->vfmt->Gmask, - sdl_vinfo->vfmt->Bmask, sdl_vinfo->vfmt->Amask); - - sdl_vflag = SDL_HWSURFACE | SDL_ANYFORMAT; - - sdl_display = SDL_SetVideoMode(SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, - sdl_vinfo->vfmt->BitsPerPixel, sdl_vflag); - - NOTICE("Dsp_depth %d flag %x\n", - sdl_display->format->BitsPerPixel, sdl_display->flags); + sdl_window = SDL_CreateWindow("XSystem3.5 Version "VERSION, + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, 0); + sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0); + sdl_display = SDL_CreateRGBSurface(0, SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, + 32, 0, 0, 0, 0); } static void makeDIB(int width, int height, int depth) { - if (sdl_display->format->BitsPerPixel == 8 && depth != 8) { - SYSERROR("You cannot play highcolor game in 256 color mode\n"); - } - - if (depth == 24) { - WARNING("SDL warning: if you are using SDL version 1.1.x (x<=3) and someting is wrong with graphics, please use version 1.1.4 or later\n"); - } - if (sdl_dib) { SDL_FreeSurface(sdl_dib); } - if (depth == 8) { - if (sdl_display->format->BitsPerPixel == depth) { - sdl_dib = SDL_AllocSurface(SDL_SWSURFACE, width, height, - depth, 0, 0, 0, 0); - } else { - sdl_dib = SDL_AllocSurface(SDL_HWSURFACE, width, height, - depth, 0, 0, 0, 0); - } - } else { - sdl_dib = SDL_AllocSurface(SDL_HWSURFACE, width, height, - sdl_display->format->BitsPerPixel, 0, 0, 0, 0); - } + sdl_dib = SDL_CreateRGBSurface(0, width, height, depth, 0, 0, 0, 0); #if 0 if (sdl_dib->format->BitsPerPixel == 8) { @@ -200,11 +158,13 @@ void sdl_setWorldSize(int width, int height, int depth) { SDL_FillRect(sdl_dib, NULL, 0); } -/* Windowの size と depth の取得 */ +/* display の size と depth の取得 */ void sdl_getWindowInfo(DispInfo *info) { - info->width = sdl_display->w; - info->height = sdl_display->h; - info->depth = sdl_display->format->BitsPerPixel; + SDL_DisplayMode dm; + SDL_GetCurrentDisplayMode(0, &dm); + info->width = dm.w; + info->height = dm.h; + info->depth = SDL_BITSPERPIXEL(dm.format); } /* DIBの取得 */ @@ -215,8 +175,8 @@ agsurface_t *sdl_getDIB(void) { /* AutoRepeat の設定 */ void sdl_setAutoRepeat(boolean bool) { if (bool) { - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + // SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); } else { - SDL_EnableKeyRepeat(0, 0); + // SDL_EnableKeyRepeat(0, 0); } } diff --git a/src/xsyskey.pl b/src/xsyskey.pl index 8cfd34d..f9fab45 100755 --- a/src/xsyskey.pl +++ b/src/xsyskey.pl @@ -12,16 +12,16 @@ while() { close(fp); @sdlk_list=(); -open(FS,") { - if( /SDLK_([^\s]+)\s+=\s*([^,]*),/ ) { + if( /SDL_SCANCODE_([^\s]+)\s+=\s*([^,]*),/ ) { $sdlk_list[eval($2)]="$1"; } } close(FS); -print "static int sdl_keytable[SDLK_LAST] = {\n\t"; +print "static int sdl_keytable[SDL_NUM_SCANCODES] = {\n\t"; for( $i = 0 ; $i < scalar(@sdlk_list) ; $i ++ ) { #print "$i @sdlk_list[$i] $keyh_list{@sdlk_list[$i]}\n"; $x = @sdlk_list[$i]; @@ -31,13 +31,13 @@ for( $i = 0 ; $i < scalar(@sdlk_list) ; $i ++ ) { print "KEY_@key_list[$keyh_list{$x}], "; } elsif ( $x =~ /[a-z]/ ) { print "KEY_".uc($x).", "; - } elsif ( $x =~ /KP/ ) { - if( $x =~ /[0-9]/ ) { - $x =~ s/^KP/PAD_/; + } elsif ( $x =~ /KP_/ ) { + $x =~ s/^KP_/PAD_/; + if ( $keyh_list{$x} ) { + print "KEY_$x, "; } else { - $x =~ s/^KP/PAD/; + print "0 /* SDL_$x */, "; } - print "KEY_$x, "; } elsif ( $i < 0x61) { print "$i, "; } else {