Loring Holden's autoconf support. {qw-client,quake}-glide is currently not built since neither of us has the hardware available at the moment to test the 3dfx MiniGL target. Someone who does (Mercury?) will have to fix that. Bins all build in odd places for the moment. Thanks for staying up so late to help get this working Loring, you rock!

This commit is contained in:
Joseph Carter 1999-12-29 13:58:47 +00:00
parent 55891f5a7e
commit e3ac6357dc
39 changed files with 7497 additions and 1703 deletions

10
AUTHORS
View file

@ -0,0 +1,10 @@
The original Quake, QuakeWorld, and QuakeWorld server:
ID Software, Inc http://www.idsoftware.com
Merge of the QW/Q1 trees done largely by:
Jeff Teunissen <deek@dusknet.dhis.net>
Zephaniah E. Hull <warp@whitestar.soark.net>
Autoconf support:
Loring Holden <lsh@cs.brown.edu>

188
INSTALL
View file

@ -1,3 +1,187 @@
rudimentary install instructions :) Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
***Note: If you have OpenGL in /usr/X11R6/lib, you will have to run configure
with:
./configure --enable-OpenGLINC=/usr/X11R6/include
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
make

View file

@ -1,6 +0,0 @@
SUBDIRS = qw_client qw_server uquake
all %:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@; \
done

41
Makefile.in Normal file
View file

@ -0,0 +1,41 @@
SUBDIRS = qw_client qw_server uquake
SRC_DIR = @src_dir@
all:
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || exit; \
done
distclean:
rm -f config.cache config.log config.status \
Makefile.header Makefile.client Makefile.comp_rules \
Makefile.source Makefile.tail Makefile \
client pre post rules srcfiles
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || exit; \
done
%:
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@ || exit; \
done
# Code to automatically re-configure, only runs if you are compiling in the
# source directory
ifeq ($(SRC_DIR),.)
configure: configure.in
autoconf
Makefile: Makefile.in configure
./configure
qw_client/Makefile: qw_client/Makefile.in configure
./configure
qw_server/Makefile: qw_server/Makefile.in configure
./configure
uquake/Makefile: uquake/Makefile.in configure
./configure
endif

34
client.in Normal file
View file

@ -0,0 +1,34 @@
ifneq ($(HAS_OGL),)
GLQUAKE =$(BIN_PREFIX)-gl
endif
# XXX add glide
ifneq ($(HAS_GLIDE),)
GLIDEQUAKE= $(BIN_PREFIX)-glide
endif
ifneq ($(HAS_X11),)
X11QUAKE = $(BIN_PREFIX)-x11
endif
ifneq ($(HAS_VGA),)
SVGAQUAKE = $(BIN_PREFIX)-svga
endif
RELEASE = @RELEASE@
ifeq ($(RELEASE),yes)
OPTFLAGS = @RELEASE_CFLAGS@
else
OPTFLAGS = -g
endif
targets = $(SVGAQUAKE) $(GLQUAKE) $(GLIDEQUAKE) $(X11QUAKE)
CLEAN_TARGETS = $(patsubst %,clean-%, $(targets))
.PHONY: $(targets) ($CLEAN_TARGETS)
x: Makefile
@echo binaries: $(targets)
@echo other targets: distclean
@echo all: makes all targets - $(targets)
all: $(targets)

View file

@ -71,7 +71,11 @@ void VID_UnlockBuffer (void);
#include "keys.h" #include "keys.h"
#include "console.h" #include "console.h"
#include "view.h" #include "view.h"
#ifndef QUAKEWORLD
#include "menu.h" #include "menu.h"
#elif !defined(SERVERONLY)
#include "menu.h"
#endif
#include "crc.h" #include "crc.h"
#include "cdaudio.h" #include "cdaudio.h"

View file

@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <termios.h> #include <termios.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/vt.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <signal.h> #include <signal.h>

View file

@ -22,6 +22,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h" #include "quakedef.h"
// =======================================================================
// Various variables also defined in snd_dma.c
// FIXME - should be put in one place
// =======================================================================
channel_t channels[MAX_CHANNELS];
int total_channels;
volatile dma_t *shm = 0;
cvar_t loadas8bit = {"loadas8bit", "0"};
int paintedtime; // sample PAIRS
cvar_t bgmvolume = {"bgmvolume", "1", true}; cvar_t bgmvolume = {"bgmvolume", "1", true};
cvar_t volume = {"volume", "0.7", true}; cvar_t volume = {"volume", "0.7", true};

View file

@ -39,6 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h" #include "quakedef.h"
#include "d_local.h" #include "d_local.h"
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
cvar_t m_filter = {"m_filter","0", true}; cvar_t m_filter = {"m_filter","0", true};
qboolean mouse_avail; qboolean mouse_avail;
@ -1058,7 +1059,9 @@ void VID_Update (vrect_t *rects)
while (rects) while (rects)
{ {
#if 0
printf("update: %d,%d (%d,%d)\n", rects->x, rects->y, rects->width, rects->height); printf("update: %d,%d (%d,%d)\n", rects->x, rects->y, rects->width, rects->height);
#endif
if (x_visinfo->depth == 16) if (x_visinfo->depth == 16)
st2_fixup( x_framebuffer[current_framebuffer], st2_fixup( x_framebuffer[current_framebuffer],
rects->x, rects->y, rects->width, rects->x, rects->y, rects->width,

1141
config.guess vendored Executable file

File diff suppressed because it is too large Load diff

1215
config.sub vendored Executable file

File diff suppressed because it is too large Load diff

3656
configure vendored Executable file

File diff suppressed because it is too large Load diff

324
configure.in Normal file
View file

@ -0,0 +1,324 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(common/crc.h)
AC_CANONICAL_SYSTEM
AC_LANG_C
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
dnl checks for compiler characteristics
AC_C_BIGENDIAN
AC_ARG_WITH(optimize,
[ --with-optimize Compile with optimization],
RELEASE=$with_optimize
)
AC_ARG_ENABLE(release,
[ --enable-release Compile release (with optimization)],
RELEASE=$enable_release
)
AC_SUBST(RELEASE)
dnl Checks for OGL support
AC_ARG_ENABLE(OpenGLLIB,
[ --enable-OpenGLLIB=ARG Use OpenGL - the libraries are in ARG],
[HAS_OGL_LIB=yes; OGL_LIB_PATH=$enable_OpenGLLIB;
OGL_LDFLAGS=-L$enable_OpenGLLIB])
AC_SUBST(OGL_LDFLAGS)
AC_ARG_ENABLE(OpenGLINC,
[ --enable-OpenGLINC=ARG Use OpenGL - the include files are in ARG],
HAS_OGL_INC=yes; OGL_INC_PATH=$enable_OpenGLINC; OGL_CFLAGS=-I$enable_OpenGLINC)
AC_SUBST(OGL_CFLAGS)
if test "x$HAS_OGL_LIB" = x; then
AC_CHECK_LIB(GL, glColor4f, [HAS_OGL_LIB=yes],
AC_CHECK_LIB(MesaGL, glColor4f, [HAS_OGL_LIB=yes],
if test "x$HAS_OGL_INC" != x; then
POSS_OGL_LDFLAGS=`echo $enable_OpenGLINC| sed 's/include/lib/i'`;
AC_MSG_CHECKING(for $POSS_OGL_LDFLAGS/libGL.so)
if test -f "$POSS_OGL_LDFLAGS"/libGL.so; then
AC_MSG_RESULT(yes)
HAS_OGL_LIB=yes
OGL_LDFLAGS=-L$POSS_OGL_LDFLAGS
OGL_LIB_PATH=$POSS_OGL_LDFLAGS
else
AC_MSG_RESULT(no)
fi
fi
)
)
dnl Need to be able to check /usr/X11R6/lib...
fi
if test "x$HAS_OGL_INC" = x; then
AC_CHECK_HEADER(GL/gl.h, [HAS_OGL_INC=yes],
if test "x$HAS_OGL_LIB" != x; then
POSS_OGL_CFLAGS=`echo $enable_OpenGLLIB| sed 's/lib/include/i'`;
AC_MSG_CHECKING(for $POSS_OGL_CFLAGS/GL/gl.h)
if test -f "$POSS_OGL_CFLAGS/GL/gl.h"; then
HAS_OGL_INC=yes
OGL_CFLAGS=-I$POSS_OGL_CFLAGS
OGL_INC_PATH=$POSS_OGL_CFLAGS
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
)
fi
AC_MSG_CHECKING(for OpenGL support)
if test "x$HAS_OGL_INC" != x; then
if test "x$HAS_OGL_LIB" != x; then
HAS_OGL=yes
AC_MSG_RESULT([yes, include ($OGL_CFLAGS), lib ($OGL_LDFLAGS)])
if test "x$OGL_LDFLAGS" = x-L; then
AC_MSG_ERROR(OpenGL LDFLAGS is -L with no directory)
fi
AC_MSG_CHECKING(for GL_COLOR_INDEX8_EXT)
if test "x$OGL_INC_PATH" = x; then
OGL_INC_PATH_TO_GL="$OGL_INC_PATH/GL/gl.h"
else
OGL_INC_PATH_TO_GL="GL/gl.h"
fi
AC_TRY_COMPILE([#include "$OGL_INC_PATH_TO_GL"],
[ int x = (int) GL_COLOR_INDEX8_EXT;],
HAS_GL_COLOR_INDEX8_EXT=yes,
HAS_GL_COLOR_INDEX8_EXT=no)
if test "x$HAS_GL_COLOR_INDEX8_EXT" != xno; then
cat >> confdefs.h <<\EOF
#define HAS_GL_COLOR_INDEX8_EXT 1
EOF
fi
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
AC_SUBST(HAS_OGL)
dnl Check for other libraries
AC_CHECK_LIB(vga, vga_getmousetype, [HAS_VGA=yes], [HAS_VGA=])
AC_SUBST(HAS_VGA)
AC_CHECK_LIB(xil,xil_import, [HAS_XIL=yes], [HAS_XIL=])
AC_SUBST(HAS_XIL)
AC_PATH_XTRA
AC_SUBST(x_libraries)
if test "x$no_x" = x; then
HAS_X11=yes
if test "x$x_libraries" != x; then
X_LIB_PATH_L=-L${x_libraries};
else
X_LIB_PATH_L=
fi
AC_CHECK_LIB(Xext, XShmQueryExtension, [X11_SHM_LIB=-lXext], [X11_SHM_LIB=], ${X_LIB_PATH_L})
AC_SUBST(X11_SHM_LIB)
fi
AC_SUBST(HAS_X11)
dnl Checks for header files.
AC_CHECK_HEADER(glide.h, [HAS_GLIDE=yes], [HAS_GLIDE=])
AC_SUBST(HAS_GLIDE)
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNC(stricmp,
[STRICMP_DEF=],
AC_CHECK_FUNC(strcasecmp, [STRICMP_DEF=-Dstricmp=strcasecmp]))
AC_SUBST(STRICMP_DEF)
##########################################################
#
# Release (optimized) compiler settings (GCC only)
#
if test "x$RELEASE" = xyes; then
if test "x$GCC" = xyes; then
AC_MSG_CHECKING(for special release compiler settings)
BASE_RELEASE_CFLAGS="-O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
case "${target}" in
changequote(,)dnl
i[34567]86-*-linux-gnu*)
changequote([,])dnl
case "${target_cpu}" in
i486) GCC_EMULATION="-m486" ;;
i586) GCC_EMULATION="-mpentium" ;;
i686) GCC_EMULATION="-mpentiumpro" ;;
esac
MORE_RELEASE_CFLAGS="${GCC_EMULATION} -malign-loops=2 -malign-jumps=2 -malign-functions=2" ;;
*) MORE_RELEASE_CFLAGS="" ;;
esac
if test "x$MORE_RELEASE_CFLAGS" = x; then
RELEASE_CFLAGS=-O
AC_MSG_RESULT([no - using standard flags])
RELEASE_CFLAGS=$BASE_RELEASE_CFLAGS
else
AC_MSG_RESULT(yes)
RELEASE_CFLAGS="$BASE_RELEASE_CFLAGS $MORE_RELEASE_CFALGS"
fi
else
RELEASE_CFLAGS=-O2
fi
fi
AC_SUBST(RELEASE_CFLAGS)
##########################################################
#
# is it an intel box?
#
AC_MSG_CHECKING(for an Intel machine)
case "${target}" in
changequote(,)dnl
i[34567]86-*-linux-gnu*)
changequote([,])dnl
INTEL_ARCH=yes
AC_MSG_RESULT(yes)
;;
*) AC_MSG_RESULT(no)
esac
AC_SUBST(INTEL_ARCH)
##########################################################
#
# CD audio available?
#
AC_MSG_CHECKING(for CD audio support)
case "${target}" in
changequote(,)dnl
i[34567]86-*-linux-gnu*)
changequote([,])dnl
CD_AUDIO_SRC="cd_linux.c" ;;
*)
CD_AUDIO_SRC="cd_null.c" ;;
esac
if test "x$CD_AUDIO_SRC" = xcd_null.c; then
AC_MSG_RESULT(no - using cd_null.c)
else
AC_MSG_RESULT(yes - $CD_AUDIO_SRC)
fi
AC_SUBST(CD_AUDIO_SRC)
##########################################################
#
# Sound available?
#
AC_MSG_CHECKING(for sound support)
case "${target}" in
changequote(,)dnl
i[34567]86-*-linux-gnu*)
changequote([,])dnl
SND_SRC="snd_dma.c snd_linux.c snd_mixa.s" ;;
*-solaris*)
SND_SRC="snd_dma.c snd_sun.c" ;;
*-sgi*)
SND_SRC="snd_null.c" ;;
*)
SND_SRC="snd_null.c" ;;
# XXX - need to add dos, Windows
esac
if test "x$SND_SRC" = xsnd_null.c; then
AC_MSG_RESULT(no - using snd_null.c)
else
AC_MSG_RESULT(yes - $SND_SRC)
fi
AC_SUBST(SND_SRC)
##########################################################
#
# System driver?
#
AC_MSG_CHECKING(for system driver)
case "${target}" in
changequote(,)dnl
i[34567]86-*-linux-gnu*)
changequote([,])dnl
SYS_SRC="sys_linux.c"
QW_CL_SYS_SRC="sys_linux.c"
QW_SRV_SYS_SRC="sys_unix.c"
;;
*-solaris*)
SYS_SRC="sys_sun.c"
QW_CL_SYS_SRC="sys_linux.c"
QW_SRV_SYS_SRC="sys_unix.c"
;;
*)
SYS_SRC="sys_sun.c"
QW_CL_SYS_SRC="sys_linux.c"
QW_SRV_SYS_SRC="sys_unix.c"
DEFAULT_SYS=yes ;;
# XXX - windows - conproc.c sys_win.c
# XXX - dos - conproc.c(?) sys_dos.c
# XXX - need to add dos, Windows
esac
if test "x$DEFAULT_SYS" = xyes; then
AC_MSG_RESULT(no - using default)
else
AC_MSG_RESULT(yes - $SYS_SRC / $QW_SYS_SRC)
fi
AC_SUBST(SYS_SRC)
AC_SUBST(QW_CL_SYS_SRC)
AC_SUBST(QW_SRV_SYS_SRC)
##########################################################
#
# X11 video driver?
#
# If Solaris, use vid_sunx.c,
# otherwise (if X available) use vid_x.c
AC_MSG_CHECKING(for X11 video driver)
case "${target}" in
*-solaris*)
X11_VID_SRC="vid_sunx.c" ;;
*)
if test "x$HAS_X11"; then
X11_VID_SRC="vid_x.c";
else
X11_VID_SRC=
fi
;;
esac
if test "x$X11_VID_SRC" = x; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes - $X11_VID_SRC)
fi
AC_SUBST(X11_VID_SRC)
dnl Check for system services
AC_EXEEXT
AC_OBJEXT
AC_PATH_XTRA
##########################################################
#
# make Makefile.header, Makefile.tail
#
AC_SUBST_FILE(MAKEFILE_HEADER)
MAKEFILE_HEADER=pre
AC_SUBST_FILE(MAKEFILE_TAIL)
MAKEFILE_TAIL=post
AC_SUBST_FILE(CLIENT_TARGETS)
CLIENT_TARGETS=client
AC_SUBST_FILE(SRCFILES)
SRCFILES=srcfiles
AC_SUBST_FILE(COMP_RULES)
COMP_RULES=rules
##########################################################
#
# Output files
#
AC_OUTPUT(pre post client srcfiles rules
qw_client/Makefile qw_server/Makefile uquake/Makefile Makefile)

251
install-sh Executable file
View file

@ -0,0 +1,251 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

14
post.in Normal file
View file

@ -0,0 +1,14 @@
###########################################################################
#
# cleaning (clean, distclean)
#
distclean: clean
rm -f config.cache config.log config.status Makefile
clean: $(CLEAN_TARGETS)
install:
@echo Install not implemented
check:
@echo check not implemented

30
pre.in Normal file
View file

@ -0,0 +1,30 @@
COMMON_DIR=$(PROJECT_DIR)/common
ifeq ($(BUILD_DIR),)
BUILD_DIR = .
endif
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
CC = @CC@
INTEL_ARCH = @INTEL_ARCH@
ifneq ($(SRC_DIR),.)
SRC_DIR_INC = -I$(SRC_DIR)
endif
HAS_VGA = @HAS_VGA@
HAS_GLIDE= @HAS_GLIDE@
HAS_OGL = @HAS_OGL@
HAS_XIL = @HAS_XIL@
HAS_X11 = @HAS_X11@
MAKE_SURE_DIR = if test -d "$(BUILD_DIR)/$$DIR"; \
then \
true; \
else \
echo "Creating directory $(BUILD_DIR)/$$DIR"; \
mkdir -p $(BUILD_DIR)/$$DIR; \
fi
MAKE_SURE_bin_DIR = @DIR=bin; \
$(MAKE_SURE_DIR)

View file

@ -1,679 +0,0 @@
#
# QuakeWorld client makefile for unified tree
#
VERSION=2.40
ifneq (,$(findstring alpha,$(shell uname -m)))
ARCH=axp
else
ARCH=$(shell uname -m | sed s/i.86/i386/)
endif
PROJECT_DIR=..
COMMON_DIR=$(PROJECT_DIR)/common
QW_COMMON_DIR=$(PROJECT_DIR)/qw_common
CLIENT_DIR=$(PROJECT_DIR)/qw_client
SERVER_DIR=$(PROJECT_DIR)/qw_server
BUILD_DIR=$(PROJECT_DIR)/build
X11_DIR=/usr/X11R6
INCL=-I. -I$(CLIENT_DIR) -I$(QW_COMMON_DIR) -I$(COMMON_DIR) -I$(X11_DIR)/include
CC=gcc
BASE_CFLAGS=-Wall -DQUAKEWORLD -Dstricmp=strcasecmp $(INCL)
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
ifeq ($(ARCH),i386)
RELEASE_CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2
else
RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations
endif
GL_CFLAGS=-DGLQUAKE -I$(X11_DIR)/include -I/usr/include/glide
LDFLAGS=-lm
SVGA_LDFLAGS=$(LDFLAGS) -lvga
X11_LDFLAGS=-L$(X11_DIR)/lib $(LDFLAGS) -lX11 -lXext
GL_X11_LDFLAGS=-L$(X11_DIR)/lib $(LDFLAGS) -lGL -lX11 -lXext
GL_SVGA_LDFLAGS=-L$(X11_DIR)/lib -lvga -lGL -lglide2x -lX11 -lXext
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
DO_GL_CC=$(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
DO_GL_AS=$(CC) $(CFLAGS) $(GL_CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
DO_O_CC=$(CC) -O $(CFLAGS) -o $@ -c $<
#############################################################################
# SETUP AND BUILD
#############################################################################
SOFT_TARGETS=$(BUILD_DIR)/qw-client-svga \
$(BUILD_DIR)/qw-client-x11
GL_TARGETS=$(BUILD_DIR)/qw-client-gl \
$(BUILD_DIR)/qw-client-glide
debug: debug-soft debug-gl
release: release-soft release-gl
all: debug-soft debug-gl release-soft release-gl
debug-soft: $(BUILD_DIR) $(BUILD_DIR)/soft_qw_obj $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS) $(SOFT_X11_OBJS)
$(MAKE) soft-targets CFLAGS="$(DEBUG_CFLAGS)"
debug-gl: $(BUILD_DIR) $(BUILD_DIR)/gl_qw_obj $(GL_OBJS) $(GL_AS_OBJS) $(GL_SVGA_OBJS) $(GL_X11_OBJS)
$(MAKE) gl-targets CFLAGS="$(DEBUG_CFLAGS)"
release-soft: $(BUILD_DIR) $(BUILD_DIR)/soft_qw_obj $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS) $(SOFT_X11_OBJS)
$(MAKE) soft-targets CFLAGS="$(RELEASE_CFLAGS)"
release-gl: $(BUILD_DIR) $(BUILD_DIR)/gl_qw_obj $(GL_OBJS) $(GL_AS_OBJS) $(GL_SVGA_OBJS) $(GL_X11_OBJS)
$(MAKE) gl-targets CFLAGS="$(RELEASE_CFLAGS)"
soft-targets: $(SOFT_TARGETS)
gl-targets: $(GL_TARGETS)
$(BUILD_DIR):
@mkdir $(BUILD_DIR)
$(BUILD_DIR)/soft_qw_obj:
@mkdir $(BUILD_DIR)/soft_qw_obj
$(BUILD_DIR)/gl_qw_obj:
@mkdir $(BUILD_DIR)/gl_qw_obj
#############################################################################
# CLIENT
#############################################################################
SOFT_OBJS = \
$(BUILD_DIR)/soft_qw_obj/cl_demo.o \
$(BUILD_DIR)/soft_qw_obj/cl_ents.o \
$(BUILD_DIR)/soft_qw_obj/cl_input.o \
$(BUILD_DIR)/soft_qw_obj/cl_main.o \
$(BUILD_DIR)/soft_qw_obj/cl_parse.o \
$(BUILD_DIR)/soft_qw_obj/cl_pred.o \
$(BUILD_DIR)/soft_qw_obj/cl_tent.o \
$(BUILD_DIR)/soft_qw_obj/cl_cam.o \
$(BUILD_DIR)/soft_qw_obj/cmd.o \
$(BUILD_DIR)/soft_qw_obj/common.o \
$(BUILD_DIR)/soft_qw_obj/console.o \
$(BUILD_DIR)/soft_qw_obj/crc.o \
$(BUILD_DIR)/soft_qw_obj/cvar.o \
$(BUILD_DIR)/soft_qw_obj/d_edge.o \
$(BUILD_DIR)/soft_qw_obj/d_fill.o \
$(BUILD_DIR)/soft_qw_obj/d_init.o \
$(BUILD_DIR)/soft_qw_obj/d_modech.o \
$(BUILD_DIR)/soft_qw_obj/d_part.o \
$(BUILD_DIR)/soft_qw_obj/d_polyse.o \
$(BUILD_DIR)/soft_qw_obj/d_scan.o \
$(BUILD_DIR)/soft_qw_obj/d_sky.o \
$(BUILD_DIR)/soft_qw_obj/d_sprite.o \
$(BUILD_DIR)/soft_qw_obj/d_surf.o \
$(BUILD_DIR)/soft_qw_obj/d_vars.o \
$(BUILD_DIR)/soft_qw_obj/d_zpoint.o \
$(BUILD_DIR)/soft_qw_obj/draw.o \
$(BUILD_DIR)/soft_qw_obj/keys.o \
$(BUILD_DIR)/soft_qw_obj/mathlib.o \
$(BUILD_DIR)/soft_qw_obj/md4.o \
$(BUILD_DIR)/soft_qw_obj/menu.o \
$(BUILD_DIR)/soft_qw_obj/model.o \
$(BUILD_DIR)/soft_qw_obj/net_chan.o \
$(BUILD_DIR)/soft_qw_obj/net_udp.o \
$(BUILD_DIR)/soft_qw_obj/nonintel.o \
$(BUILD_DIR)/soft_qw_obj/pmove.o \
$(BUILD_DIR)/soft_qw_obj/pmovetst.o \
$(BUILD_DIR)/soft_qw_obj/r_aclip.o \
$(BUILD_DIR)/soft_qw_obj/r_alias.o \
$(BUILD_DIR)/soft_qw_obj/r_bsp.o \
$(BUILD_DIR)/soft_qw_obj/r_draw.o \
$(BUILD_DIR)/soft_qw_obj/r_edge.o \
$(BUILD_DIR)/soft_qw_obj/r_efrag.o \
$(BUILD_DIR)/soft_qw_obj/r_light.o \
$(BUILD_DIR)/soft_qw_obj/r_main.o \
$(BUILD_DIR)/soft_qw_obj/r_misc.o \
$(BUILD_DIR)/soft_qw_obj/r_part.o \
$(BUILD_DIR)/soft_qw_obj/r_sky.o \
$(BUILD_DIR)/soft_qw_obj/r_sprite.o \
$(BUILD_DIR)/soft_qw_obj/r_surf.o \
$(BUILD_DIR)/soft_qw_obj/r_vars.o \
$(BUILD_DIR)/soft_qw_obj/sbar.o \
$(BUILD_DIR)/soft_qw_obj/screen.o \
$(BUILD_DIR)/soft_qw_obj/skin.o \
$(BUILD_DIR)/soft_qw_obj/snd_dma.o \
$(BUILD_DIR)/soft_qw_obj/snd_mem.o \
$(BUILD_DIR)/soft_qw_obj/snd_mix.o \
$(BUILD_DIR)/soft_qw_obj/view.o \
$(BUILD_DIR)/soft_qw_obj/wad.o \
$(BUILD_DIR)/soft_qw_obj/zone.o \
$(BUILD_DIR)/soft_qw_obj/cd_linux.o \
$(BUILD_DIR)/soft_qw_obj/sys_linux.o \
$(BUILD_DIR)/soft_qw_obj/snd_linux.o \
ifeq ($(ARCH),i386)
SOFT_AS_OBJS = \
$(BUILD_DIR)/soft_qw_obj/d_copy.o \
$(BUILD_DIR)/soft_qw_obj/d_draw.o \
$(BUILD_DIR)/soft_qw_obj/d_draw16.o \
$(BUILD_DIR)/soft_qw_obj/d_parta.o \
$(BUILD_DIR)/soft_qw_obj/d_polysa.o \
$(BUILD_DIR)/soft_qw_obj/d_scana.o \
$(BUILD_DIR)/soft_qw_obj/d_spr8.o \
$(BUILD_DIR)/soft_qw_obj/d_varsa.o \
$(BUILD_DIR)/soft_qw_obj/math.o \
$(BUILD_DIR)/soft_qw_obj/r_aclipa.o \
$(BUILD_DIR)/soft_qw_obj/r_aliasa.o \
$(BUILD_DIR)/soft_qw_obj/r_drawa.o \
$(BUILD_DIR)/soft_qw_obj/r_edgea.o \
$(BUILD_DIR)/soft_qw_obj/r_varsa.o \
$(BUILD_DIR)/soft_qw_obj/snd_mixa.o \
$(BUILD_DIR)/soft_qw_obj/surf16.o \
$(BUILD_DIR)/soft_qw_obj/surf8.o \
$(BUILD_DIR)/soft_qw_obj/sys_dosa.o
else
SOFT_AS_OBJS=
endif
SOFT_SVGA_OBJS = $(BUILD_DIR)/soft_qw_obj/vid_svgalib.o
SOFT_X11_OBJS = $(BUILD_DIR)/soft_qw_obj/vid_x.o
$(BUILD_DIR)/qw-client-svga: $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS)
$(CC) $(CFLAGS) -o $@ $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS) \
$(SVGA_LDFLAGS)
$(BUILD_DIR)/qw-client-x11: $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_X11_OBJS)
$(CC) $(CFLAGS) -o $@ $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_X11_OBJS) \
$(X11_LDFLAGS)
$(BUILD_DIR)/soft_qw_obj/cl_demo.o: $(CLIENT_DIR)/cl_demo.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cl_ents.o: $(CLIENT_DIR)/cl_ents.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cl_input.o: $(CLIENT_DIR)/cl_input.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cl_main.o: $(CLIENT_DIR)/cl_main.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cl_parse.o: $(CLIENT_DIR)/cl_parse.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cl_pred.o: $(CLIENT_DIR)/cl_pred.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cl_tent.o: $(CLIENT_DIR)/cl_tent.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cl_cam.o: $(CLIENT_DIR)/cl_cam.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_edge.o: $(CLIENT_DIR)/d_edge.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_fill.o: $(CLIENT_DIR)/d_fill.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_init.o: $(CLIENT_DIR)/d_init.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_modech.o: $(CLIENT_DIR)/d_modech.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_part.o: $(CLIENT_DIR)/d_part.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_polyse.o: $(CLIENT_DIR)/d_polyse.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_scan.o: $(CLIENT_DIR)/d_scan.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_sky.o: $(CLIENT_DIR)/d_sky.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_sprite.o: $(CLIENT_DIR)/d_sprite.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_surf.o: $(CLIENT_DIR)/d_surf.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_vars.o: $(CLIENT_DIR)/d_vars.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/d_zpoint.o: $(CLIENT_DIR)/d_zpoint.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/draw.o: $(CLIENT_DIR)/draw.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/keys.o: $(CLIENT_DIR)/keys.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/menu.o: $(CLIENT_DIR)/menu.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/model.o: $(CLIENT_DIR)/model.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/nonintel.o: $(CLIENT_DIR)/nonintel.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_aclip.o: $(CLIENT_DIR)/r_aclip.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_alias.o: $(CLIENT_DIR)/r_alias.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_bsp.o: $(CLIENT_DIR)/r_bsp.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_draw.o: $(CLIENT_DIR)/r_draw.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_edge.o: $(CLIENT_DIR)/r_edge.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_efrag.o: $(CLIENT_DIR)/r_efrag.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_light.o: $(CLIENT_DIR)/r_light.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_main.o: $(CLIENT_DIR)/r_main.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_misc.o: $(CLIENT_DIR)/r_misc.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_part.o: $(CLIENT_DIR)/r_part.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_sky.o: $(CLIENT_DIR)/r_sky.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_sprite.o: $(CLIENT_DIR)/r_sprite.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_surf.o: $(CLIENT_DIR)/r_surf.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/r_vars.o: $(CLIENT_DIR)/r_vars.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/sbar.o: $(CLIENT_DIR)/sbar.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/screen.o: $(CLIENT_DIR)/screen.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/skin.o: $(CLIENT_DIR)/skin.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/view.o: $(CLIENT_DIR)/view.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/sys_linux.o: $(CLIENT_DIR)/sys_linux.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cmd.o: $(QW_COMMON_DIR)/cmd.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/common.o: $(QW_COMMON_DIR)/common.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/console.o: $(QW_COMMON_DIR)/console.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cvar.o: $(QW_COMMON_DIR)/cvar.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/md4.o: $(QW_COMMON_DIR)/md4.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/net_chan.o: $(QW_COMMON_DIR)/net_chan.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/net_udp.o: $(QW_COMMON_DIR)/net_udp.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/pmove.o: $(QW_COMMON_DIR)/pmove.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/pmovetst.o: $(QW_COMMON_DIR)/pmovetst.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/crc.o: $(COMMON_DIR)/crc.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/mathlib.o: $(COMMON_DIR)/mathlib.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/snd_dma.o: $(COMMON_DIR)/snd_dma.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/snd_mem.o: $(COMMON_DIR)/snd_mem.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/snd_mix.o: $(COMMON_DIR)/snd_mix.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/wad.o: $(COMMON_DIR)/wad.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/zone.o: $(COMMON_DIR)/zone.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/cd_linux.o: $(COMMON_DIR)/cd_linux.c
$(DO_CC)
$(BUILD_DIR)/soft_qw_obj/snd_linux.o: $(COMMON_DIR)/snd_linux.c
$(DO_CC)
# Assembler code
$(BUILD_DIR)/soft_qw_obj/d_copy.o: $(CLIENT_DIR)/d_copy.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/d_draw.o: $(CLIENT_DIR)/d_draw.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/d_draw16.o: $(CLIENT_DIR)/d_draw16.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/d_parta.o: $(CLIENT_DIR)/d_parta.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/d_polysa.o: $(CLIENT_DIR)/d_polysa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/d_scana.o: $(CLIENT_DIR)/d_scana.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/d_spr8.o: $(CLIENT_DIR)/d_spr8.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/d_varsa.o: $(CLIENT_DIR)/d_varsa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/r_aclipa.o: $(CLIENT_DIR)/r_aclipa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/r_aliasa.o: $(CLIENT_DIR)/r_aliasa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/r_drawa.o: $(CLIENT_DIR)/r_drawa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/r_edgea.o: $(CLIENT_DIR)/r_edgea.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/r_varsa.o: $(CLIENT_DIR)/r_varsa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/surf16.o: $(CLIENT_DIR)/surf16.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/surf8.o: $(CLIENT_DIR)/surf8.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/sys_dosa.o: $(CLIENT_DIR)/sys_dosa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/math.o: $(COMMON_DIR)/math.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/snd_mixa.o: $(COMMON_DIR)/snd_mixa.s
$(DO_AS)
$(BUILD_DIR)/soft_qw_obj/vid_svgalib.o: $(COMMON_DIR)/vid_svgalib.c
$(DO_O_CC)
$(BUILD_DIR)/soft_qw_obj/vid_x.o: $(COMMON_DIR)/vid_x.c
$(DO_CC)
#
# OpenGL Client
#
GL_OBJS = \
$(BUILD_DIR)/gl_qw_obj/cl_demo.o \
$(BUILD_DIR)/gl_qw_obj/cl_ents.o \
$(BUILD_DIR)/gl_qw_obj/cl_input.o \
$(BUILD_DIR)/gl_qw_obj/cl_main.o \
$(BUILD_DIR)/gl_qw_obj/cl_parse.o \
$(BUILD_DIR)/gl_qw_obj/cl_pred.o \
$(BUILD_DIR)/gl_qw_obj/cl_tent.o \
$(BUILD_DIR)/gl_qw_obj/cl_cam.o \
$(BUILD_DIR)/gl_qw_obj/cmd.o \
$(BUILD_DIR)/gl_qw_obj/common.o \
$(BUILD_DIR)/gl_qw_obj/console.o \
$(BUILD_DIR)/gl_qw_obj/crc.o \
$(BUILD_DIR)/gl_qw_obj/cvar.o \
$(BUILD_DIR)/gl_qw_obj/keys.o \
$(BUILD_DIR)/gl_qw_obj/mathlib.o \
$(BUILD_DIR)/gl_qw_obj/md4.o \
$(BUILD_DIR)/gl_qw_obj/menu.o \
$(BUILD_DIR)/gl_qw_obj/net_chan.o \
$(BUILD_DIR)/gl_qw_obj/net_udp.o \
$(BUILD_DIR)/gl_qw_obj/nonintel.o \
$(BUILD_DIR)/gl_qw_obj/pmove.o \
$(BUILD_DIR)/gl_qw_obj/pmovetst.o \
$(BUILD_DIR)/gl_qw_obj/r_part.o \
$(BUILD_DIR)/gl_qw_obj/sbar.o \
$(BUILD_DIR)/gl_qw_obj/skin.o \
$(BUILD_DIR)/gl_qw_obj/snd_dma.o \
$(BUILD_DIR)/gl_qw_obj/snd_mem.o \
$(BUILD_DIR)/gl_qw_obj/snd_mix.o \
$(BUILD_DIR)/gl_qw_obj/view.o \
$(BUILD_DIR)/gl_qw_obj/wad.o \
$(BUILD_DIR)/gl_qw_obj/zone.o \
$(BUILD_DIR)/gl_qw_obj/cd_linux.o \
$(BUILD_DIR)/gl_qw_obj/sys_linux.o \
$(BUILD_DIR)/gl_qw_obj/snd_linux.o \
\
$(BUILD_DIR)/gl_qw_obj/gl_draw.o \
$(BUILD_DIR)/gl_qw_obj/gl_mesh.o \
$(BUILD_DIR)/gl_qw_obj/gl_model.o \
$(BUILD_DIR)/gl_qw_obj/gl_ngraph.o \
$(BUILD_DIR)/gl_qw_obj/gl_refrag.o \
$(BUILD_DIR)/gl_qw_obj/gl_rlight.o \
$(BUILD_DIR)/gl_qw_obj/gl_rmain.o \
$(BUILD_DIR)/gl_qw_obj/gl_rmisc.o \
$(BUILD_DIR)/gl_qw_obj/gl_rsurf.o \
$(BUILD_DIR)/gl_qw_obj/gl_screen.o \
$(BUILD_DIR)/gl_qw_obj/gl_warp.o \
\
$(BUILD_DIR)/gl_qw_obj/math.o \
$(BUILD_DIR)/gl_qw_obj/snd_mixa.o \
$(BUILD_DIR)/gl_qw_obj/sys_dosa.o
GL_SVGA_OBJS = $(BUILD_DIR)/gl_qw_obj/gl_vidlinux.o
GL_X11_OBJS = $(BUILD_DIR)/gl_qw_obj/gl_vidlinuxglx.o
$(BUILD_DIR)/qw-client-glide: $(GL_OBJS) $(GL_SVGA_OBJS)
$(CC) $(CFLAGS) -o $@ $(GL_OBJS) $(GL_SVGA_OBJS) $(LDFLAGS) $(GL_SVGA_LDFLAGS)
$(BUILD_DIR)/qw-client-gl: $(GL_OBJS) $(GL_X11_OBJS)
$(CC) $(CFLAGS) -o $@ $(GL_OBJS) $(GL_X11_OBJS) $(LDFLAGS) $(GL_X11_LDFLAGS)
$(BUILD_DIR)/gl_qw_obj/cl_demo.o: $(CLIENT_DIR)/cl_demo.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cl_ents.o: $(CLIENT_DIR)/cl_ents.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cl_input.o: $(CLIENT_DIR)/cl_input.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cl_main.o: $(CLIENT_DIR)/cl_main.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cl_parse.o: $(CLIENT_DIR)/cl_parse.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cl_pred.o: $(CLIENT_DIR)/cl_pred.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cl_tent.o: $(CLIENT_DIR)/cl_tent.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cl_cam.o: $(CLIENT_DIR)/cl_cam.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cmd.o: $(QW_COMMON_DIR)/cmd.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/common.o: $(QW_COMMON_DIR)/common.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/console.o: $(QW_COMMON_DIR)/console.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/crc.o: $(COMMON_DIR)/crc.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cvar.o: $(QW_COMMON_DIR)/cvar.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/keys.o: $(CLIENT_DIR)/keys.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/mathlib.o: $(COMMON_DIR)/mathlib.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/md4.o: $(QW_COMMON_DIR)/md4.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/menu.o: $(CLIENT_DIR)/menu.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/net_chan.o: $(QW_COMMON_DIR)/net_chan.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/net_udp.o: $(QW_COMMON_DIR)/net_udp.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/nonintel.o: $(CLIENT_DIR)/nonintel.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/pmove.o: $(QW_COMMON_DIR)/pmove.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/pmovetst.o: $(QW_COMMON_DIR)/pmovetst.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/r_part.o: $(CLIENT_DIR)/r_part.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/sbar.o: $(CLIENT_DIR)/sbar.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/screen.o: $(CLIENT_DIR)/screen.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/skin.o: $(CLIENT_DIR)/skin.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/snd_dma.o: $(COMMON_DIR)/snd_dma.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/snd_mem.o: $(COMMON_DIR)/snd_mem.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/snd_mix.o: $(COMMON_DIR)/snd_mix.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/view.o: $(CLIENT_DIR)/view.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/wad.o: $(COMMON_DIR)/wad.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/zone.o: $(COMMON_DIR)/zone.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/cd_linux.o: $(COMMON_DIR)/cd_linux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/sys_linux.o: $(CLIENT_DIR)/sys_linux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/snd_linux.o: $(COMMON_DIR)/snd_linux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_draw.o: $(CLIENT_DIR)/gl_draw.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_mesh.o: $(CLIENT_DIR)/gl_mesh.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_model.o: $(CLIENT_DIR)/gl_model.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_ngraph.o: $(CLIENT_DIR)/gl_ngraph.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_refrag.o: $(CLIENT_DIR)/gl_refrag.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_rlight.o: $(CLIENT_DIR)/gl_rlight.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_rmain.o: $(CLIENT_DIR)/gl_rmain.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_rmisc.o: $(CLIENT_DIR)/gl_rmisc.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_rsurf.o: $(CLIENT_DIR)/gl_rsurf.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_screen.o: $(CLIENT_DIR)/gl_screen.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_vidlinux.o: $(CLIENT_DIR)/gl_vidlinux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_vidlinuxglx.o: $(COMMON_DIR)/gl_vidlinuxglx.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/gl_warp.o: $(CLIENT_DIR)/gl_warp.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_qw_obj/sys_dosa.o: $(CLIENT_DIR)/sys_dosa.s
$(DO_GL_AS)
$(BUILD_DIR)/gl_qw_obj/math.o: $(COMMON_DIR)/math.s
$(DO_GL_AS)
$(BUILD_DIR)/gl_qw_obj/snd_mixa.o: $(COMMON_DIR)/snd_mixa.s
$(DO_GL_AS)
#############################################################################
# MISC
#############################################################################
clean: clean-soft clean-gl
-rmdir $(BUILD_DIR)
@echo Done.
clean-soft:
-rm -rf $(SOFT_TARGETS) $(BUILD_DIR)/soft_qw_obj
clean-gl:
-rm -rf $(GL_TARGETS) $(BUILD_DIR)/gl_qw_obj

45
qw_client/Makefile.in Normal file
View file

@ -0,0 +1,45 @@
########################################################################
#
# Quake general stuff
#
@MAKEFILE_HEADER@
PROJECT_DIR = @top_srcdir@
SRC_DIR = @srcdir@
QW_COMMON_DIR= $(PROJECT_DIR)/qw_common
BIN_PREFIX = qw-client
########################################################################
#
# Client targets
#
@CLIENT_TARGETS@
########################################################################
#
# Source files
#
@SRCFILES@
########################################################################
#
# Directory specific stuff
#
DEFS = @DEFS@ @STRICMP_DEF@
CFLAGS = -DQUAKEWORLD $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) -I$(QW_COMMON_DIR) -I$(COMMON_DIR)
ALL_X11_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(QW_X11_VID_SRC) model.c
ALL_GL_SRC = $(GENERAL_SRC) $(GL_REND_SRC) $(GL_VID_SRC) $(QW_GL_REND_SRC)
GENERAL_SRC = $(CL_COMMON_SRC) \
$(QW_CL_SRC) $(QW_NET_SRC) net_chan.c skin.c \
$(QW_CL_SYS_SRC) \
$(QW_GENERAL_SRC)
# XXX - add dos/win specifc source
###########################################################################
#
# Compilation rules
#
@COMP_RULES@
@MAKEFILE_TAIL@

View file

@ -23,12 +23,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h" #include "quakedef.h"
#include "winquake.h" #include "winquake.h"
#ifdef __sun__
/* Sun's model_t in sys/model.h conflicts w/ Quake's model_t */
#define model_t sunmodel_t
#endif
#ifdef _WIN32 #ifdef _WIN32
#include "winsock.h" #include "winsock.h"
#else #else
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
#ifdef __sun__
#undef model_t
#endif
// we need to declare some mouse variables here, because the menu system // we need to declare some mouse variables here, because the menu system
// references them even when on a unix system. // references them even when on a unix system.

View file

@ -747,7 +747,13 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
} }
} }
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, trans); glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 64, 64, 0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, trans);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@ -1124,7 +1130,14 @@ texels += scaled_width * scaled_height;
{ {
if (!mipmap) if (!mipmap)
{ {
glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width,
scaled_height, 0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, data);
goto done; goto done;
} }
memcpy (scaled, data, width*height*4); memcpy (scaled, data, width*height*4);
@ -1132,7 +1145,14 @@ texels += scaled_width * scaled_height;
else else
GL_ResampleTexture (data, width, height, scaled, scaled_width, scaled_height); GL_ResampleTexture (data, width, height, scaled, scaled_width, scaled_height);
glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height,
0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, scaled);
if (mipmap) if (mipmap)
{ {
int miplevel; int miplevel;
@ -1148,7 +1168,14 @@ texels += scaled_width * scaled_height;
if (scaled_height < 1) if (scaled_height < 1)
scaled_height = 1; scaled_height = 1;
miplevel++; miplevel++;
glTexImage2D (GL_TEXTURE_2D, miplevel, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, miplevel, samples,
scaled_width, scaled_height, 0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, scaled);
} }
} }
done: ; done: ;
@ -1214,7 +1241,10 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
{ {
if (!mipmap) if (!mipmap)
{ {
// FIXME - what if this extension isn't available?
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data); glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data);
#endif
goto done; goto done;
} }
memcpy (scaled, data, width*height); memcpy (scaled, data, width*height);
@ -1222,7 +1252,10 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
else else
GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height); GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height);
// FIXME - what if this extension isn't available?
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
#endif
if (mipmap) if (mipmap)
{ {
int miplevel; int miplevel;
@ -1238,7 +1271,10 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
if (scaled_height < 1) if (scaled_height < 1)
scaled_height = 1; scaled_height = 1;
miplevel++; miplevel++;
// FIXME - what if this extension isn't available?
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
#endif
} }
} }
done: ; done: ;

View file

@ -275,10 +275,8 @@ extern float speedscale; // for top sky and bottom sky
void DrawGLWaterPoly (glpoly_t *p); void DrawGLWaterPoly (glpoly_t *p);
void DrawGLWaterPolyLightmap (glpoly_t *p); void DrawGLWaterPolyLightmap (glpoly_t *p);
#ifdef _WIN32
lpMTexFUNC qglMTexCoord2fSGIS = NULL; lpMTexFUNC qglMTexCoord2fSGIS = NULL;
lpSelTexFUNC qglSelectTextureSGIS = NULL; lpSelTexFUNC qglSelectTextureSGIS = NULL;
#endif
qboolean mtexenabled = false; qboolean mtexenabled = false;

View file

@ -33,6 +33,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void GL_BeginRendering (int *x, int *y, int *width, int *height); void GL_BeginRendering (int *x, int *y, int *width, int *height);
void GL_EndRendering (void); void GL_EndRendering (void);
#ifndef APIENTRY
/* Mesa defines APIENTRY, but other versions of OpenGL do not */
#ifdef GLAPIENTRY
#define APIENTRY GLAPIENTRY
#else
#define APIENTRY
#endif
#endif
// Function prototypes for the Texture Object Extension routines // Function prototypes for the Texture Object Extension routines
typedef GLboolean (GLAPIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *, typedef GLboolean (GLAPIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
@ -237,12 +245,10 @@ void GL_Bind (int texnum);
#define TEXTURE0_SGIS 0x835E #define TEXTURE0_SGIS 0x835E
#define TEXTURE1_SGIS 0x835F #define TEXTURE1_SGIS 0x835F
#ifdef _WIN32 typedef void (APIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat);
typedef void (GLAPIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat); typedef void (APIENTRY *lpSelTexFUNC) (GLenum);
typedef void (GLAPIENTRY *lpSelTexFUNC) (GLenum);
extern lpMTexFUNC qglMTexCoord2fSGIS; extern lpMTexFUNC qglMTexCoord2fSGIS;
extern lpSelTexFUNC qglSelectTextureSGIS; extern lpSelTexFUNC qglSelectTextureSGIS;
#endif
extern qboolean gl_mtexable; extern qboolean gl_mtexable;

View file

@ -127,7 +127,7 @@ void Sys_Printf (char *fmt, ...)
void Sys_Quit (void) void Sys_Quit (void)
{ {
Host_Shutdown(); Host_Shutdown();
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY); fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
exit(0); exit(0);
} }
@ -144,7 +144,7 @@ void Sys_Error (char *error, ...)
char string[1024]; char string[1024];
// change stdin to non blocking // change stdin to non blocking
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY); fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
va_start (argptr,error); va_start (argptr,error);
vsprintf (string,error,argptr); vsprintf (string,error,argptr);
@ -379,7 +379,7 @@ int main (int c, char **v)
noconinput = COM_CheckParm("-noconinput"); noconinput = COM_CheckParm("-noconinput");
if (!noconinput) if (!noconinput)
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY); fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
if (COM_CheckParm("-nostdout")) if (COM_CheckParm("-nostdout"))
nostdout = 1; nostdout = 1;

View file

@ -432,8 +432,6 @@ float Q_atof (char *str)
============================================================================ ============================================================================
*/ */
qboolean bigendien;
short (*BigShort) (short l); short (*BigShort) (short l);
short (*LittleShort) (short l); short (*LittleShort) (short l);
int (*BigLong) (int l); int (*BigLong) (int l);
@ -1197,29 +1195,21 @@ COM_Init
*/ */
void COM_Init (void) void COM_Init (void)
{ {
byte swaptest[2] = {1,0}; #ifdef WORDS_BIGENDIAN
// set the byte swapping variables in a portable manner
if ( *(short *)swaptest == 1)
{
bigendien = false;
BigShort = ShortSwap;
LittleShort = ShortNoSwap;
BigLong = LongSwap;
LittleLong = LongNoSwap;
BigFloat = FloatSwap;
LittleFloat = FloatNoSwap;
}
else
{
bigendien = true;
BigShort = ShortNoSwap; BigShort = ShortNoSwap;
LittleShort = ShortSwap; LittleShort = ShortSwap;
BigLong = LongNoSwap; BigLong = LongNoSwap;
LittleLong = LongSwap; LittleLong = LongSwap;
BigFloat = FloatNoSwap; BigFloat = FloatNoSwap;
LittleFloat = FloatSwap; LittleFloat = FloatSwap;
} #else
BigShort = ShortSwap;
LittleShort = ShortNoSwap;
BigLong = LongSwap;
LittleLong = LongNoSwap;
BigFloat = FloatSwap;
LittleFloat = FloatNoSwap;
#endif
Cvar_RegisterVariable (&registered); Cvar_RegisterVariable (&registered);
Cmd_AddCommand ("path", COM_Path_f); Cmd_AddCommand ("path", COM_Path_f);

View file

@ -88,8 +88,6 @@ void InsertLinkAfter (link_t *l, link_t *after);
//============================================================================ //============================================================================
extern qboolean bigendien;
extern short (*BigShort) (short l); extern short (*BigShort) (short l);
extern short (*LittleShort) (short l); extern short (*LittleShort) (short l);
extern int (*BigLong) (int l); extern int (*BigLong) (int l);

View file

@ -21,6 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h" #include "quakedef.h"
#ifdef __sun__
/* Sun's model_t in sys/model.h conflicts w/ Quake's model_t */
#define model_t sunmodel_t
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -31,12 +35,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <arpa/inet.h> #include <arpa/inet.h>
#include <errno.h> #include <errno.h>
#if defined(sun) #ifdef __sun__
#include <unistd.h> #include <unistd.h>
#endif
#ifdef sun
#include <sys/filio.h> #include <sys/filio.h>
#undef model_t
#endif #endif
#ifdef NeXT #ifdef NeXT

View file

@ -1,190 +0,0 @@
#
# QuakeWorld Makefile for unified tree
#
VERSION=2.40
ifneq (,$(findstring alpha,$(shell uname -m)))
ARCH=axp
else
ARCH=$(shell uname -m | sed s/i.86/i386/)
endif
PROJECT_DIR=..
COMMON_DIR=$(PROJECT_DIR)/common
QW_COMMON_DIR=$(PROJECT_DIR)/qw_common
CLIENT_DIR=$(PROJECT_DIR)/qw_client
SERVER_DIR=$(PROJECT_DIR)/qw_server
BUILD_DIR=$(PROJECT_DIR)/build
X11_DIR=/usr/X11R6
INCL=-I. -I$(SERVER_DIR) -I$(QW_COMMON_DIR) -I$(COMMON_DIR) -I$(X11_DIR)/include
LIBS=-L$(X11_DIR)/lib
CC=gcc
BASE_CFLAGS=-Wall -DQUAKEWORLD -DSERVERONLY -Dstricmp=strcasecmp $(INCL)
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
ifeq ($(ARCH),i386)
RELEASE_CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2
else
RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations
endif
LDFLAGS=-lm
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_O_CC=$(CC) -O $(CFLAGS) -o $@ -c $<
DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
#############################################################################
# SETUP AND BUILD
#############################################################################
TARGETS=$(BUILD_DIR)/qw_server
all: debug release
.PHONY: all
debug: $(BUILD_DIR) $(BUILD_DIR)/server_obj
$(MAKE) targets CFLAGS="$(DEBUG_CFLAGS)"
release: $(BUILD_DIR) $(BUILD_DIR)/server_obj
$(MAKE) targets CFLAGS="$(RELEASE_CFLAGS)"
targets: $(TARGETS)
$(BUILD_DIR):
@-mkdir $(BUILD_DIR)
$(BUILD_DIR)/server_obj:
@-mkdir $(BUILD_DIR)/server_obj
#############################################################################
# SERVER
#############################################################################
SERVER_OBJS = \
$(BUILD_DIR)/server_obj/pr_cmds.o \
$(BUILD_DIR)/server_obj/pr_edict.o \
$(BUILD_DIR)/server_obj/pr_exec.o \
$(BUILD_DIR)/server_obj/sv_init.o \
$(BUILD_DIR)/server_obj/sv_main.o \
$(BUILD_DIR)/server_obj/sv_nchan.o \
$(BUILD_DIR)/server_obj/sv_ents.o \
$(BUILD_DIR)/server_obj/sv_send.o \
$(BUILD_DIR)/server_obj/sv_move.o \
$(BUILD_DIR)/server_obj/sv_phys.o \
$(BUILD_DIR)/server_obj/sv_user.o \
$(BUILD_DIR)/server_obj/sv_ccmds.o \
$(BUILD_DIR)/server_obj/world.o \
$(BUILD_DIR)/server_obj/sys_unix.o \
$(BUILD_DIR)/server_obj/model.o \
$(BUILD_DIR)/server_obj/cmd.o \
$(BUILD_DIR)/server_obj/common.o \
$(BUILD_DIR)/server_obj/crc.o \
$(BUILD_DIR)/server_obj/cvar.o \
$(BUILD_DIR)/server_obj/mathlib.o \
$(BUILD_DIR)/server_obj/md4.o \
$(BUILD_DIR)/server_obj/zone.o \
$(BUILD_DIR)/server_obj/pmove.o \
$(BUILD_DIR)/server_obj/pmovetst.o \
$(BUILD_DIR)/server_obj/net_chan.o \
$(BUILD_DIR)/server_obj/net_udp.o
$(BUILD_DIR)/qw_server: $(SERVER_OBJS)
$(CC) $(CFLAGS) -o $@ $(SERVER_OBJS) $(LDFLAGS)
$(BUILD_DIR)/server_obj/pr_cmds.o: $(SERVER_DIR)/pr_cmds.c
$(DO_CC)
$(BUILD_DIR)/server_obj/pr_edict.o: $(SERVER_DIR)/pr_edict.c
$(DO_CC)
$(BUILD_DIR)/server_obj/pr_exec.o: $(SERVER_DIR)/pr_exec.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_init.o: $(SERVER_DIR)/sv_init.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_main.o: $(SERVER_DIR)/sv_main.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_nchan.o: $(SERVER_DIR)/sv_nchan.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_ents.o: $(SERVER_DIR)/sv_ents.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_send.o: $(SERVER_DIR)/sv_send.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_move.o: $(SERVER_DIR)/sv_move.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_phys.o: $(SERVER_DIR)/sv_phys.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_user.o: $(SERVER_DIR)/sv_user.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sv_ccmds.o: $(SERVER_DIR)/sv_ccmds.c
$(DO_CC)
$(BUILD_DIR)/server_obj/world.o: $(SERVER_DIR)/world.c
$(DO_CC)
$(BUILD_DIR)/server_obj/sys_unix.o: $(SERVER_DIR)/sys_unix.c
$(DO_CC)
$(BUILD_DIR)/server_obj/model.o: $(SERVER_DIR)/model.c
$(DO_CC)
$(BUILD_DIR)/server_obj/crc.o: $(COMMON_DIR)/crc.c
$(DO_CC)
$(BUILD_DIR)/server_obj/mathlib.o: $(COMMON_DIR)/mathlib.c
$(DO_CC)
$(BUILD_DIR)/server_obj/zone.o: $(COMMON_DIR)/zone.c
$(DO_CC)
$(BUILD_DIR)/server_obj/cmd.o: $(QW_COMMON_DIR)/cmd.c
$(DO_CC)
$(BUILD_DIR)/server_obj/common.o: $(QW_COMMON_DIR)/common.c
$(DO_CC)
$(BUILD_DIR)/server_obj/cvar.o: $(QW_COMMON_DIR)/cvar.c
$(DO_CC)
$(BUILD_DIR)/server_obj/md4.o: $(QW_COMMON_DIR)/md4.c
$(DO_CC)
$(BUILD_DIR)/server_obj/net_chan.o: $(QW_COMMON_DIR)/net_chan.c
$(DO_CC)
$(BUILD_DIR)/server_obj/net_udp.o: $(QW_COMMON_DIR)/net_udp.c
$(DO_CC)
$(BUILD_DIR)/server_obj/pmove.o: $(QW_COMMON_DIR)/pmove.c
$(DO_CC)
$(BUILD_DIR)/server_obj/pmovetst.o: $(QW_COMMON_DIR)/pmovetst.c
$(DO_CC)
#############################################################################
# MISC
#############################################################################
clean:
-rm -rf $(TARGETS) $(BUILD_DIR)/server_obj
-rmdir $(BUILD_DIR)
@echo Done.

84
qw_server/Makefile.in Normal file
View file

@ -0,0 +1,84 @@
########################################################################
#
# Quake general stuff
#
@MAKEFILE_HEADER@
PROJECT_DIR = @top_srcdir@
SRC_DIR = @srcdir@
QW_COMMON_DIR= $(PROJECT_DIR)/qw_common
########################################################################
#
# Source files
#
@SRCFILES@
########################################################################
#
# Directory specific stuff
#
CFLAGS = -DQUAKEWORLD -DSERVERONLY $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) -I$(QW_COMMON_DIR) -I$(COMMON_DIR)
DEFS = @DEFS@ @STRICMP_DEF@
SRVQUAKE = qw-server
targets = $(SRVQUAKE)
.PHONY: $(SRVQUAKE)
GENERAL_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c \
$(QW_NET_SRC) net_chan.c $(SRV_SRC) $(QW_SRV_SRC) \
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(ADDITIONAL_GENERAL_SRC) \
$(QW_GENERAL_SRC)
ALL_QW_SRV_SRC = $(GENERAL_SRC) $(SRV_VID_SRC) model.c
# XXX - add dos/win specifc source
x: Makefile
@echo binaries: $(targets)
@echo other targets: distclean
all: $(targets)
###########################################################################
#
# qw-server
#
OBJSqw-server = $(patsubst %,$(BUILD_DIR)/srv/%, \
$(addsuffix .@OBJEXT@, $(basename $(ALL_QW_SRV_SRC) .c .s)))
SRV_CFLAGS = -DSRV $(X_CFLAGS)
# XXX - Don't use X_EXTRA_LIBS below
SRV_LDFLAGS = @X_EXTRA_LIBS@ -lm
MAKE_SURE_srv_DIR = @DIR=srv; $(MAKE_SURE_DIR)
$(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_srv_DIR)
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_srv_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_srv_DIR)
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/srv/%.o: $(QW_COMMON_DIR)/%.c
$(MAKE_SURE_srv_DIR)
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_srv_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(SRVQUAKE): $(BUILD_DIR)/bin/$(SRVQUAKE)
$(BUILD_DIR)/bin/$(SRVQUAKE): $(OBJSqw-server)
$(MAKE_SURE_bin_DIR)
$(CC) $(CFLAGS) $(OBJSqw-server) $(SRV_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(SRVQUAKE)
# XXX - Can this be automated?
clean-$(SRVQUAKE):
rm -f $(OBJSqw-server)
clean: clean-$(SRVQUAKE)
@MAKEFILE_TAIL@

View file

@ -24,7 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <libc.h> #include <libc.h>
#endif #endif
#if defined(__linux__) || defined(sun) // FIXME: use autoconf
#if defined(unix) || defined(_AIX)
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>

154
rules.in Normal file
View file

@ -0,0 +1,154 @@
###########################################################################
#
# quake-x11
#
ifneq ($(X11QUAKE),)
# Map the list of source files into a list of object files
OBJSquake-x11 = $(patsubst %,$(BUILD_DIR)/x11/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_X11_SRC) .c .s)))
X11_CFLAGS = -DX11 $(X_CFLAGS)
X11_LDFLAGS = @X_LIBS@ -lX11 @X11_SHM_LIB@ @X_EXTRA_LIBS@ -lm
# 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_x11_DIR = @DIR=x11; $(MAKE_SURE_DIR)
$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_x11_DIR)
$(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_x11_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_x11_DIR)
$(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $<
ifneq ($(QW_COMMON_DIR),)
$(BUILD_DIR)/x11/%.o: $(QW_COMMON_DIR)/%.c
$(MAKE_SURE_x11_DIR)
$(CC) $(CFLAGS) $(X11_CFLAGS) -o $@ -c $<
endif
$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_x11_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(X11QUAKE): $(BUILD_DIR)/bin/$(X11QUAKE)
$(BUILD_DIR)/bin/$(X11QUAKE): $(OBJSquake-x11)
$(MAKE_SURE_bin_DIR)
$(CC) $(CFLAGS) $(OBJSquake-x11) $(X11_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(X11QUAKE)
# XXX - Can this be automated?
clean-$(X11QUAKE):
rm -f $(OBJSquake-x11)
endif
###########################################################################
#
# quake-svga
#
ifneq ($(SVGAQUAKE),)
ALL_SVGA_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(SVGA_VID_SRC) model.c
OBJSquake-svga= $(patsubst %,$(BUILD_DIR)/svga/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_SVGA_SRC) .c .s)))
SVGA_CFLAGS =
SVGA_LDFLAGS = -lvga
SVGA_VID_SRC = vid_svgalib.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_svga_DIR = @DIR=svga; $(MAKE_SURE_DIR)
# Not sure why this -O is needed, but it is...
$(BUILD_DIR)/svga/vid_svgalib.o: $(COMMON_DIR)/vid_svgalib.c
$(MAKE_SURE_svga_DIR)
$(CC) -O $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_svga_DIR)
$(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_svga_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_svga_DIR)
$(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $<
ifneq ($(QW_COMMON_DIR),)
$(BUILD_DIR)/svga/%.o: $(QW_COMMON_DIR)/%.c
$(MAKE_SURE_svga_DIR)
$(CC) $(CFLAGS) $(SVGA_CFLAGS) -o $@ -c $<
endif
$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_svga_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(SVGAQUAKE): $(BUILD_DIR)/bin/$(SVGAQUAKE)
$(BUILD_DIR)/bin/$(SVGAQUAKE): $(OBJSquake-svga)
$(MAKE_SURE_bin_DIR)
$(CC) $(CFLAGS) $(OBJSquake-svga) $(SVGA_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(SVGAQUAKE)
# XXX - Can this be automated?
clean-$(SVGAQUAKE):
rm -f $(OBJSquake-svga)
endif
###########################################################################
#
# quake-gl
#
ifneq ($(GLQUAKE),)
OBJSquake-gl = $(patsubst %,$(BUILD_DIR)/gl/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_GL_SRC) .c .s)))
GL_CFLAGS = -DGLQUAKE @OGL_CFLAGS@
GL_LDFLAGS = $(X11_LDFLAGS) @OGL_LDFLAGS@ -lGL
# XXX - this is for glx
# XXX - is this platform independent?
GL_VID_SRC = gl_vidlinuxglx.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_gl_DIR = @DIR=gl; $(MAKE_SURE_DIR)
$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_gl_DIR)
$(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_gl_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_gl_DIR)
$(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
ifneq ($(QW_COMMON_DIR),)
$(BUILD_DIR)/gl/%.o: $(QW_COMMON_DIR)/%.c
$(MAKE_SURE_gl_DIR)
$(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
endif
$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_gl_DIR)
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
$(GLQUAKE): $(BUILD_DIR)/bin/$(GLQUAKE)
$(BUILD_DIR)/bin/$(GLQUAKE): $(OBJSquake-gl)
$(MAKE_SURE_bin_DIR)
$(CC) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/bin/$(GLQUAKE)
# XXX - Can this be automated?
clean-$(GLQUAKE):
rm -f $(OBJSquake-gl)
endif

84
srcfiles.in Normal file
View file

@ -0,0 +1,84 @@
# **** Note - two apps may appear to share source, but they may just share
# source file *names*
ifeq ($(INTEL_ARCH),yes)
# Source file the Intel archictecture only
UQ_GENERAL_SRC = worlda.s
UQ_SWREND_SRC_PLAT = dosasm.s
CL_ADDITIONAL_GENERAL_SRC = sys_dosa.s math.s
SWREND_SRC_PLAT = d_copy.s d_draw.s d_draw16.s d_parta.s d_polysa.s d_scana.s \
d_spr8.s d_varsa.s r_aclipa.s r_aliasa.s \
r_drawa.s r_edgea.s r_varsa.s surf16.s surf8.s
else
# Source files for non-Intel platforms
SWREND_SRC_PLAT = nonintel.c
endif
#
# System specific source files
#
CD_AUDIO_SRC = @CD_AUDIO_SRC@
MACH_SND_SRC = @SND_SRC@
X11_VID_SRC = @X11_VID_SRC@
QW_X11_VID_SRC = vid_x.c
SYS_SRC = @SYS_SRC@
QW_CL_SYS_SRC = @QW_CL_SYS_SRC@
QW_SRV_SYS_SRC = @QW_SRV_SYS_SRC@
#
# Networking source files
#
# XXX - Should not assume UNIX
NET_SRC = net_bsd.c net_udp.c
QW_NET_SRC = net_udp.c md4.c
UQ_NET_SRC = net_dgrm.c net_loop.c net_main.c net_vcr.c $(NET_SRC)
#
# Common source files
#
MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c
SND_SRC = snd_mem.c snd_mix.c $(MACH_SND_SRC)
#
# Rendering source files
#
# OpenGL
GL_REND_SRC = gl_screen.c gl_model.c gl_draw.c gl_mesh.c gl_refrag.c \
gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c gl_test.c gl_warp.c
QW_GL_REND_SRC = gl_ngraph.c
# Software source
SW_REND_SRC = screen.c $(SWREND_SRC_PLAT) draw.c \
d_edge.c d_fill.c d_init.c d_modech.c d_part.c d_polyse.c d_scan.c \
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c r_aclip.c r_alias.c \
r_bsp.c r_draw.c r_edge.c r_efrag.c r_light.c r_main.c r_misc.c \
r_sky.c r_sprite.c r_surf.c r_vars.c
#
# Client source files
#
CL_SRC = cl_demo.c cl_input.c cl_main.c cl_parse.c cl_tent.c
QW_CL_SRC = cl_cam.c cl_ents.c cl_pred.c
CL_GUI_SRC= console.c sbar.c view.c keys.c menu.c
#
# Server source files
#
# Server-related source used by all
SRV_SRC = sv_main.c sv_user.c sv_move.c sv_phys.c
# Server-related source used just by QW server
QW_SRV_SRC = sv_ccmds.c sv_ents.c sv_init.c sv_send.c sv_nchan.c world.c
# Server-related source used just by UQ
UQ_SRV_SRC = host.c host_cmd.c $(SRV_SRC)
SRV_PR_SRC = pr_cmds.c pr_edict.c pr_exec.c
QW_GENERAL_SRC = pmove.c pmovetst.c
# Source common to both UQ and QW-client
CL_COMMON_SRC = $(MISC_SRC) $(CL_GUI_SRC) $(CL_SRC) \
$(CL_ADDITIONAL_GENERAL_SRC) $(SND_SRC) $(CD_AUDIO_SRC) r_part.c

View file

@ -1,745 +0,0 @@
#
# UQuake makefile for unified tree
#
VERSION=0.1.0
ARCH=$(shell uname -m | sed -e s/i.86/i386/ )
PROJECT_DIR=..
COMMON_DIR=$(PROJECT_DIR)/common
UQ_DIR=$(PROJECT_DIR)/uquake
BUILD_DIR=$(PROJECT_DIR)/build
BUILD_RELEASE_DIR=release-$(ARCH)
X11_DIR=/usr/X11R6
INCL=-I. -I$(UQ_DIR) -I$(COMMON_DIR) -I$(X11_DIR)/include
CC=gcc
BASE_CFLAGS=-Wall -Dstricmp=strcasecmp $(INCL)
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
ifeq ($(ARCH),i386)
RELEASE_CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2
else
RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations
endif
GL_CFLAGS=-DGLQUAKE -I$(X11_DIR)/include -I/usr/include/glide
LDFLAGS=-lm
SVGA_LDFLAGS=$(LDFLAGS) -lvga
X11_LDFLAGS=-L$(X11_DIR)/lib $(LDFLAGS) -lX11 -lXext
GL_X11_LDFLAGS=-L$(X11_DIR)/lib $(LDFLAGS) -lGL -lX11 -lSM -lICE -lXext -lXxf86dga -lXxf86vm
GL_GLIDE_LDFLAGS=-L$(X11_DIR)/lib -lvga -lGL -lglide2x -lX11 -lXext -ldl
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
DO_GL_CC=$(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
DO_GL_AS=$(CC) $(CFLAGS) $(GL_CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
DO_O_CC=$(CC) -O $(CFLAGS) -o $@ -c $<
#############################################################################
# SETUP AND BUILD
#############################################################################
SOFT_TARGETS=$(BUILD_DIR)/quake-svga \
$(BUILD_DIR)/quake-x11
GL_TARGETS=$(BUILD_DIR)/quake-gl \
$(BUILD_DIR)/quake-glide
debug: debug-soft debug-gl
release: release-soft release-gl
all: debug-soft release-soft debug-gl release-gl
debug-soft: $(BUILD_DIR) $(BUILD_DIR)/soft_uq_obj $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS) $(SOFT_X11_OBJS)
$(MAKE) soft-targets CFLAGS="$(DEBUG_CFLAGS)"
debug-gl: $(BUILD_DIR) $(BUILD_DIR)/gl_uq_obj $(GL_OBJS) $(GL_AS_OBJS) $(GL_SVGA_OBJS) $(GL_X11_OBJS)
$(MAKE) gl-targets CFLAGS="$(DEBUG_CFLAGS)"
release-soft: $(BUILD_DIR) $(BUILD_DIR)/soft_uq_obj $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS) $(SOFT_X11_OBJS)
$(MAKE) soft-targets CFLAGS="$(RELEASE_CFLAGS)"
release-gl: $(BUILD_DIR) $(BUILD_DIR)/gl_uq_obj $(GL_OBJS) $(GL_AS_OBJS) $(GL_SVGA_OBJS) $(GL_X11_OBJS)
$(MAKE) gl-targets CFLAGS="$(RELEASE_CFLAGS)"
soft-targets: $(SOFT_TARGETS)
gl-targets: $(GL_TARGETS)
$(BUILD_DIR):
@mkdir $(BUILD_DIR)
$(BUILD_DIR)/soft_uq_obj:
@mkdir $(BUILD_DIR)/soft_uq_obj
$(BUILD_DIR)/gl_uq_obj:
@mkdir $(BUILD_DIR)/gl_uq_obj
#############################################################################
# Software Renderer
#############################################################################
SOFT_OBJS = \
$(BUILD_DIR)/soft_uq_obj/cl_demo.o \
$(BUILD_DIR)/soft_uq_obj/cl_input.o \
$(BUILD_DIR)/soft_uq_obj/cl_main.o \
$(BUILD_DIR)/soft_uq_obj/cl_parse.o \
$(BUILD_DIR)/soft_uq_obj/cl_tent.o \
$(BUILD_DIR)/soft_uq_obj/chase.o \
$(BUILD_DIR)/soft_uq_obj/cmd.o \
$(BUILD_DIR)/soft_uq_obj/common.o \
$(BUILD_DIR)/soft_uq_obj/console.o \
$(BUILD_DIR)/soft_uq_obj/crc.o \
$(BUILD_DIR)/soft_uq_obj/cvar.o \
$(BUILD_DIR)/soft_uq_obj/draw.o \
$(BUILD_DIR)/soft_uq_obj/d_edge.o \
$(BUILD_DIR)/soft_uq_obj/d_fill.o \
$(BUILD_DIR)/soft_uq_obj/d_init.o \
$(BUILD_DIR)/soft_uq_obj/d_modech.o \
$(BUILD_DIR)/soft_uq_obj/d_part.o \
$(BUILD_DIR)/soft_uq_obj/d_polyse.o \
$(BUILD_DIR)/soft_uq_obj/d_scan.o \
$(BUILD_DIR)/soft_uq_obj/d_sky.o \
$(BUILD_DIR)/soft_uq_obj/d_sprite.o \
$(BUILD_DIR)/soft_uq_obj/d_surf.o \
$(BUILD_DIR)/soft_uq_obj/d_vars.o \
$(BUILD_DIR)/soft_uq_obj/d_zpoint.o \
$(BUILD_DIR)/soft_uq_obj/host.o \
$(BUILD_DIR)/soft_uq_obj/host_cmd.o \
$(BUILD_DIR)/soft_uq_obj/keys.o \
$(BUILD_DIR)/soft_uq_obj/mathlib.o \
$(BUILD_DIR)/soft_uq_obj/menu.o \
$(BUILD_DIR)/soft_uq_obj/model.o \
$(BUILD_DIR)/soft_uq_obj/net_bsd.o \
$(BUILD_DIR)/soft_uq_obj/net_dgrm.o \
$(BUILD_DIR)/soft_uq_obj/net_loop.o \
$(BUILD_DIR)/soft_uq_obj/net_main.o \
$(BUILD_DIR)/soft_uq_obj/net_udp.o \
$(BUILD_DIR)/soft_uq_obj/net_vcr.o \
$(BUILD_DIR)/soft_uq_obj/nonintel.o \
$(BUILD_DIR)/soft_uq_obj/pr_cmds.o \
$(BUILD_DIR)/soft_uq_obj/pr_edict.o \
$(BUILD_DIR)/soft_uq_obj/pr_exec.o \
$(BUILD_DIR)/soft_uq_obj/r_aclip.o \
$(BUILD_DIR)/soft_uq_obj/r_alias.o \
$(BUILD_DIR)/soft_uq_obj/r_bsp.o \
$(BUILD_DIR)/soft_uq_obj/r_draw.o \
$(BUILD_DIR)/soft_uq_obj/r_edge.o \
$(BUILD_DIR)/soft_uq_obj/r_efrag.o \
$(BUILD_DIR)/soft_uq_obj/r_light.o \
$(BUILD_DIR)/soft_uq_obj/r_main.o \
$(BUILD_DIR)/soft_uq_obj/r_misc.o \
$(BUILD_DIR)/soft_uq_obj/r_part.o \
$(BUILD_DIR)/soft_uq_obj/r_sky.o \
$(BUILD_DIR)/soft_uq_obj/r_sprite.o \
$(BUILD_DIR)/soft_uq_obj/r_surf.o \
$(BUILD_DIR)/soft_uq_obj/r_vars.o \
$(BUILD_DIR)/soft_uq_obj/sbar.o \
$(BUILD_DIR)/soft_uq_obj/screen.o \
$(BUILD_DIR)/soft_uq_obj/snd_dma.o \
$(BUILD_DIR)/soft_uq_obj/snd_mem.o \
$(BUILD_DIR)/soft_uq_obj/snd_mix.o \
$(BUILD_DIR)/soft_uq_obj/sv_main.o \
$(BUILD_DIR)/soft_uq_obj/sv_phys.o \
$(BUILD_DIR)/soft_uq_obj/sv_move.o \
$(BUILD_DIR)/soft_uq_obj/sv_user.o \
$(BUILD_DIR)/soft_uq_obj/view.o \
$(BUILD_DIR)/soft_uq_obj/wad.o \
$(BUILD_DIR)/soft_uq_obj/world.o \
$(BUILD_DIR)/soft_uq_obj/zone.o \
$(BUILD_DIR)/soft_uq_obj/cd_linux.o \
$(BUILD_DIR)/soft_uq_obj/snd_linux.o \
$(BUILD_DIR)/soft_uq_obj/sys_linux.o \
ifeq ($(ARCH),i386)
SOFT_AS_OBJS = \
$(BUILD_DIR)/soft_uq_obj/d_copy.o \
$(BUILD_DIR)/soft_uq_obj/d_draw.o \
$(BUILD_DIR)/soft_uq_obj/d_draw16.o \
$(BUILD_DIR)/soft_uq_obj/d_parta.o \
$(BUILD_DIR)/soft_uq_obj/d_polysa.o \
$(BUILD_DIR)/soft_uq_obj/d_scana.o \
$(BUILD_DIR)/soft_uq_obj/d_spr8.o \
$(BUILD_DIR)/soft_uq_obj/d_varsa.o \
$(BUILD_DIR)/soft_uq_obj/math.o \
$(BUILD_DIR)/soft_uq_obj/r_aliasa.o \
$(BUILD_DIR)/soft_uq_obj/r_drawa.o \
$(BUILD_DIR)/soft_uq_obj/r_edgea.o \
$(BUILD_DIR)/soft_uq_obj/r_varsa.o \
$(BUILD_DIR)/soft_uq_obj/surf16.o \
$(BUILD_DIR)/soft_uq_obj/surf8.o \
$(BUILD_DIR)/soft_uq_obj/worlda.o \
$(BUILD_DIR)/soft_uq_obj/r_aclipa.o \
$(BUILD_DIR)/soft_uq_obj/snd_mixa.o \
$(BUILD_DIR)/soft_uq_obj/sys_dosa.o
else
SOFT_AS_OBJS=
endif
SOFT_SVGA_OBJS = $(BUILD_DIR)/soft_uq_obj/vid_svgalib.o
SOFT_X11_OBJS = $(BUILD_DIR)/soft_uq_obj/vid_x.o
$(BUILD_DIR)/quake-svga: $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS)
$(CC) $(CFLAGS) -o $@ $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_SVGA_OBJS) \
$(SVGA_LDFLAGS)
$(BUILD_DIR)/quake-x11: $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_X11_OBJS)
$(CC) $(CFLAGS) -o $@ $(SOFT_OBJS) $(SOFT_AS_OBJS) $(SOFT_X11_OBJS) \
$(X11_LDFLAGS)
$(BUILD_DIR)/soft_uq_obj/cl_demo.o: $(UQ_DIR)/cl_demo.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/cl_input.o: $(UQ_DIR)/cl_input.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/cl_main.o: $(UQ_DIR)/cl_main.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/cl_parse.o: $(UQ_DIR)/cl_parse.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/cl_tent.o: $(UQ_DIR)/cl_tent.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/chase.o: $(UQ_DIR)/chase.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/cmd.o: $(UQ_DIR)/cmd.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/common.o: $(UQ_DIR)/common.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/console.o: $(UQ_DIR)/console.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/crc.o: $(UQ_DIR)/crc.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/cvar.o: $(UQ_DIR)/cvar.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/draw.o: $(UQ_DIR)/draw.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_edge.o: $(UQ_DIR)/d_edge.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_fill.o: $(UQ_DIR)/d_fill.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_init.o: $(UQ_DIR)/d_init.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_modech.o: $(UQ_DIR)/d_modech.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_part.o: $(UQ_DIR)/d_part.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_polyse.o: $(UQ_DIR)/d_polyse.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_scan.o: $(UQ_DIR)/d_scan.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_sky.o: $(UQ_DIR)/d_sky.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_sprite.o: $(UQ_DIR)/d_sprite.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_surf.o: $(UQ_DIR)/d_surf.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_vars.o: $(UQ_DIR)/d_vars.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/d_zpoint.o: $(UQ_DIR)/d_zpoint.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/host.o : $(UQ_DIR)/host.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/host_cmd.o : $(UQ_DIR)/host_cmd.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/keys.o: $(UQ_DIR)/keys.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/mathlib.o: $(COMMON_DIR)/mathlib.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/menu.o: $(UQ_DIR)/menu.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/model.o: $(UQ_DIR)/model.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/net_dgrm.o: $(UQ_DIR)/net_dgrm.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/net_loop.o: $(UQ_DIR)/net_loop.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/net_main.o: $(UQ_DIR)/net_main.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/net_vcr.o: $(UQ_DIR)/net_vcr.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/net_udp.o: $(UQ_DIR)/net_udp.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/net_bsd.o: $(UQ_DIR)/net_bsd.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/nonintel.o: $(UQ_DIR)/nonintel.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/pr_cmds.o : $(UQ_DIR)/pr_cmds.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/pr_edict.o : $(UQ_DIR)/pr_edict.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/pr_exec.o : $(UQ_DIR)/pr_exec.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_aclip.o: $(UQ_DIR)/r_aclip.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_alias.o: $(UQ_DIR)/r_alias.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_bsp.o: $(UQ_DIR)/r_bsp.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_draw.o: $(UQ_DIR)/r_draw.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_edge.o: $(UQ_DIR)/r_edge.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_efrag.o: $(UQ_DIR)/r_efrag.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_light.o: $(UQ_DIR)/r_light.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_main.o: $(UQ_DIR)/r_main.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_misc.o: $(UQ_DIR)/r_misc.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_part.o: $(UQ_DIR)/r_part.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_sky.o: $(UQ_DIR)/r_sky.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_sprite.o: $(UQ_DIR)/r_sprite.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_surf.o: $(UQ_DIR)/r_surf.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/r_vars.o: $(UQ_DIR)/r_vars.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/sbar.o: $(UQ_DIR)/sbar.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/screen.o: $(UQ_DIR)/screen.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/snd_dma.o: $(COMMON_DIR)/snd_dma.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/snd_mem.o: $(COMMON_DIR)/snd_mem.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/snd_mix.o: $(COMMON_DIR)/snd_mix.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/snd_linux.o: $(COMMON_DIR)/snd_linux.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/sv_main.o: $(UQ_DIR)/sv_main.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/sv_phys.o: $(UQ_DIR)/sv_phys.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/sv_move.o: $(UQ_DIR)/sv_move.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/sv_user.o: $(UQ_DIR)/sv_user.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/view.o: $(UQ_DIR)/view.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/wad.o: $(COMMON_DIR)/wad.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/world.o: $(UQ_DIR)/world.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/zone.o: $(COMMON_DIR)/zone.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/cd_linux.o: $(COMMON_DIR)/cd_linux.c
$(DO_CC)
$(BUILD_DIR)/soft_uq_obj/sys_linux.o: $(UQ_DIR)/sys_linux.c
$(DO_CC)
# Assembler code
$(BUILD_DIR)/soft_uq_obj/d_copy.o: $(UQ_DIR)/d_copy.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/d_draw.o: $(UQ_DIR)/d_draw.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/d_draw16.o: $(UQ_DIR)/d_draw16.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/d_parta.o: $(UQ_DIR)/d_parta.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/d_polysa.o: $(UQ_DIR)/d_polysa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/d_scana.o: $(UQ_DIR)/d_scana.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/d_spr8.o: $(UQ_DIR)/d_spr8.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/d_varsa.o: $(UQ_DIR)/d_varsa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/math.o: $(COMMON_DIR)/math.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/r_aclipa.o: $(UQ_DIR)/r_aclipa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/r_aliasa.o: $(UQ_DIR)/r_aliasa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/r_drawa.o: $(UQ_DIR)/r_drawa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/r_edgea.o: $(UQ_DIR)/r_edgea.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/r_varsa.o: $(UQ_DIR)/r_varsa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/surf16.o: $(UQ_DIR)/surf16.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/surf8.o: $(UQ_DIR)/surf8.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/snd_mixa.o: $(COMMON_DIR)/snd_mixa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/sys_dosa.o: $(UQ_DIR)/sys_dosa.s
$(DO_AS)
$(BUILD_DIR)/soft_uq_obj/worlda.o: $(UQ_DIR)/worlda.s
$(DO_AS)
# specific things
$(BUILD_DIR)/soft_uq_obj/vid_svgalib.o: $(COMMON_DIR)/vid_svgalib.c
$(DO_O_CC)
$(BUILD_DIR)/soft_uq_obj/vid_x.o: $(COMMON_DIR)/vid_x.c
$(DO_CC)
# ---------------------------------------------------------------------------
# GL Stuff..
# ---------------------------------------------------------------------------
GL_OBJS =\
$(BUILD_DIR)/gl_uq_obj/cl_demo.o \
$(BUILD_DIR)/gl_uq_obj/cl_input.o \
$(BUILD_DIR)/gl_uq_obj/cl_main.o \
$(BUILD_DIR)/gl_uq_obj/cl_parse.o \
$(BUILD_DIR)/gl_uq_obj/cl_tent.o \
$(BUILD_DIR)/gl_uq_obj/chase.o \
$(BUILD_DIR)/gl_uq_obj/cmd.o \
$(BUILD_DIR)/gl_uq_obj/common.o \
$(BUILD_DIR)/gl_uq_obj/console.o \
$(BUILD_DIR)/gl_uq_obj/crc.o \
$(BUILD_DIR)/gl_uq_obj/cvar.o \
\
$(BUILD_DIR)/gl_uq_obj/gl_draw.o \
$(BUILD_DIR)/gl_uq_obj/gl_mesh.o \
$(BUILD_DIR)/gl_uq_obj/gl_model.o \
$(BUILD_DIR)/gl_uq_obj/gl_refrag.o \
$(BUILD_DIR)/gl_uq_obj/gl_rlight.o \
$(BUILD_DIR)/gl_uq_obj/gl_rmain.o \
$(BUILD_DIR)/gl_uq_obj/gl_rmisc.o \
$(BUILD_DIR)/gl_uq_obj/gl_rsurf.o \
$(BUILD_DIR)/gl_uq_obj/gl_screen.o \
$(BUILD_DIR)/gl_uq_obj/gl_test.o \
$(BUILD_DIR)/gl_uq_obj/gl_warp.o \
\
$(BUILD_DIR)/gl_uq_obj/host.o \
$(BUILD_DIR)/gl_uq_obj/host_cmd.o \
$(BUILD_DIR)/gl_uq_obj/keys.o \
$(BUILD_DIR)/gl_uq_obj/menu.o \
$(BUILD_DIR)/gl_uq_obj/mathlib.o \
$(BUILD_DIR)/gl_uq_obj/net_dgrm.o \
$(BUILD_DIR)/gl_uq_obj/net_loop.o \
$(BUILD_DIR)/gl_uq_obj/net_main.o \
$(BUILD_DIR)/gl_uq_obj/net_vcr.o \
$(BUILD_DIR)/gl_uq_obj/net_udp.o \
$(BUILD_DIR)/gl_uq_obj/net_bsd.o \
$(BUILD_DIR)/gl_uq_obj/pr_cmds.o \
$(BUILD_DIR)/gl_uq_obj/pr_edict.o \
$(BUILD_DIR)/gl_uq_obj/pr_exec.o \
$(BUILD_DIR)/gl_uq_obj/r_part.o \
$(BUILD_DIR)/gl_uq_obj/sbar.o \
$(BUILD_DIR)/gl_uq_obj/sv_main.o \
$(BUILD_DIR)/gl_uq_obj/sv_phys.o \
$(BUILD_DIR)/gl_uq_obj/sv_move.o \
$(BUILD_DIR)/gl_uq_obj/sv_user.o \
$(BUILD_DIR)/gl_uq_obj/zone.o \
$(BUILD_DIR)/gl_uq_obj/view.o \
$(BUILD_DIR)/gl_uq_obj/wad.o \
$(BUILD_DIR)/gl_uq_obj/world.o \
$(BUILD_DIR)/gl_uq_obj/cd_linux.o \
$(BUILD_DIR)/gl_uq_obj/sys_linux.o \
$(BUILD_DIR)/gl_uq_obj/snd_dma.o \
$(BUILD_DIR)/gl_uq_obj/snd_mem.o \
$(BUILD_DIR)/gl_uq_obj/snd_mix.o \
$(BUILD_DIR)/gl_uq_obj/snd_linux.o
GL_AS_OBJS =\
$(BUILD_DIR)/gl_uq_obj/math.o \
$(BUILD_DIR)/gl_uq_obj/worlda.o \
$(BUILD_DIR)/gl_uq_obj/snd_mixa.o \
$(BUILD_DIR)/gl_uq_obj/sys_dosa.o
GL_X11_OBJS = $(BUILD_DIR)/gl_uq_obj/gl_vidlinuxglx.o
GL_GLIDE_OBJS = $(BUILD_DIR)/gl_uq_obj/gl_vidlinux.o
$(BUILD_DIR)/quake-gl: $(GL_OBJS) $(GL_AS_OBJS) $(GL_X11_OBJS)
$(CC) $(CFLAGS) -o $@ $(GL_OBJS) $(GL_AS_OBJS) $(GL_X11_OBJS) $(GL_X11_LDFLAGS)
$(BUILD_DIR)/quake-glide: $(GL_OBJS) $(GL_AS_OBJS) $(GL_GLIDE_OBJS)
$(CC) $(CFLAGS) -o $@ $(GL_OBJS) $(GL_AS_OBJS) $(GL_GLIDE_OBJS) $(GL_GLIDE_LDFLAGS)
$(BUILD_DIR)/gl_uq_obj/cl_demo.o : $(UQ_DIR)/cl_demo.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/cl_input.o : $(UQ_DIR)/cl_input.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/cl_main.o : $(UQ_DIR)/cl_main.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/cl_parse.o : $(UQ_DIR)/cl_parse.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/cl_tent.o : $(UQ_DIR)/cl_tent.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/chase.o : $(UQ_DIR)/chase.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/cmd.o : $(UQ_DIR)/cmd.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/common.o : $(UQ_DIR)/common.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/console.o : $(UQ_DIR)/console.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/crc.o : $(UQ_DIR)/crc.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/cvar.o : $(UQ_DIR)/cvar.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_draw.o : $(UQ_DIR)/gl_draw.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_mesh.o : $(UQ_DIR)/gl_mesh.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_model.o : $(UQ_DIR)/gl_model.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_refrag.o : $(UQ_DIR)/gl_refrag.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_rlight.o : $(UQ_DIR)/gl_rlight.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_rmain.o : $(UQ_DIR)/gl_rmain.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_rmisc.o : $(UQ_DIR)/gl_rmisc.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_rsurf.o : $(UQ_DIR)/gl_rsurf.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_screen.o : $(UQ_DIR)/gl_screen.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_test.o : $(UQ_DIR)/gl_test.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_vidlinux.o : $(UQ_DIR)/gl_vidlinux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_vidlinuxglx.o : $(COMMON_DIR)/gl_vidlinuxglx.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/gl_warp.o : $(UQ_DIR)/gl_warp.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/host.o : $(UQ_DIR)/host.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/host_cmd.o : $(UQ_DIR)/host_cmd.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/keys.o : $(UQ_DIR)/keys.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/menu.o : $(UQ_DIR)/menu.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/mathlib.o : $(COMMON_DIR)/mathlib.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/net_dgrm.o : $(UQ_DIR)/net_dgrm.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/net_loop.o : $(UQ_DIR)/net_loop.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/net_main.o : $(UQ_DIR)/net_main.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/net_vcr.o : $(UQ_DIR)/net_vcr.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/net_udp.o : $(UQ_DIR)/net_udp.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/net_bsd.o : $(UQ_DIR)/net_bsd.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/pr_cmds.o : $(UQ_DIR)/pr_cmds.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/pr_edict.o : $(UQ_DIR)/pr_edict.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/pr_exec.o : $(UQ_DIR)/pr_exec.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/r_part.o : $(UQ_DIR)/r_part.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/sbar.o : $(UQ_DIR)/sbar.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/sv_main.o : $(UQ_DIR)/sv_main.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/sv_phys.o : $(UQ_DIR)/sv_phys.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/sv_move.o : $(UQ_DIR)/sv_move.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/sv_user.o : $(UQ_DIR)/sv_user.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/zone.o : $(COMMON_DIR)/zone.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/view.o : $(UQ_DIR)/view.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/wad.o : $(COMMON_DIR)/wad.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/world.o : $(UQ_DIR)/world.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/cd_linux.o : $(COMMON_DIR)/cd_linux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/sys_linux.o : $(UQ_DIR)/sys_linux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/snd_dma.o : $(COMMON_DIR)/snd_dma.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/snd_mem.o : $(COMMON_DIR)/snd_mem.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/snd_mix.o : $(COMMON_DIR)/snd_mix.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/snd_linux.o : $(COMMON_DIR)/snd_linux.c
$(DO_GL_CC)
$(BUILD_DIR)/gl_uq_obj/math.o : $(COMMON_DIR)/math.s
$(DO_GL_AS)
$(BUILD_DIR)/gl_uq_obj/worlda.o : $(UQ_DIR)/worlda.s
$(DO_GL_AS)
$(BUILD_DIR)/gl_uq_obj/snd_mixa.o : $(COMMON_DIR)/snd_mixa.s
$(DO_GL_AS)
$(BUILD_DIR)/gl_uq_obj/sys_dosa.o : $(UQ_DIR)/sys_dosa.s
$(DO_GL_AS)
#############################################################################
# MISC
#############################################################################
clean: clean-soft clean-gl
@echo Done.
clean-soft:
-rm -rf $(SOFT_TARGETS) $(BUILD_DIR)/soft_uq_obj
clean-gl:
-rm -rf $(GL_TARGETS) $(BUILD_DIR)/gl_uq_obj

