.endif
DP_ARCH != uname
-
# Makefile name
MAKEFILE=BSDmakefile
-# Command used to delete files
+# Commands
CMD_RM=$(CMD_UNIXRM)
+CMD_CP=$(CMD_UNIXCP)
+CMD_MKDIR=$(CMD_UNIXMKDIR)
# default targets
TARGETS_DEBUG=sv-debug cl-debug sdl-debug
TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz
+###### Optional features #####
+DP_CDDA?=enabled
+.if $(DP_CDDA) == "enabled"
+ OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
+ OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
+.else
+ OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+ OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+.endif
+
+DP_VIDEO_CAPTURE?=enabled
+.if $(DP_VIDEO_CAPTURE == "enabled"
+ CFLAGS_VIDEO_CAPTURE=-DCONFIG_VIDEO_CAPTURE
+ OBJ_VIDEO_CAPTURE= cap_avi.o cap_ogg.o
+.else
+ CFLAGS_VIDEO_CAPTURE=
+ OBJ_VIDEO_CAPTURE=
+.endif
+
# X11 libs
UNIX_X11LIBPATH=/usr/X11R6/lib
MAKE:=$(MAKE) -f BSDmakefile
-DO_LD=$(CC) -o $@ $> $(LDFLAGS)
+DO_LD=$(CC) -o ../../../$@ $> $(LDFLAGS)
##### Definitions shared by all makefiles #####
#include "quakedef.h"
+#ifdef CONFIG_CAPTURE_VIDEO
extern cvar_t cl_capturevideo;
extern cvar_t cl_capturevideo_demo_stop;
+#endif
int old_vsync = 0;
static void CL_FinishTimeDemo (void);
// LordHavoc: now called only by CL_Disconnect
void CL_StopPlayback (void)
{
+#ifdef CONFIG_CAPTURE_VIDEO
if (cl_capturevideo_demo_stop.integer)
Cvar_Set("cl_capturevideo", "0");
+#endif
if (!cls.demoplayback)
return;
return;
// clear menu's connect error message
+#ifdef CONFIG_MENU
M_Update_Return_Reason("");
+#endif
cls.demonum = -1;
// stop demo loop in case this fails
*cls.connect_userinfo = 0;
}
+#ifdef CONFIG_MENU
M_Update_Return_Reason("Trying to connect...");
+#endif
}
else
{
Con_Print("Unable to find a suitable network socket to connect to server.\n");
+#ifdef CONFIG_MENU
M_Update_Return_Reason("No network");
+#endif
}
}
// cl_parse.c -- parse a message received from the server
#include "quakedef.h"
+#ifdef CONFIG_CD
#include "cdaudio.h"
+#endif
#include "cl_collision.h"
#include "csprogs.h"
#include "libcurl.h"
#include "utf8lib.h"
+#ifdef CONFIG_MENU
#include "menu.h"
+#endif
#include "cl_video.h"
const char *svc_strings[128] =
// check memory integrity
Mem_CheckSentinelsGlobal();
+#ifdef CONFIG_MENU
// make menu know
MR_NewMap();
+#endif
// load the csqc now
if (cl.loadcsqc)
case qw_svc_cdtrack:
cl.cdtrack = cl.looptrack = MSG_ReadByte(&cl_message);
+#ifdef CONFIG_CD
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
CDAudio_Play ((unsigned char)cls.forcetrack, true);
else
CDAudio_Play ((unsigned char)cl.cdtrack, true);
+#endif
break;
case qw_svc_intermission:
case qw_svc_setpause:
cl.paused = MSG_ReadByte(&cl_message) != 0;
+#ifdef CONFIG_CD
if (cl.paused)
CDAudio_Pause ();
else
CDAudio_Resume ();
+#endif
S_PauseGameSounds (cl.paused);
break;
}
case svc_setpause:
cl.paused = MSG_ReadByte(&cl_message) != 0;
+#ifdef CONFIG_CD
if (cl.paused)
CDAudio_Pause ();
else
CDAudio_Resume ();
+#endif
S_PauseGameSounds (cl.paused);
break;
case svc_cdtrack:
cl.cdtrack = MSG_ReadByte(&cl_message);
cl.looptrack = MSG_ReadByte(&cl_message);
+#ifdef CONFIG_CD
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
CDAudio_Play ((unsigned char)cls.forcetrack, true);
else
CDAudio_Play ((unsigned char)cl.cdtrack, true);
+#endif
break;
case svc_intermission:
#include "cl_collision.h"
#include "libcurl.h"
#include "csprogs.h"
+#ifdef CONFIG_CAPTURE_VIDEO
#include "cap_avi.h"
#include "cap_ogg.h"
+#endif
// we have to include snd_main.h here only to get access to snd_renderbuffer->format.speed when writing the AVI headers
#include "snd_main.h"
cvar_t scr_conscroll2_y = {CVAR_SAVE, "scr_conscroll2_y", "0", "scroll speed of gfx/conback2 in y direction"};
cvar_t scr_conscroll3_x = {CVAR_SAVE, "scr_conscroll3_x", "0", "scroll speed of gfx/conback3 in x direction"};
cvar_t scr_conscroll3_y = {CVAR_SAVE, "scr_conscroll3_y", "0", "scroll speed of gfx/conback3 in y direction"};
+#ifdef CONFIG_MENU
cvar_t scr_menuforcewhiledisconnected = {0, "scr_menuforcewhiledisconnected", "0", "forces menu while disconnected"};
+#endif
cvar_t scr_centertime = {0, "scr_centertime","2", "how long centerprint messages show"};
cvar_t scr_showram = {CVAR_SAVE, "showram","1", "show ram icon if low on surface cache memory (not used)"};
cvar_t scr_showturtle = {CVAR_SAVE, "showturtle","0", "show turtle icon when framerate is too low"};
cvar_t scr_screenshot_alpha = {0, "scr_screenshot_alpha","0", "try to write an alpha channel to screenshots (debugging feature)"};
cvar_t scr_screenshot_timestamp = {CVAR_SAVE, "scr_screenshot_timestamp", "1", "use a timestamp based number of the type YYYYMMDDHHMMSSsss instead of sequential numbering"};
// scr_screenshot_name is defined in fs.c
+#ifdef CONFIG_CAPTURE_VIDEO
cvar_t cl_capturevideo = {0, "cl_capturevideo", "0", "enables saving of video to a .avi file using uncompressed I420 colorspace and PCM audio, note that scr_screenshot_gammaboost affects the brightness of the output)"};
cvar_t cl_capturevideo_demo_stop = {CVAR_SAVE, "cl_capturevideo_demo_stop", "1", "automatically stops video recording when demo ends"};
cvar_t cl_capturevideo_printfps = {CVAR_SAVE, "cl_capturevideo_printfps", "1", "prints the frames per second captured in capturevideo (is only written to the log file, not to the console, as that would be visible on the video)"};
cvar_t cl_capturevideo_number = {CVAR_SAVE, "cl_capturevideo_number", "1", "number to append to video filename, incremented each time a capture begins"};
cvar_t cl_capturevideo_ogg = {CVAR_SAVE, "cl_capturevideo_ogg", "1", "save captured video data as Ogg/Vorbis/Theora streams"};
cvar_t cl_capturevideo_framestep = {CVAR_SAVE, "cl_capturevideo_framestep", "1", "when set to n >= 1, render n frames to capture one (useful for motion blur like effects)"};
+#endif
cvar_t r_letterbox = {0, "r_letterbox", "0", "reduces vertical height of view to simulate a letterboxed movie effect (can be used by mods for cutscenes)"};
cvar_t r_stereo_separation = {0, "r_stereo_separation", "4", "separation distance of eyes in the world (negative values are only useful for cross-eyed viewing)"};
cvar_t r_stereo_sidebyside = {0, "r_stereo_sidebyside", "0", "side by side views for those who can't afford glasses but can afford eye strain (note: use a negative r_stereo_separation if you want cross-eyed viewing)"};
Con_CheckResize ();
+#ifdef CONFIG_MENU
if (scr_menuforcewhiledisconnected.integer && key_dest == key_game && cls.state == ca_disconnected)
{
if (framecounter >= 2)
framecounter++;
}
else
+#endif
framecounter = 0;
if (scr_conforcewhiledisconnected.integer && key_dest == key_game && cls.signon != SIGNONS)
Cvar_SetValue ("viewsize",scr_viewsize.value-10);
}
+#ifdef CONFIG_CAPTURE_VIDEO
void SCR_CaptureVideo_EndVideo(void);
+#endif
void CL_Screen_Shutdown(void)
{
+#ifdef CONFIG_CAPTURE_VIDEO
SCR_CaptureVideo_EndVideo();
+#endif
}
void CL_Screen_Init(void)
Cvar_RegisterVariable (&scr_conscroll3_y);
Cvar_RegisterVariable (&scr_conbrightness);
Cvar_RegisterVariable (&scr_conforcewhiledisconnected);
+#ifdef CONFIG_MENU
Cvar_RegisterVariable (&scr_menuforcewhiledisconnected);
+#endif
Cvar_RegisterVariable (&scr_loadingscreen_background);
Cvar_RegisterVariable (&scr_loadingscreen_scale);
Cvar_RegisterVariable (&scr_loadingscreen_scale_base);
Cvar_RegisterVariable (&scr_screenshot_name_in_mapdir);
Cvar_RegisterVariable (&scr_screenshot_alpha);
Cvar_RegisterVariable (&scr_screenshot_timestamp);
+#ifdef CONFIG_CAPTURE_VIDEO
Cvar_RegisterVariable (&cl_capturevideo);
Cvar_RegisterVariable (&cl_capturevideo_demo_stop);
Cvar_RegisterVariable (&cl_capturevideo_printfps);
Cvar_RegisterVariable (&cl_capturevideo_number);
Cvar_RegisterVariable (&cl_capturevideo_ogg);
Cvar_RegisterVariable (&cl_capturevideo_framestep);
+#endif
Cvar_RegisterVariable (&r_letterbox);
Cvar_RegisterVariable(&r_stereo_separation);
Cvar_RegisterVariable(&r_stereo_sidebyside);
Cmd_AddCommand ("envmap", R_Envmap_f, "render a cubemap (skybox) of the current scene");
Cmd_AddCommand ("infobar", SCR_InfoBar_f, "display a text in the infobar (usage: infobar expiretime string)");
+#ifdef CONFIG_CAPTURE_VIDEO
SCR_CaptureVideo_Ogg_Init();
+#endif
scr_initialized = true;
}
Mem_Free (buffer2);
}
+#ifdef CONFIG_CAPTURE_VIDEO
static void SCR_CaptureVideo_BeginVideo(void)
{
double r, g, b;
else if (cls.capturevideo.active)
SCR_CaptureVideo_EndVideo();
}
+#endif
/*
===============
SCR_CheckDrawCenterString();
}
SCR_DrawNetGraph ();
+#ifdef CONFIG_MENU
MR_Draw();
+#endif
CL_DrawVideo();
R_Shadow_EditLights_DrawSelectedLightProperties();
SCR_DrawScreen();
}
+#ifdef CONFIG_CAPTURE_VIDEO
SCR_CaptureVideo();
+#endif
if (qglFlush)
qglFlush(); // FIXME: should we really be using qglFlush here?
VID_CheckExtensions();
// LordHavoc: report supported extensions
+#ifdef CONFIG_MENU
Con_DPrintf("\nQuakeC extensions for server and client: %s\nQuakeC extensions for menu: %s\n", vm_sv_extensions, vm_m_extensions );
+#else
+ Con_DPrintf("\nQuakeC extensions for server and client: %s\n", vm_sv_extensions );
+#endif
// clear to black (loading plaque will be seen over this)
GL_Clear(GL_COLOR_BUFFER_BIT, NULL, 1.0f, 128);
#include <time.h>
#include "libcurl.h"
+#ifdef CONFIG_CD
#include "cdaudio.h"
+#endif
#include "cl_video.h"
#include "progsvm.h"
#include "csprogs.h"
// print out where the crash happened, if it was caused by QC (and do a cleanup)
PRVM_Crash(SVVM_prog);
PRVM_Crash(CLVM_prog);
+#ifdef CONFIG_MENU
PRVM_Crash(MVM_prog);
+#endif
cl.csqc_loaded = false;
Cvar_SetValueQuick(&csqc_progcrc, -1);
{
// reset all cvars, commands and aliases to init values
Cmd_RestoreInitState();
+#ifdef CONFIG_MENU
// prepend a menu restart command to execute after the config
Cbuf_InsertText("\nmenu_restart\n");
+#endif
// reset cvars to their defaults, and then exec startup scripts again
Host_AddConfigText();
}
else
S_Update(&r_refdef.view.matrix);
+#ifdef CONFIG_CD
CDAudio_Update();
R_TimeReport("audio");
+#endif
// reset gathering of mouse input
in_mouse_x = in_mouse_y = 0;
// make sure we open sockets before opening video because the Windows Firewall "unblock?" dialog can screw up the graphics context on some graphics drivers
NetConn_UpdateSockets();
VID_Start();
+#ifdef CONFIG_CD
CDAudio_Startup();
+#endif
}
}
R_Modules_Init();
Palette_Init();
+#ifdef CONFIG_MENU
MR_Init_Commands();
+#endif
VID_Shared_Init();
VID_Init();
Render_Init();
S_Init();
+#ifdef CONFIG_CD
CDAudio_Init();
+#endif
Key_Init();
CL_Init();
}
// put up the loading image so the user doesn't stare at a black screen...
SCR_BeginLoadingPlaque(true);
+#ifdef CONFIG_MENU
if (cls.state != ca_dedicated)
{
MR_Init();
}
+#endif
// check for special benchmark mode
// COMMANDLINEOPTION: Client: -benchmark <demoname> runs a timedemo and quits, results of any timedemo can be found in gamedir/benchmark.log (for example id1/benchmark.log)
if (!sv.active && !cls.demoplayback && !cls.connect_trying)
{
+#ifdef CONFIG_MENU
Cbuf_AddText("togglemenu 1\n");
+#endif
Cbuf_Execute();
}
Host_ShutdownServer ();
SV_UnlockThreadMutex();
+#ifdef CONFIG_MENU
// Shutdown menu
if(MR_Shutdown)
MR_Shutdown();
+#endif
// AK shutdown PRVM
// AK hmm, no PRVM_Shutdown(); yet
Host_SaveConfig();
+#ifdef CONFIG_CD
CDAudio_Shutdown ();
+#endif
S_Terminate ();
Curl_Shutdown ();
NetConn_Shutdown ();
svs.clients = (client_t *)Mem_Alloc(sv_mempool, sizeof(client_t) * svs.maxclients);
}
+#ifdef CONFIG_MENU
// remove menu
if (key_dest == key_menu || key_dest == key_menu_grabbed)
MR_ToggleMenu(0);
+#endif
key_dest = key_game;
svs.serverflags = 0; // haven't completed an episode yet
return;
}
+#ifdef CONFIG_MENU
// remove menu
if (key_dest == key_menu || key_dest == key_menu_grabbed)
MR_ToggleMenu(0);
+#endif
key_dest = key_game;
SV_SaveSpawnparms ();
return;
}
+#ifdef CONFIG_MENU
// remove menu
if (key_dest == key_menu || key_dest == key_menu_grabbed)
MR_ToggleMenu(0);
+#endif
key_dest = key_game;
allowcheats = sv_cheats.integer != 0;
if (cls.demoplayback)
CL_Disconnect ();
+#ifdef CONFIG_MENU
// remove menu
if (key_dest == key_menu || key_dest == key_menu_grabbed)
MR_ToggleMenu(0);
+#endif
key_dest = key_game;
cls.demonum = -1; // stop demo loop in case this fails
if(key_consoleactive & KEY_CONSOLEACTIVE_FORCED)
{
key_consoleactive &= ~KEY_CONSOLEACTIVE_USER;
+#ifdef CONFIG_MENU
MR_ToggleMenu(1);
+#endif
}
else
Con_ToggleConsole_f();
case key_menu:
case key_menu_grabbed:
+#ifdef CONFIG_MENU
MR_KeyEvent (key, ascii, down);
+#endif
break;
case key_game:
// csqc has priority over toggle menu if it wants to (e.g. handling escape for UI stuff in-game.. :sick:)
q = CL_VM_InputEvent(down ? 0 : 1, key, ascii);
+#ifdef CONFIG_MENU
if (!q && down)
MR_ToggleMenu(1);
+#endif
break;
default:
if (cl_videoplaying)
{
if (gamemode == GAME_BLOODOMNICIDE) // menu controls key events
+#ifdef CONFIG_MENU
MR_KeyEvent(key, ascii, down);
+#else
+ {
+ }
+#endif
else
CL_Video_KeyEvent (key, ascii, keydown[key] != 0);
return;
break;
case key_menu:
case key_menu_grabbed:
+#ifdef CONFIG_MENU
MR_KeyEvent (key, ascii, down);
+#endif
break;
case key_game:
q = CL_VM_InputEvent(down ? 0 : 1, key, ascii);
DP_MACHINE:=$(shell uname -m)
endif
+# Makefile name
+MAKEFILE=makefile
-# Command used to delete files
+# Commands
ifdef windir
CMD_RM=del
+ CMD_CP=copy /y
+ CMD_MKDIR=mkdir
else
CMD_RM=$(CMD_UNIXRM)
+ CMD_CP=$(CMD_UNIXCP)
+ CMD_MKDIR=$(CMD_UNIXMKDIR)
endif
# 64bits AMD CPUs use another lib directory
TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz
+###### Optional features #####
+DP_CDDA?=enabled
+ifeq ($(DP_CDDA), enabled)
+ OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
+ OBJ_LINUXCD=$(OBJ_CD_COMMON) cd_linux.o
+ OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
+ OBJ_WINCD=$(OBJ_CD_COMMON) cd_win.o
+else
+ OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+ OBJ_LINUXCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+ OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+ OBJ_WINCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+endif
+
+DP_VIDEO_CAPTURE?=enabled
+ifeq ($(DP_VIDEO_CAPTURE), enabled)
+ CFLAGS_VIDEO_CAPTURE=-DCONFIG_VIDEO_CAPTURE
+ OBJ_VIDEO_CAPTURE= cap_avi.o cap_ogg.o
+else
+ CFLAGS_VIDEO_CAPTURE=
+ OBJ_VIDEO_CAPTURE=
+endif
+
# Linux configuration
ifeq ($(DP_MAKE_TARGET), linux)
DEFAULT_SNDAPI=ALSA
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
DP_LINK_ODE?=dlopen
+ DP_LINK_CRYPTO?=dlopen
endif
# Mac OS X configuration
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
DP_LINK_ODE?=dlopen
+ DP_LINK_CRYPTO?=dlopen
# on OS X, we don't build the CL by default because it uses deprecated
# and not-implemented-in-64bit Carbon
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
DP_LINK_ODE?=dlopen
+ DP_LINK_CRYPTO?=dlopen
endif
# BSD configuration
DP_LINK_ZLIB?=shared
DP_LINK_JPEG?=shared
DP_LINK_ODE?=dlopen
+ DP_LINK_CRYPTO?=dlopen
endif
# Win32 configuration
DP_LINK_ZLIB?=dlopen
DP_LINK_JPEG?=shared
DP_LINK_ODE?=dlopen
+ DP_LINK_CRYPTO?=dlopen
endif
# set these to "" if you want to use dynamic loading instead
endif
# d0_blind_id
-# most distros do not have d0_blind_id package, dlopen will used by default
-# LIB_CRYPTO=-ld0_blind_id
-# CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
-# LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
-# CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
-LIB_CRYPTO=
-CFLAGS_CRYPTO=
-LIB_CRYPTO_RIJNDAEL=
-CFLAGS_CRYPTO_RIJNDAEL=
+ifeq ($(DP_LINK_CRYPTO), shared)
+ LIB_CRYPTO=-ld0_blind_id
+ CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
+ LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
+ CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
+endif
+ifeq ($(DP_LINK_CRYPTO), dlopen)
+ LIB_CRYPTO=
+ CFLAGS_CRYPTO=
+ LIB_CRYPTO_RIJNDAEL=
+ CFLAGS_CRYPTO_RIJNDAEL=
+endif
##### Sound configuration #####
##### GNU Make specific definitions #####
-DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
+DO_LD=$(CC) -o ../../../$@ $^ $(LDFLAGS)
##### Definitions shared by all makefiles #####
LIB_SND_3DRAS=
# CD objects
+OBJ_CD_COMMON=cd_shared.o
OBJ_NOCD=cd_null.o
# Common objects
OBJ_COMMON= \
bih.o \
- cap_avi.o \
- cap_ogg.o \
- cd_shared.o \
crypto.o \
cl_collision.o \
cl_demo.o \
mathlib.o \
matrixlib.o \
mdfour.o \
- menu.o \
meshqueue.o \
mod_skeletal_animatevertices_sse.o \
mod_skeletal_animatevertices_generic.o \
model_brush.o \
model_shared.o \
model_sprite.o \
- mvm_cmds.o \
netconn.o \
palette.o \
polygon.o \
world.o \
zone.o
+OBJ_MENU= \
+ menu.o \
+ mvm_cmds.o
+
# note that builddate.c is very intentionally not compiled to a .o before
# being linked, because it should be recompiled every time an executable is
# built to give the executable a proper date string
-OBJ_SV= builddate.c sys_linux.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_NOCD) $(OBJ_COMMON)
-OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_SND_COMMON) snd_sdl.o cd_sdl.o $(OBJ_COMMON)
+OBJ_SV= builddate.c sys_linux.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_COMMON)
+OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_MENU) $(OBJ_SND_COMMON) snd_sdl.o $(OBJ_SDLCD) $(OBJ_VIDEO_CAPTURE) $(OBJ_COMMON)
# Compilation
-CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_D3D) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES
+CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_D3D) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
+CFLAGS_CLIENT=-DCONFIG_MENU -DCONFIG_CD $(CFLAGS_VIDEO_CAPTURE)
+CFLAGS_SERVER=
CFLAGS_DEBUG=-ggdb
CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs
CFLAGS_RELEASE=
##### UNIX specific variables #####
-OBJ_GLX= builddate.c sys_linux.o vid_glx.o thread_pthread.o keysym2ucs.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
+OBJ_GLX= builddate.c sys_linux.o vid_glx.o thread_pthread.o keysym2ucs.o $(OBJ_MENU) $(OBJ_SOUND) $(OBJ_CD) $(OBJ_VIDEO_CAPTURE) $(OBJ_COMMON)
LDFLAGS_UNIXCOMMON=-lm $(LIB_ODE) $(LIB_Z) $(LIB_JPEG) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL)
LDFLAGS_UNIXCL=-L$(UNIX_X11LIBPATH) -lX11 -lXpm -lXext -lXxf86vm -pthread $(LIB_SOUND)
EXE_UNIXSDLNEXUIZ=nexuiz-sdl
CMD_UNIXRM=rm -rf
+CMD_UNIXCP=cp -f
+CMD_UNIXMKDIR=mkdir -p
##### Linux specific variables #####
-# If you want CD sound in Linux
-OBJ_LINUXCD=cd_linux.o
-# If you want no CD audio
-#OBJ_LINUXCD=$(OBJ_NOCD)
-
# Link
LDFLAGS_LINUXCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXCL)
LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl
# Link
LDFLAGS_MACOSXCL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit -framework Carbon $(LIB_SOUND)
LDFLAGS_MACOSXSV=$(LDFLAGS_UNIXCOMMON) -ldl
-LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) SDLMain.m
+LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) ../../../SDLMain.m
-OBJ_AGL= builddate.c sys_linux.o vid_agl.o thread_null.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
+OBJ_AGL= builddate.c sys_linux.o vid_agl.o thread_null.o $(OBJ_MENU) $(OBJ_SOUND) $(OBJ_CD) $(OBJ_VIDEO_CAPTURE) $(OBJ_COMMON)
EXE_MACOSXCL=darkplaces-agl
EXE_MACOSXCLNEXUIZ=nexuiz-agl
##### BSD specific variables #####
-#if you want CD sound in BSD
-OBJ_BSDCD=cd_bsd.o
-#if you want no CD audio
-#OBJ_BSDCD=$(OBJ_NOCD)
-
# Link
LDFLAGS_BSDCL=$(LDFLAGS_UNIXCOMMON) -lutil $(LDFLAGS_UNIXCL)
LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON)
##### Win32 specific variables #####
WINDRES ?= windres
-#if you want CD sound in Win32
-OBJ_WINCD=cd_win.o
-#if you want no CD audio
-#OBJ_WINCD=$(OBJ_NOCD)
-OBJ_WGL= builddate.c sys_win.o vid_wgl.o thread_null.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON)
+OBJ_WGL= builddate.c sys_win.o vid_wgl.o thread_null.o $(OBJ_MENU) $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_VIDEO_CAPTURE) $(OBJ_COMMON)
# Link
# see LDFLAGS_WINCOMMON in makefile
EXE_WINSVNEXUIZ=nexuiz-dedicated.exe
EXE_WINSDLNEXUIZ=nexuiz-sdl.exe
+VPATH := ../../../
##### Commands #####
cl-debug :
$(MAKE) bin-debug \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+ EXE='$(EXE_CL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_CL)' LEVEL=1
cl-profile :
$(MAKE) bin-profile \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+ EXE='$(EXE_CL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_CL)' LEVEL=1
cl-release :
$(MAKE) bin-release \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+ EXE='$(EXE_CL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_CL)' LEVEL=1
cl-release-profile :
$(MAKE) bin-release-profile \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+ EXE='$(EXE_CL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_CL)' LEVEL=1
cl-nexuiz :
$(MAKE) bin-release \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_CLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+ EXE='$(EXE_CLNEXUIZ)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_CL)' LEVEL=1
sv-debug :
$(MAKE) bin-debug \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+ EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
sv-profile :
$(MAKE) bin-profile \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+ EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
sv-release :
$(MAKE) bin-release \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+ EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
sv-release-profile :
$(MAKE) bin-release-profile \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+ EXE='$(EXE_SV)' CFLAGS_FEATURES='$(CFLAGS_SERVER)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
sv-nexuiz :
$(MAKE) bin-release \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SVNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+ EXE='$(EXE_SVNEXUIZ)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_SV)' LEVEL=1
sdl-debug :
$(MAKE) bin-debug \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+ EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
sdl-profile :
$(MAKE) bin-profile \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+ EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
sdl-release :
$(MAKE) bin-release \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+ EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
sdl-release-profile :
$(MAKE) bin-release-profile \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+ EXE='$(EXE_SDL)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
sdl-nexuiz :
$(MAKE) bin-release \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- EXE="$(EXE_SDLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+ EXE='$(EXE_SDLNEXUIZ)' CFLAGS_FEATURES='$(CFLAGS_CLIENT)' LDFLAGS_COMMON='$(LDFLAGS_SDL)' LEVEL=1
bin-debug :
$(CHECKLEVEL1)
@echo
- @echo "========== $(EXE) (debug) =========="
- $(MAKE) $(EXE) \
+ @echo '========== $(EXE) (debug) =========='
+ $(MAKE) prepare BUILD_DIR=obj/debug/$(EXE)
+ $(MAKE) -C obj/debug/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
- LDFLAGS="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)" LEVEL=2
+ CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)'\
+ LDFLAGS='$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)' LEVEL=2
bin-profile :
$(CHECKLEVEL1)
@echo
- @echo "========== $(EXE) (profile) =========="
- $(MAKE) $(EXE) \
+ @echo '========== $(EXE) (profile) =========='
+ $(MAKE) prepare BUILD_DIR=obj/profile/$(EXE)
+ $(MAKE) -C obj/profile/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
- LDFLAGS="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)" LEVEL=2
+ CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)'\
+ LDFLAGS='$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)' LEVEL=2
bin-release :
$(CHECKLEVEL1)
@echo
- @echo "========== $(EXE) (release) =========="
- $(MAKE) $(EXE) \
+ @echo '========== $(EXE) (release) =========='
+ $(MAKE) prepare BUILD_DIR=obj/release/$(EXE)
+ $(MAKE) -C obj/release/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
- LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" LEVEL=2
+ CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)'\
+ LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
$(STRIP) $(EXE)
bin-release-profile :
$(CHECKLEVEL1)
@echo
- @echo "========== $(EXE) (release) =========="
- $(MAKE) $(EXE) \
+ @echo '========== $(EXE) (release) =========='
+ $(MAKE) prepare BUILD_DIR=obj/release-profile/$(EXE)
+ $(MAKE) -C obj/release-profile/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)"\
- LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" LEVEL=2
+ CFLAGS='$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)'\
+ LDFLAGS='$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)' LEVEL=2
$(STRIP) $(EXE)
+prepare :
+ $(CMD_MKDIR) $(BUILD_DIR)
+ $(CMD_CP) makefile.inc $(BUILD_DIR)/
#this checks USEODE when compiling so it needs the ODE flags as well
prvm_cmds.o: prvm_cmds.c
-$(CMD_RM) $(EXE_SDLNEXUIZ)
-$(CMD_RM) *.o
-$(CMD_RM) *.d
+ -$(CMD_RM) obj/
clean-profile: clean
-$(CMD_RM) *.gcda
*/
#include "quakedef.h"
+#ifdef CONFIG_CD
#include "cdaudio.h"
+#endif
#include "image.h"
#include "progsvm.h"
M_Options_PrintSlider( " Brightness", true, v_contrast.value, 1, 2);
M_Options_PrintSlider( " Gamma", true, v_gamma.value, 0.5, 3);
M_Options_PrintSlider( " Sound Volume", snd_initialized.integer, volume.value, 0, 1);
+#ifdef CONFIG_CD
M_Options_PrintSlider( " Music Volume", cdaudioinitialized.integer, bgmvolume.value, 0, 1);
+#endif
M_Options_PrintCommand( " Customize Effects", true);
M_Options_PrintCommand( " Effects: Quake", true);
M_Options_PrintCommand( " Effects: Normal", true);
{
crypto_t *crypto;
cls.connect_trying = false;
+#ifdef CONFIG_MENU
M_Update_Return_Reason("");
+#endif
// the connection request succeeded, stop current connection and set up a new connection
CL_Disconnect();
// if we're connecting to a remote server, shut down any local server
}
Con_Printf("Connection accepted to %s\n", cls.netcon->address);
key_dest = key_game;
+#ifdef CONFIG_MENU
m_state = m_none;
+#endif
cls.demonum = -1; // not in the demo loop now
cls.state = ca_connected;
cls.signon = 0; // need all the signon messages before playing
char protocolnames[1400];
Protocol_Names(protocolnames, sizeof(protocolnames));
Con_DPrintf("\"%s\" received, sending connect request back to %s\n", string, addressstring2);
+#ifdef CONFIG_MENU
M_Update_Return_Reason("Got challenge response");
+#endif
// update the server IP in the userinfo (QW servers expect this, and it is used by the reconnect command)
InfoString_SetValue(cls.userinfo, sizeof(cls.userinfo), "*ip", addressstring2);
// TODO: add userinfo stuff here instead of using NQ commands?
if (length == 6 && !memcmp(string, "accept", 6) && cls.connect_trying)
{
// darkplaces or quake3
+#ifdef CONFIG_MENU
M_Update_Return_Reason("Accepted");
+#endif
NetConn_ConnectionEstablished(mysocket, peeraddress, PROTOCOL_DARKPLACES3);
return true;
}
length = min(length - 7, (int)sizeof(rejectreason) - 1);
memcpy(rejectreason, string, length);
rejectreason[length] = 0;
+#ifdef CONFIG_MENU
M_Update_Return_Reason(rejectreason);
+#endif
return true;
}
if (length >= 15 && !memcmp(string, "statusResponse\x0A", 15))
{
// challenge message
Con_Printf("challenge %s received, sending QuakeWorld connect request back to %s\n", string + 1, addressstring2);
+#ifdef CONFIG_MENU
M_Update_Return_Reason("Got QuakeWorld challenge response");
+#endif
cls.qw_qport = qport.integer;
// update the server IP in the userinfo (QW servers expect this, and it is used by the reconnect command)
InfoString_SetValue(cls.userinfo, sizeof(cls.userinfo), "*ip", addressstring2);
if (length >= 1 && string[0] == 'j' && cls.connect_trying)
{
// accept message
+#ifdef CONFIG_MENU
M_Update_Return_Reason("QuakeWorld Accepted");
+#endif
NetConn_ConnectionEstablished(mysocket, peeraddress, PROTOCOL_QUAKEWORLD);
return true;
}
Con_Printf("Connected to ProQuake %.1f server, enabling precise aim\n", cls.proquake_serverversion / 10.0f);
// update the server IP in the userinfo (QW servers expect this, and it is used by the reconnect command)
InfoString_SetValue(cls.userinfo, sizeof(cls.userinfo), "*ip", addressstring2);
+#ifdef CONFIG_MENU
M_Update_Return_Reason("Accepted");
+#endif
NetConn_ConnectionEstablished(mysocket, &clientportaddress, PROTOCOL_QUAKE);
}
break;
if (developer_extra.integer)
Con_DPrintf("Datagram_ParseConnectionless: received CCREP_REJECT from %s.\n", addressstring2);
cls.connect_trying = false;
+#ifdef CONFIG_MENU
M_Update_Return_Reason((char *)MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)));
+#endif
break;
case CCREP_SERVER_INFO:
if (developer_extra.integer)
NetConn_UpdateSockets();
if (cls.connect_trying && cls.connect_nextsendtime < realtime)
{
+#ifdef CONFIG_MENU
if (cls.connect_remainingtries == 0)
M_Update_Return_Reason("Connect: Waiting 10 seconds for reply");
+#endif
cls.connect_nextsendtime = realtime + 1;
cls.connect_remainingtries--;
if (cls.connect_remainingtries <= -10)
{
cls.connect_trying = false;
+#ifdef CONFIG_MENU
M_Update_Return_Reason("Connect: Failed");
+#endif
return;
}
// try challenge first (newer DP server or QW)
{
if (sv_qwmasters[masternum].string && LHNETADDRESS_FromString(&masteraddress, sv_qwmasters[masternum].string, QWMASTER_PORT) && LHNETADDRESS_GetAddressType(&masteraddress) == LHNETADDRESS_GetAddressType(LHNET_AddressFromSocket(cl_sockets[i])))
{
+#ifdef CONFIG_MENU
if (m_state != m_slist)
{
+#endif
char lookupstring[128];
LHNETADDRESS_ToString(&masteraddress, lookupstring, sizeof(lookupstring), true);
Con_Printf("Querying master %s (resolved from %s)\n", lookupstring, sv_qwmasters[masternum].string);
+#ifdef CONFIG_MENU
}
+#endif
masterquerycount++;
NetConn_Write(cl_sockets[i], request, (int)strlen(request) + 1, &masteraddress);
}
if (!masterquerycount)
{
Con_Print("Unable to query master servers, no suitable network sockets active.\n");
+#ifdef CONFIG_MENU
M_Update_Return_Reason("No network");
+#endif
}
}
void Net_Refresh_f(void)
{
+#ifdef CONFIG_MENU
if (m_state != m_slist) {
+#endif
Con_Print("Sending new requests to master servers\n");
ServerList_QueryList(false, true, false, true);
Con_Print("Listening for replies...\n");
+#ifdef CONFIG_MENU
} else
ServerList_QueryList(false, true, false, false);
+#endif
}
void Net_Slist_f(void)
ServerList_ResetMasks();
serverlist_sortbyfield = SLIF_PING;
serverlist_sortflags = 0;
+#ifdef CONFIG_MENU
if (m_state != m_slist) {
+#endif
Con_Print("Sending requests to master servers\n");
ServerList_QueryList(true, true, false, true);
Con_Print("Listening for replies...\n");
+#ifdef CONFIG_MENU
} else
ServerList_QueryList(true, true, false, false);
+#endif
}
void Net_SlistQW_f(void)
ServerList_ResetMasks();
serverlist_sortbyfield = SLIF_PING;
serverlist_sortflags = 0;
+#ifdef CONFIG_MENU
if (m_state != m_slist) {
+#endif
Con_Print("Sending requests to master servers\n");
ServerList_QueryList(true, false, true, true);
serverlist_consoleoutput = true;
Con_Print("Listening for replies...\n");
+#ifdef CONFIG_MENU
} else
ServerList_QueryList(true, false, true, false);
+#endif
}
void NetConn_Init(void)
#define PRVM_ProgLoaded(n) (PRVM_GetProg(n)->loaded)
#define SVVM_prog (&prvm_prog_list[PRVM_PROG_SERVER])
#define CLVM_prog (&prvm_prog_list[PRVM_PROG_CLIENT])
+#ifdef CONFIG_MENU
#define MVM_prog (&prvm_prog_list[PRVM_PROG_MENU])
+#endif
//============================================================================
// prvm_cmds part
void CLVM_init_cmd(prvm_prog_t *prog);
void CLVM_reset_cmd(prvm_prog_t *prog);
+#ifdef CONFIG_MENU
void MVM_init_cmd(prvm_prog_t *prog);
void MVM_reset_cmd(prvm_prog_t *prog);
+#endif
void VM_Cmd_Init(prvm_prog_t *prog);
void VM_Cmd_Reset(prvm_prog_t *prog);
#ifdef PROFILING
void SVVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage);
void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage);
+#ifdef CONFIG_MENU
void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage);
+#endif
#else
#define SVVM_ExecuteProgram PRVM_ExecuteProgram
#define CLVM_ExecuteProgram PRVM_ExecuteProgram
+#ifdef CONFIG_MENU
#define MVM_ExecuteProgram PRVM_ExecuteProgram
+#endif
void PRVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage);
#endif
float gettime(prvm_prog_t *prog)
=========
*/
+#ifdef CONFIG_CD
float CDAudio_GetPosition(void);
+#endif
void VM_gettime(prvm_prog_t *prog)
{
int timer_index;
case 3: // GETTIME_UPTIME
PRVM_G_FLOAT(OFS_RETURN) = realtime;
break;
+#ifdef CONFIG_CD
case 4: // GETTIME_CDTRACK
PRVM_G_FLOAT(OFS_RETURN) = CDAudio_GetPosition();
break;
+#endif
default:
VM_Warning(prog, "VM_gettime: %s: unsupported timer specified, returning realtime\n", prog->name);
PRVM_G_FLOAT(OFS_RETURN) = realtime;
return SVVM_prog;
if (!strcmp(str, "client"))
return CLVM_prog;
+#ifdef CONFIG_MENU
if (!strcmp(str, "menu"))
return MVM_prog;
+#endif
return NULL;
}
extern qboolean prvm_runawaycheck;
#ifdef PROFILING
+#ifdef CONFIG_MENU
/*
====================
MVM_ExecuteProgram
if (prog == SVVM_prog)
SV_FlushBroadcastMessages();
}
+#endif
/*
====================
#include "input.h"
#include "keys.h"
#include "console.h"
+#ifdef CONFIG_MENU
#include "menu.h"
+#endif
#include "csprogs.h"
extern qboolean noclip_anglehack;
#include "snd_ogg.h"
#include "csprogs.h"
#include "cl_collision.h"
+#ifdef CONFIG_CD
#include "cdaudio.h"
+#endif
#define SND_MIN_SPEED 8000
if (snd_renderbuffer == NULL)
return;
+#ifdef CONFIG_CD
// stop CD audio because it may be using a faketrack
CDAudio_Stop();
+#endif
if (simsound || SndSys_LockRenderBuffer ())
{
extern speakerlayout_t snd_speakerlayout; // for querying the listeners
+#ifdef CONFIG_CAPTURE_VIDEO
static void S_CaptureAVISound(const portable_sampleframe_t *paintbuffer, size_t length)
{
size_t i;
SCR_CaptureVideo_SoundFrame(paintbuffer_unswapped, length);
}
+#endif
extern cvar_t snd_softclip;
S_SoftClipPaintBuffer(paintbuffer, totalmixframes, snd_renderbuffer->format.width, snd_renderbuffer->format.channels);
+#ifdef CONFIG_CAPTURE_VIDEO
if (!snd_usethreadedmixing)
S_CaptureAVISound(paintbuffer, totalmixframes);
+#endif
S_ConvertPaintBuffer(paintbuffer, outbytes, totalmixframes, snd_renderbuffer->format.width, snd_renderbuffer->format.channels);
#include "quakedef.h"
+#ifdef CONFIG_CD
#include "cdaudio.h"
+#endif
#include "image.h"
#ifdef SUPPORTD3D
Cvar_SetQuick(&gl_info_driver, gl_driver);
// LordHavoc: report supported extensions
+#ifdef CONFIG_MENU
Con_DPrintf("\nQuakeC extensions for server and client: %s\nQuakeC extensions for menu: %s\n", vm_sv_extensions, vm_m_extensions );
+#else
+ Con_DPrintf("\nQuakeC extensions for server and client: %s\n", vm_sv_extensions );
+#endif
// clear to black (loading plaque will be seen over this)
GL_Clear(GL_COLOR_BUFFER_BIT, NULL, 1.0f, 128);
}
}
+#ifdef CONFIG_CD
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+#endif
static keynum_t buttonremap[16] =
{
// break;
case MM_MCINOTIFY:
+#ifdef CONFIG_CD
lRet = CDAudio_MessageHandler (hWnd, uMsg, wParam, lParam);
+#endif
break;
default: