Quake. Needs you to have datafiles to be useful.

Original by Maurices Nonnekes, a few tweaks (sound, i386 optimizations,
longer save menus) by me.

The client/server part probably still needs some work... 
and it is definitely unaudited.

Packaging might be changed to account for docs...

In fact, I really need `common' package files and reference counting...
This commit is contained in:
espie 2001-08-03 13:02:16 +00:00
parent 7addc9870d
commit 39429549e3
16 changed files with 928 additions and 0 deletions

74
games/quake/Makefile Normal file
View File

@ -0,0 +1,74 @@
# $OpenBSD: Makefile,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
COMMENT= "Quake/Quake-world client"
COMMENT-server= "Quake world server"
CATEGORIES= games
NEED_VERSION= 1.405
FULLPKGNAME-server= quakeworld-server-20000101
PKGNAME= quake-20000101
DISTNAME= quake-v6-bsd-kame
PATCHFILES= quake6-00-v6-20000202b.diff.gz
PATCH_DIST_STRIP= -p1
HOMEPAGE= http://www.viagenie.qc.ca/en/ipv6-quake.shtml
MASTER_SITES= http://www.viagenie.qc.ca/quake/ \
ftp://ftp.kame.net/pub/kame/misc/
MAINTAINER= Maurice Nonnekes <maurice@amaze.nl>
# GPL
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
USE_GMAKE= Yes
MULTI_PACKAGES=-server
FLAVORS= sdl ggi
FLAVOR?= sdl
.if ${FLAVOR:L:Msdl} && ${FLAVOR:L:Mggi}
ERROR="Fatal: Choose only one flavor: sdl or ggi"
.endif
SUBPACKAGE?=
CONFIGURE_ENV=LDFLAGS='-L${LOCALBASE}/lib -L${X11BASE}/lib'
CONFIGURE_ENV+=CPPFLAGS='-I${LOCALBASE}/include -I${X11BASE}/include'
CONFIGURE_STYLE= autoconf
CONFIGURE_ARGS= --enable-release
CONFIGURE_ARGS+= --bindir=/bin
CONFIGURE_ARGS+= --with-opengl=no --with-opengl-includes=no
.if ${FLAVOR:L:Msdl}
. if !defined(PACKAGING) || ${SUBPACKAGE} == ""
LIB_DEPENDS= SDL.0.3:sdl-*-!no_x11:devel/sdl
. endif
CONFIGURE_ARGS+= --with-sdl=${LOCALBASE} --without-ggi
MAKE_FLAGS= HAS_X11=no
CFLAGS+= -pthread
.elif ${FLAVOR:L:Mggi}
. if !defined(PACKAGING) || ${SUBPACKAGE} == ""
LIB_DEPENDS= ggi.::devel/ggi
. endif
CONFIGURE_ARGS+= --with-ggi=${LOCALBASE} --without-sdl
MAKE_FLAGS= HAS_X11=no
.else
CONFIGURE_ARGS+= --without-sdl --without-ggi
MAKE_FLAGS=
.endif
WRKDIST= ${WRKDIR}/quakeforge
FAKE_FLAGS= ${MAKE_FLAGS} DESTDIR=${WRKINST}
post-extract:
cd ${WRKDIST}; rm config.cache config.log
cd ${WRKDIST}; find . -name \*.o |xargs rm
cp ${FILESDIR}/snd_openbsd.c ${WRKDIST}/common
post-patch:
cd ${WRKDIST}; autoreconf
.include <bsd.port.mk>

6
games/quake/files/md5 Normal file
View File

@ -0,0 +1,6 @@
MD5 (quake-v6-bsd-kame.tar.gz) = 634991e85ca27c8e867f387268c0ec48
MD5 (quake6-00-v6-20000202b.diff.gz) = 7b610d74ecff7087bc2a3c5f7180681d
RMD160 (quake-v6-bsd-kame.tar.gz) = 1844e193b62886c452a65c5c5780f58d19684109
RMD160 (quake6-00-v6-20000202b.diff.gz) = 5006cb749d68df7399af01be9caadb1f4e27be8f
SHA1 (quake-v6-bsd-kame.tar.gz) = 09d58eef39f3d8a6b7b7287c88fc66d4dd3feb0b
SHA1 (quake6-00-v6-20000202b.diff.gz) = a4a1cf178e40c5effb3faad0fa744bbbcd0a56ab

View File

@ -0,0 +1,176 @@
/*
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
# include <sys/audioio.h>
static int audio_fd;
static int snd_inited;
static int tryrates[] = { 11025, 22051, 44100, 8000 };
qboolean SNDDMA_Init(void)
{
int rc;
int fmt;
int tmp;
int i;
char *s;
audio_info_t info;
int caps;
snd_inited = 0;
// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
// XXX Must open audio Read-Write for now for dma to work !!!
audio_fd = open("/dev/audio", O_RDWR);
if (audio_fd < 0)
{
perror("/dev/audio");
Con_Printf("Could not open /dev/audio\n");
return 0;
}
if (ioctl(audio_fd, AUDIO_GETPROPS, &caps)==-1)
{
perror("/dev/audio");
Con_Printf("Sound driver does not understand GETPROPS\n");
close(audio_fd);
return 0;
}
if (!(caps & AUDIO_PROP_MMAP))
{
Con_Printf("Sorry but your soundcard doesn't support mmap\n");
close(audio_fd);
return 0;
}
shm = &sn;
shm->splitbuffer = 0;
// set sample bits & speed
shm->samplebits = 16;
shm->speed = 11025;
s = getenv("QUAKE_SOUND_CHANNELS");
if (s) shm->channels = atoi(s);
else if ((i = COM_CheckParm("-sndmono")) != 0)
shm->channels = 1;
else if ((i = COM_CheckParm("-sndstereo")) != 0)
shm->channels = 2;
else shm->channels = 2;
AUDIO_INITINFO(&info);
info.play.precision = shm->samplebits;
info.play.sample_rate = 11025;
info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
info.play.channels = shm->channels;
if (ioctl(audio_fd, AUDIO_SETINFO, &info) == -1) {
Con_Printf("Bad encoding size\n");
close(audio_fd);
return 0;
}
ioctl(audio_fd, AUDIO_GETINFO, &info);
shm->speed = info.play.sample_rate;
shm->samples = info.play.buffer_size / (shm->samplebits/8);
shm->submission_chunk = 1;
// memory map the dma buffer
// XXX This is absurd but dma does not work if not mmapped read/write.
shm->buffer = (unsigned char *) mmap(NULL, info.play.buffer_size,
PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
// if (!shm->buffer || shm->buffer == (unsigned char *)-1)
if (shm->buffer == MAP_FAILED)
{
perror("/dev/audio");
Con_Printf("Could not mmap /dev/audio\n");
close(audio_fd);
return 0;
}
shm->samplepos = 0;
snd_inited = 1;
return 1;
}
int SNDDMA_GetDMAPos(void)
{
audio_offset_t count;
if (!snd_inited) return 0;
if (ioctl(audio_fd, AUDIO_GETOOFFS, &count)==-1)
{
perror("/dev/audio");
Con_Printf("Uh, sound dead.\n");
close(audio_fd);
snd_inited = 0;
return 0;
}
// shm->samplepos = (count.bytes / (shm->samplebits / 8)) & (shm->samples-1);
// fprintf(stderr, "%d \r", count.ptr);
shm->samplepos = count.offset / (shm->samplebits / 8);
return shm->samplepos;
}
void SNDDMA_Shutdown(void)
{
if (snd_inited)
{
close(audio_fd);
snd_inited = 0;
}
}
/*
==============
SNDDMA_Submit
Send sound to device if buffer isn't really the dma buffer
===============
*/
void SNDDMA_Submit(void)
{
}

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-common_snd_oss_c,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
--- common/snd_oss.c.orig Mon Jul 23 05:23:56 2001
+++ common/snd_oss.c Mon Jul 23 05:24:12 2001
@@ -30,6 +30,9 @@ Foundation, Inc., 59 Temple Place - Suit
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
+#if defined HAVE_SOUNDCARD_H
+#include <soundcard.h>
+#endif
#if defined HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
#elif defined HAVE_LINUX_SOUNDCARD_H

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-configure_in,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
--- configure.in.orig Tue Jan 11 12:10:13 2000
+++ configure.in Tue Jul 31 17:26:42 2001
@@ -14,7 +14,7 @@ AC_PROG_MAKE_SET
dnl Checks for header files.
AC_CHECK_HEADERS(unistd.h windows.h sys/ioctl.h sys/mman.h sys/asoundlib.h \
- sys/soundcard.h linux/soundcard.h machine/soundcard.h sys/audioio.h \
+ sys/soundcard.h soundcard.h linux/soundcard.h machine/soundcard.h sys/audioio.h \
dsound.h mmsystem.h mme/mmsystem.h mme/mme_public.h)
dnl checks for compiler characteristics
@@ -232,10 +232,10 @@ if test "x$HAS_SVGA" != xyes; then
fi
dnl Make sure -lpthread works (for SDL)
-if test "x$HAS_SDL" = xyes; then
- AC_CHECK_LIB(pthread, pthread_exit ,SDL_LIBS="$SDL_LIBS -lpthread"
- HAS_SDL=yes, HAS_SDL=no, [$SDL_LIBS])
-fi
+dnl if test "x$HAS_SDL" = xyes; then
+dnl AC_CHECK_LIB(pthread, pthread_exit ,SDL_LIBS="$SDL_LIBS -lpthread"
+dnl HAS_SDL=yes, HAS_SDL=no, [$SDL_LIBS])
+dnl fi
if test "x$HAS_SDL" != xyes; then
SDL_CFLAGS="" SDL_LIBS=""
fi
@@ -453,6 +453,13 @@ case "${target}" in
SYS_SRC="sys_linux.c"
QW_CL_SYS_SRC="sys_linux.c"
QW_SRV_SYS_SRC="sys_unix.c"
+ ;;
+ *-*-openbsd*)
+ SYS_SRC="sys_unix.c"
+ QW_CL_SYS_SRC="sys_linux.c"
+ QW_SRV_SYS_SRC="sys_unix.c"
+ SND_STYLE="OpenBSD"
+ DEFAULT_SYS=yes
;;
*)
SYS_SRC="sys_unix.c"

View File

@ -0,0 +1,168 @@
$OpenBSD: patch-qw_client_Makefile_in,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
--- qw_client/Makefile.in.orig Mon Jul 23 05:30:00 2001
+++ qw_client/Makefile.in Mon Jul 23 05:31:19 2001
@@ -17,9 +17,10 @@ mandir = @mandir@
BUILD_DIR = ../targets/qw_client
-LDFLAGS = @LDFLAGS@ @SND_LIBS@ -lm -L/usr/local/v6/lib -linet6
+LDFLAGS = @LDFLAGS@ @SND_LIBS@ -lm
LIBS = @LIBS@
CC = @CC@
+CC_GL = @CC@ -pthread
INTEL_ARCH = @INTEL_ARCH@
ifneq ($(SRC_DIR),.)
@@ -77,7 +78,7 @@ RELEASE = @RELEASE@
ifeq ($(RELEASE),yes)
OPTFLAGS = @RELEASE_CFLAGS@
else
-OPTFLAGS = -g
+OPTFLAGS =
endif
targets = $(GGIQUAKE) $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE) $(SDLQUAKE)
@@ -130,6 +131,7 @@ SND_SRC = snd_alsa.c alsa.c
endif
ifeq ($(SND_STYLE),OSS)
SND_SRC = snd_dma.c snd_oss.c
+LDFLAGS+=-lossaudio
endif
ifeq ($(SND_STYLE),Solaris)
SND_SRC = snd_dma.c snd_sun.c
@@ -250,7 +252,7 @@ $(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_x11_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_x11_DIR)
@@ -264,7 +266,7 @@ endif
$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_x11_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(X11QUAKE): $(BUILD_DIR)/../$(X11QUAKE)
@@ -303,7 +305,7 @@ $(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_svga_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_svga_DIR)
@@ -317,7 +319,7 @@ endif
$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_svga_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(SVGAQUAKE): $(BUILD_DIR)/../$(SVGAQUAKE)
@@ -353,7 +355,7 @@ $(BUILD_DIR)/ggi/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/ggi/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_ggi_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/ggi/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_ggi_DIR)
@@ -367,7 +369,7 @@ endif
$(BUILD_DIR)/ggi/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_ggi_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(GGIQUAKE): $(BUILD_DIR)/../$(GGIQUAKE)
@@ -398,30 +400,30 @@ MAKE_SURE_gl_DIR = @DIR=gl; $(MAKE_SURE_
$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_gl_DIR)
- $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
+ $(CC_GL) $(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 $<
+ $(CC_GL) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_gl_DIR)
- $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
+ $(CC_GL) $(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 $<
+ $(CC_GL) $(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 $<
+ $(CC_GL) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(GLQUAKE): $(BUILD_DIR)/../$(GLQUAKE)
$(BUILD_DIR)/../$(GLQUAKE): $(OBJSquake-gl)
- $(CC) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(GLQUAKE)
+ $(CC_GL) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(GLQUAKE)
# XXX - Can this be automated?
clean-$(GLQUAKE):
@@ -450,7 +452,7 @@ $(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_3dfx_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_3dfx_DIR)
@@ -464,7 +466,7 @@ endif
$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_gl_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(TDFXQUAKE): $(BUILD_DIR)/../$(TDFXQUAKE)
@@ -500,7 +502,7 @@ $(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_sdl_DIR)
@@ -514,7 +516,7 @@ endif
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(SDLQUAKE): $(BUILD_DIR)/../$(SDLQUAKE)
@@ -540,7 +542,7 @@ clean: $(CLEAN_TARGETS)
install: $(targets)
$(PROJECT_DIR)/mkinstalldirs $(DESTDIR)$(prefix)$(bindir)
for i in $(targets); do \
- $(PROJECT_DIR)/install-sh -m 755 $(BUILD_DIR)/../$$i \
+ $(PROJECT_DIR)/install-sh -s -m 755 $(BUILD_DIR)/../$$i \
$(DESTDIR)$(prefix)$(bindir)/$$i; \
done

View File

@ -0,0 +1,39 @@
$OpenBSD: patch-qw_server_Makefile_in,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
--- qw_server/Makefile.in.orig Tue Jan 11 15:37:02 2000
+++ qw_server/Makefile.in Mon Jul 23 04:56:36 2001
@@ -16,7 +16,7 @@ COMMON_DIR=$(PROJECT_DIR)/common
QW_COMMON_DIR= $(PROJECT_DIR)/qw_common
BUILD_DIR = ../targets/qw_server
-LDFLAGS = @LDFLAGS@ -lm -L/usr/local/v6/lib -linet6
+LDFLAGS = @LDFLAGS@ -lm
LIBS = @LIBS@
CC = @CC@
INTEL_ARCH = @INTEL_ARCH@
@@ -109,7 +109,7 @@ $(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_srv_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_srv_DIR)
@@ -121,7 +121,7 @@ $(BUILD_DIR)/srv/%.o: $(QW_COMMON_DIR)/%
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_srv_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(SRVQUAKE): $(BUILD_DIR)/../$(SRVQUAKE)
@@ -148,7 +148,7 @@ clean: $(CLEAN_TARGETS)
install: $(targets)
$(PROJECT_DIR)/mkinstalldirs $(DESTDIR)$(prefix)$(bindir)
for i in $(targets); do \
- $(PROJECT_DIR)/install-sh -m 755 $(BUILD_DIR)/../$$i \
+ $(PROJECT_DIR)/install-sh -s -m 755 $(BUILD_DIR)/../$$i \
$(DESTDIR)$(prefix)$(bindir)/$$i; \
done

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-qw_server_sys_unix_c,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
--- qw_server/sys_unix.c.orig Mon Jul 23 04:26:39 2001
+++ qw_server/sys_unix.c Mon Jul 23 04:26:39 2001
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suit
#endif
// FIXME: use autoconf
-#if defined(unix) || defined(_AIX) || defined(__NetBSD__)
+#if defined(unix) || defined(_AIX) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/stat.h>
#include <unistd.h>
#include <sys/time.h>

View File

@ -0,0 +1,181 @@
$OpenBSD: patch-uquake_Makefile_in,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
--- uquake/Makefile.in.orig Thu Aug 2 04:23:05 2001
+++ uquake/Makefile.in Thu Aug 2 04:23:36 2001
@@ -16,9 +16,10 @@ mandir = @mandir@
COMMON_DIR=$(PROJECT_DIR)/common
BUILD_DIR =../targets/uquake
-LDFLAGS = @LDFLAGS@ @SND_LIBS@ -lm -L/usr/local/v6/lib -linet6
+LDFLAGS = @LDFLAGS@ @SND_LIBS@ -lm
LIBS = @LIBS@
CC = @CC@
+CC_GL = @CC@ -pthread
INTEL_ARCH = @INTEL_ARCH@
ifneq ($(SRC_DIR),.)
@@ -76,7 +77,7 @@ RELEASE = @RELEASE@
ifeq ($(RELEASE),yes)
OPTFLAGS = @RELEASE_CFLAGS@
else
-OPTFLAGS = -g
+OPTFLAGS =
endif
targets = $(GGIQUAKE) $(SVGAQUAKE) $(GLQUAKE) $(TDFXQUAKE) $(X11QUAKE) $(SDLQUAKE)
@@ -124,6 +125,9 @@ endif
ifeq ($(SND_STYLE),OSS)
SND_SRC = snd_dma.c snd_oss.c
endif
+ifeq ($(SND_STYLE),OpenBSD)
+SND_SRC = snd_dma.c snd_openbsd.c
+endif
ifeq ($(SND_STYLE),Solaris)
SND_SRC = snd_dma.c snd_sun.c
endif
@@ -195,7 +199,7 @@ CL_COMMON_SRC = $(MISC_SRC) $(CL_GUI_SRC
# Directory specific stuff
#
DEFS = @DEFS@
-CFLAGS = @CFLAGS@ $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) \
+CFLAGS += @CFLAGS@ -g $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) \
-I$(COMMON_DIR) -I$(SRC_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)
@@ -236,7 +240,7 @@ $(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/x11/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_x11_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_x11_DIR)
@@ -244,7 +248,7 @@ $(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.c
$(BUILD_DIR)/x11/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_x11_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(X11QUAKE): $(BUILD_DIR)/../$(X11QUAKE)
@@ -283,7 +287,7 @@ $(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/svga/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_svga_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_svga_DIR)
@@ -291,7 +295,7 @@ $(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.c
$(BUILD_DIR)/svga/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_svga_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(SVGAQUAKE): $(BUILD_DIR)/../$(SVGAQUAKE)
@@ -313,7 +317,7 @@ ALL_GGI_SRC = $(GENERAL_SRC) $(SW_REND_S
OBJSquake-ggi = $(patsubst %,$(BUILD_DIR)/ggi/%,$(addsuffix .@OBJEXT@, $(basename $(ALL_GGI_SRC) .c .s)))
GGI_CFLAGS = -DGGI @GGI_CFLAGS@
-GGI_LDFLAGS = @GGI_LIBS@
+GGI_LDFLAGS = -pthread @GGI_LIBS@
GGI_VID_SRC = vid_ggi.c
# This can be thought of as a macro that makes sure that the ggi
@@ -327,7 +331,7 @@ $(BUILD_DIR)/ggi/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/ggi/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_ggi_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/ggi/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_ggi_DIR)
@@ -335,7 +339,7 @@ $(BUILD_DIR)/ggi/%.o: $(COMMON_DIR)/%.c
$(BUILD_DIR)/ggi/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_ggi_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(GGIQUAKE): $(BUILD_DIR)/../$(GGIQUAKE)
@@ -365,24 +369,24 @@ MAKE_SURE_gl_DIR = @DIR=gl; $(MAKE_SURE_
$(BUILD_DIR)/gl/%.o: $(SRC_DIR)/%.c
$(MAKE_SURE_gl_DIR)
- $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
+ $(CC_GL) $(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 $<
+ $(CC_GL) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_gl_DIR)
- $(CC) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
+ $(CC_GL) $(CFLAGS) $(GL_CFLAGS) -o $@ -c $<
$(BUILD_DIR)/gl/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_gl_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC_GL) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(GLQUAKE): $(BUILD_DIR)/../$(GLQUAKE)
$(BUILD_DIR)/../$(GLQUAKE): $(OBJSquake-gl)
- $(CC) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(GLQUAKE)
+ $(CC_GL) $(CFLAGS) $(OBJSquake-gl) $(GL_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(GLQUAKE)
# XXX - Can this be automated?
clean-$(GLQUAKE):
@@ -411,7 +415,7 @@ $(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/3dfx/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_3dfx_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_3dfx_DIR)
@@ -419,7 +423,7 @@ $(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.c
$(BUILD_DIR)/3dfx/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_gl_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(TDFXQUAKE): $(BUILD_DIR)/../$(TDFXQUAKE)
@@ -455,7 +459,7 @@ $(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.c
$(BUILD_DIR)/sdl/%.o: $(SRC_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.c
$(MAKE_SURE_sdl_DIR)
@@ -463,7 +467,7 @@ $(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.c
$(BUILD_DIR)/sdl/%.o: $(COMMON_DIR)/%.s
$(MAKE_SURE_sdl_DIR)
- $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ $(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(SDLQUAKE): $(BUILD_DIR)/../$(SDLQUAKE)
@@ -489,7 +493,7 @@ clean: $(CLEAN_TARGETS)
install: $(targets)
$(PROJECT_DIR)/mkinstalldirs $(DESTDIR)$(prefix)$(bindir)
for i in $(targets); do \
- $(PROJECT_DIR)/install-sh -m 755 $(BUILD_DIR)/../$$i \
+ $(PROJECT_DIR)/install-sh -s -m 755 $(BUILD_DIR)/../$$i \
$(DESTDIR)$(prefix)$(bindir)/$$i; \
done

View File

@ -0,0 +1,189 @@
$OpenBSD: patch-uquake_menu_c,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
--- uquake/menu.c.orig Mon Jan 10 17:59:38 2000
+++ uquake/menu.c Fri Aug 3 14:41:45 2001
@@ -316,6 +316,18 @@ void M_Main_Key (int key)
CL_NextDemo ();
break;
+ case K_HOME:
+ case KP_HOME:
+ S_LocalSound ("misc/menu1.wav");
+ m_main_cursor = 0;
+ break;
+
+ case K_END:
+ case KP_END:
+ S_LocalSound ("misc/menu1.wav");
+ m_main_cursor = MAIN_ITEMS-1;
+ break;
+
case KP_DOWNARROW:
case K_DOWNARROW:
S_LocalSound ("misc/menu1.wav");
@@ -398,6 +410,18 @@ void M_SinglePlayer_Key (int key)
M_Menu_Main_f ();
break;
+ case K_HOME:
+ case KP_HOME:
+ S_LocalSound ("misc/menu1.wav");
+ m_singleplayer_cursor = 0;
+ break;
+
+ case K_END:
+ case KP_END:
+ S_LocalSound ("misc/menu1.wav");
+ m_singleplayer_cursor = SINGLEPLAYER_ITEMS-1;
+ break;
+
case KP_DOWNARROW:
case K_DOWNARROW:
S_LocalSound ("misc/menu1.wav");
@@ -444,8 +468,9 @@ void M_SinglePlayer_Key (int key)
/* LOAD/SAVE MENU */
int load_cursor; // 0 < load_cursor < MAX_SAVEGAMES
+int max_savegames; // actual value
-#define MAX_SAVEGAMES 12
+#define MAX_SAVEGAMES 80
char m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH+1];
int loadable[MAX_SAVEGAMES];
@@ -456,7 +481,11 @@ void M_ScanSaves (void)
FILE *f;
int version;
- for (i=0 ; i<MAX_SAVEGAMES ; i++)
+ max_savegames = (vid.height - 48)/8;
+ if (max_savegames > MAX_SAVEGAMES)
+ max_savegames = MAX_SAVEGAMES;
+
+ for (i=0 ; i<max_savegames ; i++)
{
strcpy (m_filenames[i], "--- UNUSED SLOT ---");
loadable[i] = false;
@@ -509,7 +538,7 @@ void M_Load_Draw (void)
p = Draw_CachePic ("gfx/p_load.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
- for (i=0 ; i< MAX_SAVEGAMES; i++)
+ for (i=0 ; i< max_savegames; i++)
M_Print (16, 32 + 8*i, m_filenames[i]);
// line cursor
@@ -525,7 +554,7 @@ void M_Save_Draw (void)
p = Draw_CachePic ("gfx/p_save.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
- for (i=0 ; i<MAX_SAVEGAMES ; i++)
+ for (i=0 ; i<max_savegames ; i++)
M_Print (16, 32 + 8*i, m_filenames[i]);
// line cursor
@@ -557,6 +586,34 @@ void M_Load_Key (int k)
Cbuf_AddText (va ("load s%i\n", load_cursor) );
return;
+ case K_PGDN:
+ case KP_PGDN:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor+= 10;
+ if (load_cursor >= max_savegames)
+ load_cursor -= max_savegames;
+ break;
+
+ case K_PGUP:
+ case KP_PGUP:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor-= 10;
+ if (load_cursor < 0)
+ load_cursor += max_savegames;
+ break;
+
+ case K_HOME:
+ case KP_HOME:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor = 0;
+ break;
+
+ case K_END:
+ case KP_END:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor = max_savegames-1;
+ break;
+
case KP_UPARROW:
case K_UPARROW:
case KP_LEFTARROW:
@@ -564,7 +621,7 @@ void M_Load_Key (int k)
S_LocalSound ("misc/menu1.wav");
load_cursor--;
if (load_cursor < 0)
- load_cursor = MAX_SAVEGAMES-1;
+ load_cursor = max_savegames-1;
break;
case KP_DOWNARROW:
@@ -573,7 +630,7 @@ void M_Load_Key (int k)
case K_RIGHTARROW:
S_LocalSound ("misc/menu1.wav");
load_cursor++;
- if (load_cursor >= MAX_SAVEGAMES)
+ if (load_cursor >= max_savegames)
load_cursor = 0;
break;
}
@@ -595,6 +652,34 @@ void M_Save_Key (int k)
Cbuf_AddText (va("save s%i\n", load_cursor));
return;
+ case K_PGDN:
+ case KP_PGDN:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor+= 10;
+ if (load_cursor >= max_savegames)
+ load_cursor -= max_savegames;
+ break;
+
+ case K_PGUP:
+ case KP_PGUP:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor-= 10;
+ if (load_cursor < 0)
+ load_cursor += max_savegames;
+ break;
+
+ case K_HOME:
+ case KP_HOME:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor = 0;
+ break;
+
+ case K_END:
+ case KP_END:
+ S_LocalSound ("misc/menu1.wav");
+ load_cursor = max_savegames-1;
+ break;
+
case KP_UPARROW:
case K_UPARROW:
case KP_LEFTARROW:
@@ -602,7 +687,7 @@ void M_Save_Key (int k)
S_LocalSound ("misc/menu1.wav");
load_cursor--;
if (load_cursor < 0)
- load_cursor = MAX_SAVEGAMES-1;
+ load_cursor = max_savegames-1;
break;
case KP_DOWNARROW:
@@ -611,7 +696,7 @@ void M_Save_Key (int k)
case K_RIGHTARROW:
S_LocalSound ("misc/menu1.wav");
load_cursor++;
- if (load_cursor >= MAX_SAVEGAMES)
+ if (load_cursor >= max_savegames)
load_cursor = 0;
break;
}

10
games/quake/pkg/DESCR Normal file
View File

@ -0,0 +1,10 @@
Quake is a 3D action game, which can be played both single-user as multi-
user. This package holds binaries for Quake, QuakeWorld.
Note that you must have quake datafiles from elsewhere.
Flavors:
sdl uses sdl library, allows full screen.
ggi uses ggi library, somewhat theoretical interest.
WWW: ${HOMEPAGE}

View File

@ -0,0 +1,6 @@
Quake is a 3D action game, which can be played both single-user as multi-
user. This package holds a binary server for Quake World.
Note that you must have quake datafiles from elsewhere.
WWW: ${HOMEPAGE}

3
games/quake/pkg/PLIST Normal file
View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
bin/quake-x11
bin/qw-client-x11

View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST-ggi,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
bin/quake-ggi
bin/qw-client-ggi

View File

@ -0,0 +1,4 @@
@comment $OpenBSD: PLIST-sdl,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
bin/quake-sdl
bin/qw-client-sdl

View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST-server,v 1.1.1.1 2001/08/03 13:02:16 espie Exp $
bin/qw-server