46
uquake/Makefile.in Normal file
View file

@ -0,0 +1,46 @@
########################################################################
#
# Quake general stuff
#
@MAKEFILE_HEADER@
PROJECT_DIR = @top_srcdir@
SRC_DIR = @srcdir@
UQ_DIR = $(SRC_DIR)
BIN_PREFIX = quake
########################################################################
#
# Client targets
#
@CLIENT_TARGETS@
########################################################################
#
# Source files
#
@SRCFILES@
########################################################################
#
# Directory specific stuff
#
DEFS = @DEFS@
CFLAGS = $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) -I$(COMMON_DIR) -I$(UQ_DIR)/include
ALL_X11_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(X11_VID_SRC) model.c
ALL_GL_SRC = $(GENERAL_SRC) $(GL_REND_SRC) $(GL_VID_SRC)
GENERAL_SRC = $(CL_COMMON_SRC) \
$(SYS_SRC) chase.c world.c $(SRV_PR_SRC) \
$(UQ_NET_SRC) $(UQ_SRV_SRC) \
$(UQ_GENERAL_SRC) $(UQ_SWREND_SRC_PLAT)
# XXX - add dos/win specific source
###########################################################################
#
# Compilation rules
#
@COMP_RULES@
@MAKEFILE_TAIL@

