Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2004 11:00:32 +0700 (NOVST)
From:      Alexey Dokuchaev <danfe@regency.nsu.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/69738: NEW PORT: games/cake - Quake3 map viewer
Message-ID:  <200407290400.i6T40WjP083339@regency.nsu.ru>
Resent-Message-ID: <200407290400.i6T40iP9057713@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         69738
>Category:       ports
>Synopsis:       NEW PORT: games/cake - Quake3 map viewer
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 29 04:00:44 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Alexey Dokuchaev
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
CNIT NSU
>Environment:
System: FreeBSD regency.nsu.ru 4.9-STABLE FreeBSD 4.9-STABLE #1: Wed Mar 3 13:17:54 NOVT 2004 root@regency.nsu.ru:/usr/src/sys/compile/REGENCY i386
>Description:
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.
>How-To-Repeat:
N/A
>Fix:
%%%
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	.
#	./pkg-descr
#	./files
#	./files/patch-Makefile
#	./files/patch-cake::entity.cpp
#	./files/patch-cake::sound.cpp
#	./files/patch-cake::files.h
#	./files/patch-cake::files.cpp
#	./files/patch-main.cpp
#	./Makefile
#	./distinfo
#	./pkg-message
#
echo c - .
mkdir -p . > /dev/null 2>&1
echo x - ./pkg-descr
sed 's/^X//' >./pkg-descr << 'END-of-./pkg-descr'
XCake is map viewer for Quake III Arena.  It currently features:
X
X    * BSP (+PVS) support
X    * collisions detection (with normal faces + patches)
X    * shaders + textures
X    * lightmaps
X    * vertex deformations
X    * cloudbox + skybox (nearbox and farbox)
X    * volumetric fog
X    * bezier surfaces (with variable LOD)
X    * multiple viewports
X    * console
X    * record/playback demo support (DM3 format not supported)
X    * background music + 3D sounds (not under FreeBSD though)
X    * models
X    * entities (with variable LOD)
X    * zip compressed files (*.pk3)
X
XWWW: http://www.calodox.scene.org:8080/morbac/cake/index.html
END-of-./pkg-descr
echo c - ./files
mkdir -p ./files > /dev/null 2>&1
echo x - ./files/patch-Makefile
sed 's/^X//' >./files/patch-Makefile << 'END-of-./files/patch-Makefile'
X--- Makefile.orig	Wed Jul 16 19:13:06 2003
X+++ Makefile	Fri Jul 16 18:03:40 2004
X@@ -1,10 +1,11 @@
X-INCLUDES = -I/usr/include -I/usr/local/include
X-CC = g++
X-CXXFLAGS += -g -Wall -W -O2 $(INCLUDES)
X+INCLUDES = -I/usr/include -I$(LOCALBASE)/include -I$(X11BASE)/include
X+CC ?= g++
X+CXXFLAGS += -Wall $(INCLUDES)
X 
X-LDFLAGS += -L/usr/lib -lglut -lGLU -lGL -L/usr/X11R6/lib -lm -ldl 
X-LDFLAGS += -lpthread -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE 
X-LDFLAGS += -lcurses -ljpeg -lz -lfmod-3.63
X+LDFLAGS += -L/usr/lib -L$(LOCALBASE)/lib -L$(X11BASE)/lib -lglut -lGLU -lGL -lm
X+LDFLAGS += $(PTHREAD_LIBS) -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE 
X+#LDFLAGS += -lcurses -ljpeg -lz -lfmod-3.63
X+LDFLAGS += -ljpeg
X 
X EXE = main
X SRC_FILES = $(wildcard cake/*.cpp cake/glsetup/*.cpp cake/zip/*.cpp) main.cpp 
X@@ -17,7 +18,7 @@
X 		$(CC) -c $(CXXFLAGS) -o $@ $<
X 
X $(EXE): $(OBJECTS)
X-		g++ -o $@ $(OBJECTS) $(LDFLAGS)
X+		$(CC) -o $@ $(OBJECTS) $(LDFLAGS)
X 
X clean:
X 		rm -f $(EXE) $(OBJECTS) $(DEPEND)
END-of-./files/patch-Makefile
echo x - ./files/patch-cake::entity.cpp
sed 's/^X//' >./files/patch-cake::entity.cpp << 'END-of-./files/patch-cake::entity.cpp'
X--- cake/entity.cpp.orig	Fri Jul 16 16:55:56 2004
X+++ cake/entity.cpp	Fri Jul 16 16:56:20 2004
X@@ -1534,10 +1534,10 @@
X 			break;
X 		case ET_TARGET_TELEPORTER:
X 		case ET_TRIGGER_TELEPORT:
X-			noise_index = loadSound("sound/world/telein.wav", false, false);
X+			noise_index = loadSound("sound/world/telein.wav", NULL, false);
X 			break;
X 		case ET_TRIGGER_PUSH:
X-			noise_index = loadSound("sound/world/jumppad.wav", false, false);
X+			noise_index = loadSound("sound/world/jumppad.wav", NULL, false);
X 			break;
X 		default:
X 			break;
END-of-./files/patch-cake::entity.cpp
echo x - ./files/patch-cake::sound.cpp
sed 's/^X//' >./files/patch-cake::sound.cpp << 'END-of-./files/patch-cake::sound.cpp'
X--- cake/sound.cpp.orig	Fri Jul 16 22:11:47 2004
X+++ cake/sound.cpp	Sat Jul 17 00:31:09 2004
X@@ -1,8 +1,9 @@
X+#include "sound.h"
X+
X+#if ENABLE_SOUND
X #define FMOD_DYN_IMPL
X #define FMOD_DYN_NOASSERT
X 
X-#include "sound.h"
X-
X #include "cake.h"
X #include "vars.h"
X #include "commands.h"
X@@ -136,12 +137,13 @@
X 		gConsole->Insertln("usage: %s <value>", argv[0]);
X 	}
X }
X+#endif
X 
X bool initSoundSystem(void)
X {
X 	#if !ENABLE_SOUND
X 		return false;
X-	#endif
X+	#else
X 
X 	int i;
X 
X@@ -249,13 +251,14 @@
X 			return false;
X 		}
X 	}
X+	#endif
X }
X 
X void shutdownSoundSystem(void)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	freeBGMusic();
X 	freeSound();
X@@ -271,13 +274,14 @@
X 	gCommands->RemoveCommand("snd_distancefactor");
X 	gVars->UnregisterVar(snd_mindistance);
X 	gVars->UnregisterVar(snd_maxdistance);
X+	#endif
X }
X 
X void setBGMusic(const char* filename, bool start_paused)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	freeBGMusic();
X 
X@@ -409,13 +413,14 @@
X 		FSOUND_SetVolume(bgmusic[0].channel, musicvolume);
X 		if (!start_paused) FSOUND_SetPaused(bgmusic[0].channel, FALSE);
X 	}
X+	#endif
X }
X 
X void toggleBGMusicPause(void)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	for (int i = 0; i < BGMUSIC_CHANNELS; ++i)
X 	{
X@@ -427,13 +432,14 @@
X 				FSOUND_SetPaused(bgmusic[i].channel, TRUE);
X 		}
X 	}
X+	#endif
X }
X 
X void playSound(int num, float x, float y, float z, bool stop_if_playing)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	if (num < 0 || num >= SOUND_CHANNELS) return;
X 	if (!sounds[num].sample || sounds[num].free) return;
X@@ -441,13 +447,14 @@
X 	vec3_t pos;
X 	VectorSet(pos, x, y, z);
X 	playSound(num, pos, stop_if_playing);
X+	#endif
X }
X 
X void playSound(int num, vec3_t location, bool stop_if_playing)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	if (num < 0 || num >= SOUND_CHANNELS) return;
X 	if (!sounds[num].sample || sounds[num].free) return;
X@@ -472,26 +479,28 @@
X 	}
X 
X 	FSOUND_SetVolume(sounds[num].channel, soundvolume);
X+	#endif
X }
X 
X int loadSound(const char *filename, float x, float y, float z, bool loop, bool start_playing, bool start_paused)
X {
X 	#if !ENABLE_SOUND
X 		return -1;
X-	#endif
X+	#else
X 
X 	if (!filename || !strlen(filename)) return -1;
X 
X 	vec3_t pos;
X 	VectorSet(pos, x, y, z);
X 	return loadSound(filename, pos, loop, start_playing, start_paused);
X+	#endif
X }
X 
X int loadSound(const char *filename, vec3_t location, bool loop, bool start_playing, bool start_paused)
X {
X 	#if !ENABLE_SOUND
X 		return -1;
X-	#endif
X+	#else
X 
X 	if (!filename || !strlen(filename)) return -1;
X 
X@@ -594,13 +603,14 @@
X 	}
X 
X 	return freesound;
X+	#endif
X }
X 
X int load3DSound(const char *filename, vec3_t location, bool loop, bool start_playing, bool start_paused)
X {
X 	#if !ENABLE_SOUND
X 		return -1;
X-	#endif
X+	#else
X 
X 	if (!filename || !strlen(filename)) return -1;
X 
X@@ -608,13 +618,14 @@
X 	if (!location) VectorClear(pos);
X 	else VectorCopy(location, pos);
X 	return loadSound(filename, pos, loop, start_playing, start_paused);
X+	#endif
X }
X 
X void toggleSoundPause(int num)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	if (num < 0 || num >= SOUND_CHANNELS)
X 	{
X@@ -630,13 +641,14 @@
X 				FSOUND_SetPaused(sounds[num].channel, TRUE);
X 		}
X 	}
X+	#endif
X }
X 
X void SoundUpdate(vec3_t position, vec3_t forward)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	// update background music
X 	if (playing_intro)
X@@ -675,13 +687,14 @@
X 
X 	FSOUND_3D_Listener_SetAttributes(pos, NULL, forward[0], forward[2], forward[1], 0, 1, 0);
X 	FSOUND_Update();
X+	#endif
X }
X 
X void freeBGMusic(int num)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	if (num < 0 || num >= BGMUSIC_CHANNELS)
X 	{
X@@ -710,13 +723,14 @@
X 			bgmusic[num].free = true;
X 		}
X 	}
X+	#endif
X }
X 
X void freeSound(int num)
X {
X 	#if !ENABLE_SOUND
X 		return;
X-	#endif
X+	#else
X 
X 	if (num < 0 || num >= SOUND_CHANNELS)
X 	{
X@@ -745,13 +759,14 @@
X 			sounds[num].free = true;
X 		}
X 	}
X+	#endif
X }
X 
X const char* GetSoundErrorString(int errnum)
X {
X 	#if !ENABLE_SOUND
X 		return NULL;
X-	#endif
X+	#else
X 
X 	switch (errnum)
X 	{
X@@ -777,4 +792,5 @@
X 		case FMOD_ERR_NONE:
X 		default: return "^1No errors";
X 	}
X+	#endif
X }
END-of-./files/patch-cake::sound.cpp
echo x - ./files/patch-cake::files.h
sed 's/^X//' >./files/patch-cake::files.h << 'END-of-./files/patch-cake::files.h'
X--- cake/files.h.orig	Sat Jul 17 00:32:30 2004
X+++ cake/files.h	Sat Jul 17 00:26:42 2004
X@@ -13,6 +13,7 @@
X 	#include <io.h>
X #else
X 	#include <dirent.h>
X+	#include <time.h>
X 
X 	/**
X 	 * Following stuff was taken from io.h
X@@ -20,11 +21,6 @@
X 	#ifndef _FSIZE_T_DEFINED
X 		typedef unsigned long _fsize_t; /**< Could be 64 bits for Win32 */
X 		#define _FSIZE_T_DEFINED
X-	#endif
X-
X-	#ifndef _TIME_T_DEFINED
X-		typedef long time_t;            /**< time value */
X-		#define _TIME_T_DEFINED         /**< avoid multiple def's of time_t */
X 	#endif
X 
X 	struct _finddata_t
END-of-./files/patch-cake::files.h
echo x - ./files/patch-cake::files.cpp
sed 's/^X//' >./files/patch-cake::files.cpp << 'END-of-./files/patch-cake::files.cpp'
X--- cake/files.cpp.orig	Sat Jul 17 20:36:55 2004
X+++ cake/files.cpp	Sat Jul 17 20:40:54 2004
X@@ -772,7 +772,6 @@
X 
X 		if (handle == NULL)
X 		{
X-			closedir(handle);
X 			gConsole->Insertln("^1handle == NULL: %d - %s", errno, strerror(errno));
X 			if (temp_pat) delete [] temp_pat;
X 			temp_pat = NULL;
X@@ -860,7 +859,6 @@
X 
X 		if (handle == NULL)
X 		{
X-			closedir(handle);
X 			gConsole->Insertln("^1handle == NULL: %d - %s", errno, strerror(errno));
X 			if (temp_pat) delete [] temp_pat;
X 			temp_pat = NULL;
END-of-./files/patch-cake::files.cpp
echo x - ./files/patch-main.cpp
sed 's/^X//' >./files/patch-main.cpp << 'END-of-./files/patch-main.cpp'
X--- main.cpp.orig	Tue Jul 27 17:58:18 2004
X+++ main.cpp	Tue Jul 27 17:58:45 2004
X@@ -65,7 +65,7 @@
X 
X // console
X int histLine;											// commands history scrolling value
X-Var consoleKey("consoleKey", 167, VF_PERSISTENT);		// key used for console opening/closing
X+Var consoleKey("consoleKey", '`', VF_PERSISTENT);		// key used for console opening/closing
X int tabmode = 1;										// console tabulation mode
X 
X // window
END-of-./files/patch-main.cpp
echo x - ./Makefile
sed 's/^X//' >./Makefile << 'END-of-./Makefile'
X# New ports collection makefile for:	Cake
X# Date created:				28 July 2004
X# Whom:					Alexey Dokuchaev <danfe@regency.nsu.ru>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	cake
XPORTVERSION=	2004.07.09
XCATEGORIES=	games
XMASTER_SITES=	http://www.calodox.scene.org:8080/morbac/cake/download/ \
X		http://freebsd.nsu.ru/distfiles/
XDISTNAME=	${PORTNAME}_src
X
XMAINTAINER=	danfe@regency.nsu.ru
XCOMMENT=	Quake3 map viewer
X
X.if defined(WITH_FREEGLUT)
XLIB_DEPENDS=	glut.11:${PORTSDIR}/x11-toolkits/freeglut
X.else
XLIB_DEPENDS=	glut.3:${PORTSDIR}/graphics/libglut
X.endif
XLIB_DEPENDS+=	jpeg.9:${PORTSDIR}/graphics/jpeg
X
XUSE_GMAKE=	yes
XUSE_REINPLACE=	yes
XUSE_X_PREFIX=	yes
XUSE_ZIP=	yes
X
XWRKSRC=		${WRKDIR}/${DISTNAME}
XALL_TARGET=	main
XMAKE_ARGS+=	PTHREAD_LIBS=${PTHREAD_LIBS}
X
XPLIST_FILES=	bin/cake
X
Xpre-everything::
X.if !defined(WITH_FREEGLUT)
X	@${ECHO_MSG} "Define WITH_FREEGLUT to build against FreeGLUT"
X.endif
X
Xpost-extract:
X	@${FIND} -E ${WRKDIR} -type f -iregex ".*\.(cpp|h)" \
X		-exec ${REINPLACE_CMD} -E -e 's/[[:cntrl:]]*$$//' \
X		-e 's/#pragma[[:blank:]]+pack[[:blank:]]*\([[:blank:]]*push[[:blank:]]*,[[:blank:]]*1[[:blank:]]*\)/#pragma pack(1)/g' \
X		-e 's/#pragma[[:blank:]]+pack[[:blank:]]*\([[:blank:]]*pop[[:blank:]]*\)/#pragma pack()/g' '{}' \;
X	@${REINPLACE_CMD} -e 's/checkGLError/CheckGLError/g' \
X		${WRKSRC}/cake/glsetup/glutils.cpp ${WRKSRC}/cake/q3bsp.cpp
X	@${REINPLACE_CMD} -e 's/get_nstart_pos/GetNumStartPos/g' \
X		-e 's/set_start_pos/SetStartPos/g' \
X		-e 's/moveMouseXY/MoveMouseXY/g' \
X		-e 's/moveForward/MoveForward/g' \
X		-e 's/moveBackward/MoveBackward/g' \
X		-e 's/moveRight/MoveRight/g' \
X		-e 's/moveLeft/MoveLeft/g' \
X		-e 's/moveUp/MoveUp/g' \
X		-e 's/moveDown/MoveDown/g' \
X		-e 's/report/Report/g' ${WRKSRC}/main.cpp
X	@${REINPLACE_CMD} -e 's/ENABLE_SOUND 1/ENABLE_SOUND 0/' \
X		${WRKSRC}/cake/sound.h
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/main ${PREFIX}/bin/cake
X
X.include <bsd.port.mk>
END-of-./Makefile
echo x - ./distinfo
sed 's/^X//' >./distinfo << 'END-of-./distinfo'
XMD5 (cake_src.zip) = 7d8cebc93526b3541684d43bc4eebd5e
XSIZE (cake_src.zip) = 645893
END-of-./distinfo
echo x - ./pkg-message
sed 's/^X//' >./pkg-message << 'END-of-./pkg-message'
X=======================================================================
X
XYou can put custom configuration file in the same directory where you
Xrun cake binary from, named `config.ini'.  Some default values are:
X
X	v_fullscreen 0
X	v_width 640
X	v_height 480
X	v_colorBits 32
X	v_hz 60
X	r_path baseq3
X	r_mapsubdir maps
X
XCake also logs its actions to <directory-run-from>/cake_log.html
X
XNOTE: cake requires a gfx card that supports following extensions:
X
X    * GL_EXT_compiled_vertex_array
X    * GL_ARB_multitexture
X
X=======================================================================
END-of-./pkg-message
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407290400.i6T40WjP083339>