aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorkrion <krion@FreeBSD.org>2004-07-30 17:59:21 +0800
committerkrion <krion@FreeBSD.org>2004-07-30 17:59:21 +0800
commite996f20e2da3a7c9076894d5c28f9a04bd02b92f (patch)
treeb54ab9220deea7324b0f07a17809868f5da66b80 /games
parent0e98048c949f4b577384dc7b6687a7c0f309cbb4 (diff)
downloadfreebsd-ports-graphics-e996f20e2da3a7c9076894d5c28f9a04bd02b92f.tar.gz
freebsd-ports-graphics-e996f20e2da3a7c9076894d5c28f9a04bd02b92f.tar.zst
freebsd-ports-graphics-e996f20e2da3a7c9076894d5c28f9a04bd02b92f.zip
Add cake 2004.07.09,
Cake is pretty advanced Quake III Arena map viewer. It features BSP support, multiple viewports, sound, models, record/playback demo support and plenty more. Right now, sound support is disabled since cake uses FMOD library which is not available on FreeBSD. I hope to resolve this issue in the future though. PR: ports/69738 Submitted by: Alexey Dokuchaev <danfe@regency.nsu.ru>
Diffstat (limited to 'games')
-rw-r--r--games/Makefile1
-rw-r--r--games/cake/Makefile66
-rw-r--r--games/cake/distinfo2
-rw-r--r--games/cake/files/patch-Makefile29
-rw-r--r--games/cake/files/patch-cake::entity.cpp15
-rw-r--r--games/cake/files/patch-cake::files.cpp18
-rw-r--r--games/cake/files/patch-cake::files.h22
-rw-r--r--games/cake/files/patch-cake::sound.cpp242
-rw-r--r--games/cake/files/patch-main.cpp11
-rw-r--r--games/cake/pkg-descr19
-rw-r--r--games/cake/pkg-message22
11 files changed, 447 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index 44aa1768b3d..198c18bf6a4 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -62,6 +62,7 @@
SUBDIR += burgerspace
SUBDIR += bygfoot
SUBDIR += bzflag
+ SUBDIR += cake
SUBDIR += cardpics
SUBDIR += cgoban
SUBDIR += cgoban2
diff --git a/games/cake/Makefile b/games/cake/Makefile
new file mode 100644
index 00000000000..b0cbdf0335d
--- /dev/null
+++ b/games/cake/Makefile
@@ -0,0 +1,66 @@
+# New ports collection makefile for: Cake
+# Date created: 28 July 2004
+# Whom: Alexey Dokuchaev <danfe@regency.nsu.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= cake
+PORTVERSION= 2004.07.09
+CATEGORIES= games
+MASTER_SITES= http://www.calodox.scene.org:8080/morbac/cake/download/ \
+ http://freebsd.nsu.ru/distfiles/
+DISTNAME= ${PORTNAME}_src
+
+MAINTAINER= danfe@regency.nsu.ru
+COMMENT= Quake3 map viewer
+
+.if defined(WITH_FREEGLUT)
+LIB_DEPENDS= glut.11:${PORTSDIR}/x11-toolkits/freeglut
+.else
+LIB_DEPENDS= glut.3:${PORTSDIR}/graphics/libglut
+.endif
+LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg
+
+USE_GMAKE= yes
+USE_REINPLACE= yes
+USE_X_PREFIX= yes
+USE_ZIP= yes
+
+ALL_TARGET= main
+MAKE_ARGS+= PTHREAD_LIBS=${PTHREAD_LIBS}
+
+PLIST_FILES= bin/cake
+
+pre-everything::
+.if !defined(WITH_FREEGLUT)
+ @${ECHO_MSG} "Define WITH_FREEGLUT to build against FreeGLUT"
+.endif
+
+post-extract:
+ @${FIND} -E ${WRKDIR} -type f -iregex ".*\.(cpp|h)" \
+ -exec ${REINPLACE_CMD} -E -e 's/[[:cntrl:]]*$$//' \
+ -e 's/#pragma[[:blank:]]+pack[[:blank:]]*\([[:blank:]]*push[[:blank:]]*,[[:blank:]]*1[[:blank:]]*\)/#pragma pack(1)/g' \
+ -e 's/#pragma[[:blank:]]+pack[[:blank:]]*\([[:blank:]]*pop[[:blank:]]*\)/#pragma pack()/g' '{}' \;
+ @${REINPLACE_CMD} -e 's/checkGLError/CheckGLError/g' \
+ ${WRKSRC}/cake/glsetup/glutils.cpp ${WRKSRC}/cake/q3bsp.cpp
+ @${REINPLACE_CMD} -e 's/get_nstart_pos/GetNumStartPos/g' \
+ -e 's/set_start_pos/SetStartPos/g' \
+ -e 's/moveMouseXY/MoveMouseXY/g' \
+ -e 's/moveForward/MoveForward/g' \
+ -e 's/moveBackward/MoveBackward/g' \
+ -e 's/moveRight/MoveRight/g' \
+ -e 's/moveLeft/MoveLeft/g' \
+ -e 's/moveUp/MoveUp/g' \
+ -e 's/moveDown/MoveDown/g' \
+ -e 's/report/Report/g' ${WRKSRC}/main.cpp
+ @${REINPLACE_CMD} -e 's/ENABLE_SOUND 1/ENABLE_SOUND 0/' \
+ ${WRKSRC}/cake/sound.h
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/main ${PREFIX}/bin/cake
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/games/cake/distinfo b/games/cake/distinfo
new file mode 100644
index 00000000000..e6964f98ba8
--- /dev/null
+++ b/games/cake/distinfo
@@ -0,0 +1,2 @@
+MD5 (cake_src.zip) = 7d8cebc93526b3541684d43bc4eebd5e
+SIZE (cake_src.zip) = 645893
diff --git a/games/cake/files/patch-Makefile b/games/cake/files/patch-Makefile
new file mode 100644
index 00000000000..1b1d518dd90
--- /dev/null
+++ b/games/cake/files/patch-Makefile
@@ -0,0 +1,29 @@
+--- Makefile.orig Wed Jul 16 19:13:06 2003
++++ Makefile Fri Jul 16 18:03:40 2004
+@@ -1,10 +1,11 @@
+-INCLUDES = -I/usr/include -I/usr/local/include
+-CC = g++
+-CXXFLAGS += -g -Wall -W -O2 $(INCLUDES)
++INCLUDES = -I/usr/include -I$(LOCALBASE)/include -I$(X11BASE)/include
++CC ?= g++
++CXXFLAGS += -Wall $(INCLUDES)
+
+-LDFLAGS += -L/usr/lib -lglut -lGLU -lGL -L/usr/X11R6/lib -lm -ldl
+-LDFLAGS += -lpthread -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE
+-LDFLAGS += -lcurses -ljpeg -lz -lfmod-3.63
++LDFLAGS += -L/usr/lib -L$(LOCALBASE)/lib -L$(X11BASE)/lib -lglut -lGLU -lGL -lm
++LDFLAGS += $(PTHREAD_LIBS) -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE
++#LDFLAGS += -lcurses -ljpeg -lz -lfmod-3.63
++LDFLAGS += -ljpeg
+
+ EXE = main
+ SRC_FILES = $(wildcard cake/*.cpp cake/glsetup/*.cpp cake/zip/*.cpp) main.cpp
+@@ -17,7 +18,7 @@
+ $(CC) -c $(CXXFLAGS) -o $@ $<
+
+ $(EXE): $(OBJECTS)
+- g++ -o $@ $(OBJECTS) $(LDFLAGS)
++ $(CC) -o $@ $(OBJECTS) $(LDFLAGS)
+
+ clean:
+ rm -f $(EXE) $(OBJECTS) $(DEPEND)
diff --git a/games/cake/files/patch-cake::entity.cpp b/games/cake/files/patch-cake::entity.cpp
new file mode 100644
index 00000000000..babddf68d41
--- /dev/null
+++ b/games/cake/files/patch-cake::entity.cpp
@@ -0,0 +1,15 @@
+--- cake/entity.cpp.orig Fri Jul 16 16:55:56 2004
++++ cake/entity.cpp Fri Jul 16 16:56:20 2004
+@@ -1534,10 +1534,10 @@
+ break;
+ case ET_TARGET_TELEPORTER:
+ case ET_TRIGGER_TELEPORT:
+- noise_index = loadSound("sound/world/telein.wav", false, false);
++ noise_index = loadSound("sound/world/telein.wav", NULL, false);
+ break;
+ case ET_TRIGGER_PUSH:
+- noise_index = loadSound("sound/world/jumppad.wav", false, false);
++ noise_index = loadSound("sound/world/jumppad.wav", NULL, false);
+ break;
+ default:
+ break;
diff --git a/games/cake/files/patch-cake::files.cpp b/games/cake/files/patch-cake::files.cpp
new file mode 100644
index 00000000000..4140e1e5043
--- /dev/null
+++ b/games/cake/files/patch-cake::files.cpp
@@ -0,0 +1,18 @@
+--- cake/files.cpp.orig Sat Jul 17 20:36:55 2004
++++ cake/files.cpp Sat Jul 17 20:40:54 2004
+@@ -772,7 +772,6 @@
+
+ if (handle == NULL)
+ {
+- closedir(handle);
+ gConsole->Insertln("^1handle == NULL: %d - %s", errno, strerror(errno));
+ if (temp_pat) delete [] temp_pat;
+ temp_pat = NULL;
+@@ -860,7 +859,6 @@
+
+ if (handle == NULL)
+ {
+- closedir(handle);
+ gConsole->Insertln("^1handle == NULL: %d - %s", errno, strerror(errno));
+ if (temp_pat) delete [] temp_pat;
+ temp_pat = NULL;
diff --git a/games/cake/files/patch-cake::files.h b/games/cake/files/patch-cake::files.h
new file mode 100644
index 00000000000..25a0301f69b
--- /dev/null
+++ b/games/cake/files/patch-cake::files.h
@@ -0,0 +1,22 @@
+--- cake/files.h.orig Sat Jul 17 00:32:30 2004
++++ cake/files.h Sat Jul 17 00:26:42 2004
+@@ -13,6 +13,7 @@
+ #include <io.h>
+ #else
+ #include <dirent.h>
++ #include <time.h>
+
+ /**
+ * Following stuff was taken from io.h
+@@ -20,11 +21,6 @@
+ #ifndef _FSIZE_T_DEFINED
+ typedef unsigned long _fsize_t; /**< Could be 64 bits for Win32 */
+ #define _FSIZE_T_DEFINED
+- #endif
+-
+- #ifndef _TIME_T_DEFINED
+- typedef long time_t; /**< time value */
+- #define _TIME_T_DEFINED /**< avoid multiple def's of time_t */
+ #endif
+
+ struct _finddata_t
diff --git a/games/cake/files/patch-cake::sound.cpp b/games/cake/files/patch-cake::sound.cpp
new file mode 100644
index 00000000000..41828ba76ef
--- /dev/null
+++ b/games/cake/files/patch-cake::sound.cpp
@@ -0,0 +1,242 @@
+--- cake/sound.cpp.orig Fri Jul 16 22:11:47 2004
++++ cake/sound.cpp Sat Jul 17 00:31:09 2004
+@@ -1,8 +1,9 @@
++#include "sound.h"
++
++#if ENABLE_SOUND
+ #define FMOD_DYN_IMPL
+ #define FMOD_DYN_NOASSERT
+
+-#include "sound.h"
+-
+ #include "cake.h"
+ #include "vars.h"
+ #include "commands.h"
+@@ -136,12 +137,13 @@
+ gConsole->Insertln("usage: %s <value>", argv[0]);
+ }
+ }
++#endif
+
+ bool initSoundSystem(void)
+ {
+ #if !ENABLE_SOUND
+ return false;
+- #endif
++ #else
+
+ int i;
+
+@@ -249,13 +251,14 @@
+ return false;
+ }
+ }
++ #endif
+ }
+
+ void shutdownSoundSystem(void)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ freeBGMusic();
+ freeSound();
+@@ -271,13 +274,14 @@
+ gCommands->RemoveCommand("snd_distancefactor");
+ gVars->UnregisterVar(snd_mindistance);
+ gVars->UnregisterVar(snd_maxdistance);
++ #endif
+ }
+
+ void setBGMusic(const char* filename, bool start_paused)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ freeBGMusic();
+
+@@ -409,13 +413,14 @@
+ FSOUND_SetVolume(bgmusic[0].channel, musicvolume);
+ if (!start_paused) FSOUND_SetPaused(bgmusic[0].channel, FALSE);
+ }
++ #endif
+ }
+
+ void toggleBGMusicPause(void)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ for (int i = 0; i < BGMUSIC_CHANNELS; ++i)
+ {
+@@ -427,13 +432,14 @@
+ FSOUND_SetPaused(bgmusic[i].channel, TRUE);
+ }
+ }
++ #endif
+ }
+
+ void playSound(int num, float x, float y, float z, bool stop_if_playing)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ if (num < 0 || num >= SOUND_CHANNELS) return;
+ if (!sounds[num].sample || sounds[num].free) return;
+@@ -441,13 +447,14 @@
+ vec3_t pos;
+ VectorSet(pos, x, y, z);
+ playSound(num, pos, stop_if_playing);
++ #endif
+ }
+
+ void playSound(int num, vec3_t location, bool stop_if_playing)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ if (num < 0 || num >= SOUND_CHANNELS) return;
+ if (!sounds[num].sample || sounds[num].free) return;
+@@ -472,26 +479,28 @@
+ }
+
+ FSOUND_SetVolume(sounds[num].channel, soundvolume);
++ #endif
+ }
+
+ int loadSound(const char *filename, float x, float y, float z, bool loop, bool start_playing, bool start_paused)
+ {
+ #if !ENABLE_SOUND
+ return -1;
+- #endif
++ #else
+
+ if (!filename || !strlen(filename)) return -1;
+
+ vec3_t pos;
+ VectorSet(pos, x, y, z);
+ return loadSound(filename, pos, loop, start_playing, start_paused);
++ #endif
+ }
+
+ int loadSound(const char *filename, vec3_t location, bool loop, bool start_playing, bool start_paused)
+ {
+ #if !ENABLE_SOUND
+ return -1;
+- #endif
++ #else
+
+ if (!filename || !strlen(filename)) return -1;
+
+@@ -594,13 +603,14 @@
+ }
+
+ return freesound;
++ #endif
+ }
+
+ int load3DSound(const char *filename, vec3_t location, bool loop, bool start_playing, bool start_paused)
+ {
+ #if !ENABLE_SOUND
+ return -1;
+- #endif
++ #else
+
+ if (!filename || !strlen(filename)) return -1;
+
+@@ -608,13 +618,14 @@
+ if (!location) VectorClear(pos);
+ else VectorCopy(location, pos);
+ return loadSound(filename, pos, loop, start_playing, start_paused);
++ #endif
+ }
+
+ void toggleSoundPause(int num)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ if (num < 0 || num >= SOUND_CHANNELS)
+ {
+@@ -630,13 +641,14 @@
+ FSOUND_SetPaused(sounds[num].channel, TRUE);
+ }
+ }
++ #endif
+ }
+
+ void SoundUpdate(vec3_t position, vec3_t forward)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ // update background music
+ if (playing_intro)
+@@ -675,13 +687,14 @@
+
+ FSOUND_3D_Listener_SetAttributes(pos, NULL, forward[0], forward[2], forward[1], 0, 1, 0);
+ FSOUND_Update();
++ #endif
+ }
+
+ void freeBGMusic(int num)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ if (num < 0 || num >= BGMUSIC_CHANNELS)
+ {
+@@ -710,13 +723,14 @@
+ bgmusic[num].free = true;
+ }
+ }
++ #endif
+ }
+
+ void freeSound(int num)
+ {
+ #if !ENABLE_SOUND
+ return;
+- #endif
++ #else
+
+ if (num < 0 || num >= SOUND_CHANNELS)
+ {
+@@ -745,13 +759,14 @@
+ sounds[num].free = true;
+ }
+ }
++ #endif
+ }
+
+ const char* GetSoundErrorString(int errnum)
+ {
+ #if !ENABLE_SOUND
+ return NULL;
+- #endif
++ #else
+
+ switch (errnum)
+ {
+@@ -777,4 +792,5 @@
+ case FMOD_ERR_NONE:
+ default: return "^1No errors";
+ }
++ #endif
+ }
diff --git a/games/cake/files/patch-main.cpp b/games/cake/files/patch-main.cpp
new file mode 100644
index 00000000000..68cdd13674d
--- /dev/null
+++ b/games/cake/files/patch-main.cpp
@@ -0,0 +1,11 @@
+--- main.cpp.orig Tue Jul 27 17:58:18 2004
++++ main.cpp Tue Jul 27 17:58:45 2004
+@@ -65,7 +65,7 @@
+
+ // console
+ int histLine; // commands history scrolling value
+-Var consoleKey("consoleKey", 167, VF_PERSISTENT); // key used for console opening/closing
++Var consoleKey("consoleKey", '`', VF_PERSISTENT); // key used for console opening/closing
+ int tabmode = 1; // console tabulation mode
+
+ // window
diff --git a/games/cake/pkg-descr b/games/cake/pkg-descr
new file mode 100644
index 00000000000..016d8fe4ea8
--- /dev/null
+++ b/games/cake/pkg-descr
@@ -0,0 +1,19 @@
+Cake is map viewer for Quake III Arena. It currently features:
+
+ * BSP (+PVS) support
+ * collisions detection (with normal faces + patches)
+ * shaders + textures
+ * lightmaps
+ * vertex deformations
+ * cloudbox + skybox (nearbox and farbox)
+ * volumetric fog
+ * bezier surfaces (with variable LOD)
+ * multiple viewports
+ * console
+ * record/playback demo support (DM3 format not supported)
+ * background music + 3D sounds (not under FreeBSD though)
+ * models
+ * entities (with variable LOD)
+ * zip compressed files (*.pk3)
+
+WWW: http://www.calodox.scene.org:8080/morbac/cake/index.html
diff --git a/games/cake/pkg-message b/games/cake/pkg-message
new file mode 100644
index 00000000000..b7364982586
--- /dev/null
+++ b/games/cake/pkg-message
@@ -0,0 +1,22 @@
+
+=======================================================================
+
+You can put custom configuration file in the same directory where you
+run cake binary from, named `config.ini'. Some default values are:
+
+ v_fullscreen 0
+ v_width 640
+ v_height 480
+ v_colorBits 32
+ v_hz 60
+ r_path baseq3
+ r_mapsubdir maps
+
+Cake also logs its actions to <directory-run-from>/cake_log.html
+
+NOTE: cake requires a gfx card that supports following extensions:
+
+ * GL_EXT_compiled_vertex_array
+ * GL_ARB_multitexture
+
+=======================================================================