SDLQuake merge with our tree made possible by Sam Lantinga and Maas van den Berg, currently the video and cdrom audio are supported.

This commit is contained in:
Nelson Rush 2000-01-03 06:18:32 +00:00
parent 768b167927
commit a841b90d2d
5 changed files with 154 additions and 8 deletions

View file

@ -51,3 +51,7 @@ Math fixes/optimizations:
Documentation:
Nelson J. Rush <chesterrr@att.net>
Joseph Carter <knghtbrd@debian.org>
SDL Support:
Sam Lantinga <slouken@devolution.com>
Maas van den Berg <email@dds.nl>

View file

@ -17,9 +17,12 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if defined(__linux__)
#include "cd_linux.c"
#else
#include "cd_null.c"
#if defined(SDL)
#include "cd_sdl.c"
#else
#if defined(__linux__)
#include "cd_linux.c"
#else
#include "cd_null.c"
#endif
#endif

View file

@ -63,7 +63,6 @@ if test "x$HAS_GGI" != xno; then
CPPFLAGS="$save_CPPFLAGS"
fi
dnl Checks for SVGALib support
SVGA_CFLAGS=""
SVGA_LIBS=""
@ -86,6 +85,23 @@ if test "x$HAS_SVGA" != xno; then
CPPFLAGS="$save_CPPFLAGS"
fi
dnl Checks for SDL support
SDL_CFLAGS=""
SDL_LIBS=""
AC_ARG_WITH(sdl,
[ --with-sdl=DIR use SDL found in DIR],
HAS_SDL=$withval, HAS_SDL=auto)
if test "x$HAS_SDL" != xno; then
if test "x$HAS_SDL" != xauto; then
SDL_CFLAGS="-I$withval/include"
SDL_LIB="-L$withbal/lib"
fi
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
AC_CHECK_HEADER(SDL/SDL.h, HAS_SDL=yes, HAS_SDL=no)
CPPFLAGS="$save_CPPFLAGS"
fi
dnl Checks for GLIDE support
GLIDE_CFLAGS=""
@ -200,6 +216,26 @@ if test "x$HAS_SVGA" != xyes; then
SVGA_CFLAGS="" SVGA_LIBS=""
fi
dnl Make sure -lpthread works (for SDL)
if test "x$HAS_SDL" = xyes; then
AC_CHECK_LIB(pthread, pthread_exit ,SDL_LIBS="$SDL_LIBS -lpthread"
HAS_SDL=yes, HAS_SDL=no, [$SDL_LIBS])
fi
if test "x$HAS_SDL" != xyes; then
SDL_CFLAGS="" SDL_LIBS=""
fi
dnl Make sure -lSDL works
if test "x$HAS_SDL" = xyes; then
AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="$SDL_LIBS -lSDL"
HAS_SDL=yes, HAS_SDL=no, [$SDL_LIBS])
fi
if test "x$HAS_SDL" != xyes; then
SDL_CFLAGS="" SDL_LIBS=""
fi
dnl Make sure -lglide2x works
if test "x$HAS_GLIDE" = xyes; then
@ -292,6 +328,9 @@ AC_DEFINE(HAVE_GL_COLOR_INDEX8_EXT, HAS_INDEX8)
AC_SUBST(HAS_TDFXGL)
AC_SUBST(TDFXGL_CFLAGS)
AC_SUBST(TDFXGL_LIBS)
AC_SUBST(HAS_SDL)
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL

View file

@ -27,6 +27,7 @@ HAS_TDFXGL = @HAS_TDFXGL@
HAS_OGL = @HAS_OGL@
HAS_XIL = @HAS_XIL@
HAS_X11 = @HAS_X11@
HAS_SDL = @HAS_SDL@
MAKE_SURE_DIR = if test -d "$(BUILD_DIR)/$$DIR"; \
then \
@ -62,6 +63,10 @@ ifeq ($(HAS_GGI),yes)
GGIQUAKE = $(BIN_PREFIX)-ggi
endif
ifeq ($(HAS_SDL),yes)
SDLQUAKE = $(BIN_PREFIX)-sdl
endif
RELEASE = @RELEASE@
ifeq ($(RELEASE),yes)
OPTFLAGS = @RELEASE_CFLAGS@
@ -69,7 +74,7 @@ else
OPTFLAGS = -g
endif
targets = $(GGIQUAKE) $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE)
targets = $(GGIQUAKE) $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE) $(SDLQUAKE)
CLEAN_TARGETS = $(patsubst %,clean-%, $(targets))
.PHONY: $(targets) ($CLEAN_TARGETS)
@ -461,6 +466,54 @@ clean-$(TDFXQUAKE):
endif
###########################################################################
#
# qw-client-sdl
#
ifneq ($(SDLQUAKE),)
ALL_SDL_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(SDL_VID_SRC) model.c
OBJSquake-sdl= $(patsubst %,$(BUILD_DIR)/sdl/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_SDL_SRC) .c .s)))
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LDFLAGS = @SDL_LIBS@ -lm
SDL_VID_SRC = vid_sdl.c
# This can be thought of as a macro that makes sure that the x11
# sub-directory is created
# XXX - can we avoid doing every compile?
MAKE_SURE_sdl_DIR = @DIR=sdl; $(MAKE_SURE_DIR)
$(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) $(SDL_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) $(SDL_CFLAGS) -o $@ -c $<
ifneq ($(QW_COMMON_DIR),)
$(BUILD_DIR)/sdl/%.o: $(QW_COMMON_DIR)/%.c
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) $(SDL_CFLAGS) -o $@ -c $<
endif
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(SDLQUAKE): $(BUILD_DIR)/../$(SDLQUAKE)
$(BUILD_DIR)/../$(SDLQUAKE): $(OBJSquake-sdl)
$(CC) $(CFLAGS) $(OBJSquake-sdl) $(SDL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(SDLQUAKE)
# XXX - Can this be automated?
clean-$(SDLQUAKE):
rm -f $(OBJSquake-sdl)
endif
###########################################################################
#
# cleaning (clean, distclean)

View file

@ -26,6 +26,7 @@ HAS_TDFXGL = @HAS_TDFXGL@
HAS_OGL = @HAS_OGL@
HAS_XIL = @HAS_XIL@
HAS_X11 = @HAS_X11@
HAS_SDL = @HAS_SDL@
MAKE_SURE_DIR = if test -d "$(BUILD_DIR)/$$DIR"; \
then \
@ -61,6 +62,10 @@ ifeq ($(HAS_GGI),yes)
GGIQUAKE = $(BIN_PREFIX)-ggi
endif
ifeq ($(HAS_SDL),yes)
SDLQUAKE = $(BIN_PREFIX)-sdl
endif
RELEASE = @RELEASE@
ifeq ($(RELEASE),yes)
OPTFLAGS = @RELEASE_CFLAGS@
@ -68,7 +73,7 @@ else
OPTFLAGS = -g
endif
targets = $(GGIQUAKE) $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE)
targets = $(GGIQUAKE) $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE) $(SDLQUAKE)
CLEAN_TARGETS = $(patsubst %,clean-%, $(targets))
.PHONY: $(targets) ($CLEAN_TARGETS)
@ -419,6 +424,48 @@ clean-$(TDFXQUAKE):
endif
###########################################################################
#
# quake-sdl
#
ifneq ($(SDLQUAKE),)
ALL_SDL_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(SDL_VID_SRC) model.c
OBJSquake-sdl= $(patsubst %,$(BUILD_DIR)/sdl/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_SDL_SRC) .c .s)))
SDL_CFLAGS = @SDL_CFLAGS@ -DSDL
SDL_LDFLAGS = @SDL_LIBS@ -lm
SDL_VID_SRC = vid_sdl.c
# This can be thought of as a macro that makes sure that the x11
# sub-directory is created
# XXX - can we avoid doing every compile?
MAKE_SURE_sdl_DIR = @DIR=sdl; $(MAKE_SURE_DIR)
$(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) $(SDL_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) $(SDL_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(SDLQUAKE): $(BUILD_DIR)/../$(SDLQUAKE)
$(BUILD_DIR)/../$(SDLQUAKE): $(OBJSquake-sdl)
$(CC) $(CFLAGS) $(OBJSquake-sdl) $(SDL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(SDLQUAKE)
# XXX - Can this be automated?
clean-$(SDLQUAKE):
rm -f $(OBJSquake-sdl)
endif
###########################################################################
#
# cleaning (clean, distclean)