summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-11-05 20:56:20 +0300
committerAndrei Karas <akaras@inbox.ru>2013-11-05 20:56:20 +0300
commit102a7d4fe6e8874ad7dcdfe085a22b51de22999b (patch)
tree3dfdb542035ba1f6c871b6901461c81f11b1c6db
parent0ca79840f3497375591a43b38d520ada03dfb2dd (diff)
downloadmv-102a7d4fe6e8874ad7dcdfe085a22b51de22999b.tar.gz
mv-102a7d4fe6e8874ad7dcdfe085a22b51de22999b.tar.bz2
mv-102a7d4fe6e8874ad7dcdfe085a22b51de22999b.tar.xz
mv-102a7d4fe6e8874ad7dcdfe085a22b51de22999b.zip
add configure option --without-internalsdlgfx for not use emdedded sdl2gfx.
-rwxr-xr-xconfigure.ac20
-rw-r--r--src/Makefile.am18
-rw-r--r--src/client.h5
-rw-r--r--src/resources/image.cpp4
-rw-r--r--src/sdl2gfx/SDL2_framerate.c (renamed from src/sdl2gfx/SDL_framerate.c)2
-rw-r--r--src/sdl2gfx/SDL2_framerate.h (renamed from src/sdl2gfx/SDL_framerate.h)0
-rw-r--r--src/sdl2gfx/SDL2_rotozoom.c (renamed from src/sdl2gfx/SDL_rotozoom.c)2
-rw-r--r--src/sdl2gfx/SDL2_rotozoom.h (renamed from src/sdl2gfx/SDL_rotozoom.h)0
8 files changed, 35 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 367fa66cc..a52c94108 100755
--- a/configure.ac
+++ b/configure.ac
@@ -90,12 +90,6 @@ if test "x$with_sdl2" == "xyes"; then
AC_MSG_ERROR([ *** Unable to find SDL2_mixer library (http://www.libsdl.org/projects/SDL_mixer/)]))
-# disabled for now
-# AC_CHECK_LIB(SDL2_gfx, rotozoomSurfaceXY, ,
-# AC_MSG_ERROR([ *** Unable to find SDL2_gfx library (http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx)]))
-# AC_CHECK_HEADERS(SDL_rotozoom.h, ,)
-
-# using embedded sdl2gfx
AC_CHECK_LIB(SDL2_net, SDLNet_Init, ,
AC_MSG_ERROR([ *** Unable to find SDL2_net library]))
@@ -137,6 +131,20 @@ fi
AM_CONDITIONAL(USE_SDL2, test x$with_sdl2 = xyes)
+# Option to enable internal sdl-gfx for SDL2 (for now it enabled by default)
+AC_ARG_WITH(internalsdlgfx,[ --without-internalsdlgfx don't use internal sdlgfx (for SDL2 only) ] )
+if test "x$with_internalsdlgfx" == "xno"; then
+ with_internalsdlgfx=no
+
+ AC_CHECK_LIB(SDL2_gfx, rotozoomSurfaceXY, ,
+ AC_MSG_ERROR([ *** Unable to find SDL2_gfx library (http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx)]))
+ AC_CHECK_HEADERS(SDL_rotozoom.h, ,)
+else
+ with_internalsdlgfx=yes
+ AC_DEFINE(USE_INTERNALSDLGFX, 1, [Defines if ManaPlus should use internal sdlgfx2])
+fi
+AM_CONDITIONAL(USE_INTERNALSDLGFX, test x$with_internalsdlgfx = xyes)
+
# Search for *-config
AC_PATH_PROG(PKG_CONFIG, pkg-config)
AC_PATH_PROG(CURL_CONFIG, curl-config)
diff --git a/src/Makefile.am b/src/Makefile.am
index 910ffb9e7..b62844381 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -143,17 +143,19 @@ manaplus_CXXFLAGS += -DENABLE_CHECKS
endif
if USE_SDL2
+if USE_INTERNALSDLGFX
dyecmd_CXXFLAGS += -I$(srcdir)/sdl2gfx -DUSE_SDL2
-dyecmd_SOURCES += sdl2gfx/SDL_framerate.c \
- sdl2gfx/SDL_framerate.h \
- sdl2gfx/SDL_rotozoom.c \
- sdl2gfx/SDL_rotozoom.h
+dyecmd_SOURCES += sdl2gfx/SDL2_framerate.c \
+ sdl2gfx/SDL2_framerate.h \
+ sdl2gfx/SDL2_rotozoom.c \
+ sdl2gfx/SDL2_rotozoom.h
manaplus_CXXFLAGS += -I$(srcdir)/sdl2gfx -DUSE_SDL2
-manaplus_SOURCES += sdl2gfx/SDL_framerate.c \
- sdl2gfx/SDL_framerate.h \
- sdl2gfx/SDL_rotozoom.c \
- sdl2gfx/SDL_rotozoom.h
+manaplus_SOURCES += sdl2gfx/SDL2_framerate.c \
+ sdl2gfx/SDL2_framerate.h \
+ sdl2gfx/SDL2_rotozoom.c \
+ sdl2gfx/SDL2_rotozoom.h
+endif
endif
if USE_INTERNALGUICHAN
diff --git a/src/client.h b/src/client.h
index f3b2bcc26..34f1227ae 100644
--- a/src/client.h
+++ b/src/client.h
@@ -30,7 +30,12 @@
#include <guichan/actionlistener.hpp>
#include <SDL.h>
+
+#ifdef USE_SDL2
+#include <SDL2_framerate.h>
+#else
#include <SDL_framerate.h>
+#endif
#include <string>
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index f185d103e..8bf41aa4c 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -33,7 +33,11 @@
#include "utils/sdlcheckutils.h"
+#ifdef USE_SDL2
+#include <SDL2_rotozoom.h>
+#else
#include <SDL_rotozoom.h>
+#endif
#include "debug.h"
diff --git a/src/sdl2gfx/SDL_framerate.c b/src/sdl2gfx/SDL2_framerate.c
index bb1c35fcb..b31b0feb2 100644
--- a/src/sdl2gfx/SDL_framerate.c
+++ b/src/sdl2gfx/SDL2_framerate.c
@@ -28,7 +28,7 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net
Changed for ManaPlus (C) 2013 ManaPlus developers
*/
-#include "SDL_framerate.h"
+#include "SDL2_framerate.h"
/*!
\brief Internal wrapper to SDL_GetTicks that ensures a non-zero return value.
diff --git a/src/sdl2gfx/SDL_framerate.h b/src/sdl2gfx/SDL2_framerate.h
index a2e62e944..a2e62e944 100644
--- a/src/sdl2gfx/SDL_framerate.h
+++ b/src/sdl2gfx/SDL2_framerate.h
diff --git a/src/sdl2gfx/SDL_rotozoom.c b/src/sdl2gfx/SDL2_rotozoom.c
index 6313f4008..058074de1 100644
--- a/src/sdl2gfx/SDL_rotozoom.c
+++ b/src/sdl2gfx/SDL2_rotozoom.c
@@ -34,7 +34,7 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net
#include <stdlib.h>
#include <string.h>
-#include "SDL_rotozoom.h"
+#include "SDL2_rotozoom.h"
/* ---- Internally used structures */
diff --git a/src/sdl2gfx/SDL_rotozoom.h b/src/sdl2gfx/SDL2_rotozoom.h
index f4c236ba4..f4c236ba4 100644
--- a/src/sdl2gfx/SDL_rotozoom.h
+++ b/src/sdl2gfx/SDL2_rotozoom.h