View file

@ -431,8 +431,6 @@ float Q_atof (char *str)
============================================================================ ============================================================================
*/ */
qboolean bigendien;
short (*BigShort) (short l); short (*BigShort) (short l);
short (*LittleShort) (short l); short (*LittleShort) (short l);
int (*BigLong) (int l); int (*BigLong) (int l);
@ -1124,29 +1122,21 @@ COM_Init
*/ */
void COM_Init (char *basedir) void COM_Init (char *basedir)
{ {
byte swaptest[2] = {1,0}; #ifdef WORDS_BIGENDIAN
// set the byte swapping variables in a portable manner
if ( *(short *)swaptest == 1)
{
bigendien = false;
BigShort = ShortSwap;
LittleShort = ShortNoSwap;
BigLong = LongSwap;
LittleLong = LongNoSwap;
BigFloat = FloatSwap;
LittleFloat = FloatNoSwap;
}
else
{
bigendien = true;
BigShort = ShortNoSwap; BigShort = ShortNoSwap;
LittleShort = ShortSwap; LittleShort = ShortSwap;
BigLong = LongNoSwap; BigLong = LongNoSwap;
LittleLong = LongSwap; LittleLong = LongSwap;
BigFloat = FloatNoSwap; BigFloat = FloatNoSwap;
LittleFloat = FloatSwap; LittleFloat = FloatSwap;
} #else
BigShort = ShortSwap;
LittleShort = ShortNoSwap;
BigLong = LongSwap;
LittleLong = LongNoSwap;
BigFloat = FloatSwap;
LittleFloat = FloatNoSwap;
#endif
Cvar_RegisterVariable (&registered); Cvar_RegisterVariable (&registered);
Cvar_RegisterVariable (&cmdline); Cvar_RegisterVariable (&cmdline);

View file

@ -85,8 +85,6 @@ void InsertLinkAfter (link_t *l, link_t *after);
//============================================================================ //============================================================================
extern qboolean bigendien;
extern short (*BigShort) (short l); extern short (*BigShort) (short l);
extern short (*LittleShort) (short l); extern short (*LittleShort) (short l);
extern int (*BigLong) (int l); extern int (*BigLong) (int l);

View file

@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h" #include "quakedef.h"
#define GL_COLOR_INDEX8_EXT 0x80E5
extern unsigned char d_15to8table[65536]; extern unsigned char d_15to8table[65536];
cvar_t gl_nobind = {"gl_nobind", "0"}; cvar_t gl_nobind = {"gl_nobind", "0"};
@ -668,7 +666,13 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
} }
} }
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, trans); glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 64, 64, 0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, trans);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@ -1031,7 +1035,13 @@ texels += scaled_width * scaled_height;
{ {
if (!mipmap) if (!mipmap)
{ {
glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, data);
goto done; goto done;
} }
memcpy (scaled, data, width*height*4); memcpy (scaled, data, width*height*4);
@ -1039,7 +1049,14 @@ texels += scaled_width * scaled_height;
else else
GL_ResampleTexture (data, width, height, scaled, scaled_width, scaled_height); GL_ResampleTexture (data, width, height, scaled, scaled_width, scaled_height);
glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, 0, samples, scaled_width, scaled_height,
0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, scaled);
if (mipmap) if (mipmap)
{ {
int miplevel; int miplevel;
@ -1055,7 +1072,14 @@ texels += scaled_width * scaled_height;
if (scaled_height < 1) if (scaled_height < 1)
scaled_height = 1; scaled_height = 1;
miplevel++; miplevel++;
glTexImage2D (GL_TEXTURE_2D, miplevel, samples, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, miplevel, samples,
scaled_width, scaled_height, 0,
#ifdef WORDS_BIGENDIAN
GL_ABGR_EXT,
#else
GL_RGBA,
#endif
GL_UNSIGNED_BYTE, scaled);
} }
} }
done: ; done: ;
@ -1121,7 +1145,12 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
{ {
if (!mipmap) if (!mipmap)
{ {
// FIXME - what if this extension is available at compile but not run time?
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data); glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data);
#else
Sys_Printf("Warning: GL_COLOR_INDEX8_EXT not supported\n");
#endif
goto done; goto done;
} }
memcpy (scaled, data, width*height); memcpy (scaled, data, width*height);
@ -1129,7 +1158,12 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
else else
GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height); GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height);
// FIXME - what if this extension is available at compile but not run time?
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
#else
Sys_Printf("Warning: GL_COLOR_INDEX8_EXT not supported\n");
#endif
if (mipmap) if (mipmap)
{ {
int miplevel; int miplevel;
@ -1145,7 +1179,10 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
if (scaled_height < 1) if (scaled_height < 1)
scaled_height = 1; scaled_height = 1;
miplevel++; miplevel++;
// FIXME - what if this extension is available at compile but not run time?
#ifdef HAVE_GL_COLOR_INDEX8_EXT
glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled); glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
#endif
} }
} }
done: ; done: ;

View file

@ -17,8 +17,16 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifdef _AIX
/* AIX's level_t in sys/types.h conflicts w/ Quake's level_t */
#define level_t sunlevel_t
#endif
#include "quakedef.h" #include "quakedef.h"
#ifdef _AIX
#undef level_t
#endif
#ifdef _WIN32 #ifdef _WIN32
#include "winquake.h" #include "winquake.h"
#endif #endif

View file

@ -20,11 +20,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// net_udp.c // net_udp.c
#include "quakedef.h" #include "quakedef.h"
#ifdef __sun__
/* Sun's model_t in sys/model.h conflicts w/ Quake's model_t */
#define model_t sunmodel_t
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@ -32,6 +35,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef __sun__ #ifdef __sun__
#include <sys/filio.h> #include <sys/filio.h>
#undef model_t
#endif
#if defined(sgi) && defined(sa_family)
/* Get rid of problematic SGI #def */
#undef sa_family
#endif #endif
#ifdef NeXT #ifdef NeXT

View file

@ -335,7 +335,8 @@ int main (int argc, char **argv)
// unroll the simulation loop to give the video side a chance to see _vid_default_mode // unroll the simulation loop to give the video side a chance to see _vid_default_mode
Host_Frame( 0.1 ); Host_Frame( 0.1 );
VID_SetDefaultMode(); // FIXME - probably should be deleted - this is just an empty function
// VID_SetDefaultMode();
oldtime = Sys_DoubleTime(); oldtime = Sys_DoubleTime();
while (1) while (1)