changed makefiles to use 1/0 instead of yes/no for the codec options.

made quakespasm custom conback embedding optional, still defaulting to 1.
the code requires USE_QS_CONBACK preprocessor definition.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@392 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2011-01-12 09:32:22 +00:00
parent 35d839abc7
commit 65f2ac04aa
14 changed files with 117 additions and 48 deletions

View file

@ -33,6 +33,7 @@
<Compiler>
<Add option="-Wall" />
<Add option="`sdl-config --cflags`" />
<Add option="-DUSE_QS_CONBACK" />
<Add option="-DUSE_CODEC_MP3" />
<Add option="-DUSE_CODEC_VORBIS" />
<Add option="-DUSE_CODEC_WAVE" />

View file

@ -772,6 +772,9 @@
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"USE_QS_CONBACK",
);
PRODUCT_NAME = Distribution;
};
name = Debug;
@ -782,6 +785,9 @@
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"USE_QS_CONBACK",
);
PRODUCT_NAME = Distribution;
ZERO_LINK = NO;
};
@ -802,6 +808,9 @@
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"USE_QS_CONBACK",
);
HEADER_SEARCH_PATHS = (
/Library/Frameworks/SDL.framework/Headers,
/Library/Frameworks/SDL_net.framework/Headers,
@ -827,6 +836,9 @@
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\"";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = (
"USE_QS_CONBACK",
);
HEADER_SEARCH_PATHS = (
/Library/Frameworks/SDL.framework/Headers,
/Library/Frameworks/SDL_net.framework/Headers,
@ -851,6 +863,9 @@
GCC_MODEL_TUNING = G3;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"USE_QS_CONBACK",
);
HEADER_SEARCH_PATHS = (
/Library/Frameworks/SDL.framework/Headers,
"$(HEADER_SEARCH_PATHS)",
@ -872,6 +887,9 @@
GCC_MODEL_TUNING = G3;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"USE_QS_CONBACK",
);
HEADER_SEARCH_PATHS = (
/Library/Frameworks/SDL.framework/Headers,
"$(HEADER_SEARCH_PATHS)",

View file

@ -1,14 +1,14 @@
support for user directories, based on a patch by Piotr Szymaniak.
** against quakespasm svn revision 390.
** against quakespasm svn revision 392.
** in alpha state, minimally tested.
** on-the-fly game directory changes not supported yet.
** needs more work.
Index: Quake/common.c
===================================================================
--- Quake/common.c (revision 390)
--- Quake/common.c (revision 392)
+++ Quake/common.c (working copy)
@@ -1825,32 +1825,36 @@
@@ -1825,32 +1825,36 @@ pack_t *COM_LoadPackFile (const char *pa
COM_AddGameDirectory -- johnfitz -- modified based on topaz's tutorial
=================
*/
@ -49,7 +49,7 @@ Index: Quake/common.c
pak = COM_LoadPackFile (pakfile);
if (!pak)
break;
@@ -1860,6 +1864,14 @@
@@ -1860,6 +1864,14 @@ void COM_AddGameDirectory (const char *d
search->next = com_searchpaths;
com_searchpaths = search;
}
@ -63,8 +63,8 @@ Index: Quake/common.c
+ }
}
static void kill_id1_conback (void) /* QuakeSpasm customization: */
@@ -1894,6 +1906,10 @@
#if defined(USE_QS_CONBACK)
@@ -1896,6 +1908,10 @@ void COM_InitFilesystem (void) //johnfit
{
int i, j;
@ -75,7 +75,7 @@ Index: Quake/common.c
i = COM_CheckParm ("-basedir");
if (i && i < com_argc-1)
strcpy (com_basedir, com_argv[i + 1]);
@@ -1908,8 +1924,7 @@
@@ -1910,8 +1926,7 @@ void COM_InitFilesystem (void) //johnfit
}
// start up with GAMENAME by default (id1)
@ -83,9 +83,9 @@ Index: Quake/common.c
- strcpy (com_gamedir, va("%s/"GAMENAME, com_basedir));
+ COM_AddGameDirectory (com_basedir, GAMENAME);
#if defined(USE_QS_CONBACK)
if (!fitzmode)
{ /* QuakeSpasm customization: */
@@ -1921,17 +1936,17 @@
@@ -1925,17 +1940,17 @@ void COM_InitFilesystem (void) //johnfit
com_nummissionpacks = 0;
if (COM_CheckParm ("-rogue"))
{
@ -106,7 +106,7 @@ Index: Quake/common.c
com_nummissionpacks++;
}
//johnfitz
@@ -1940,7 +1955,7 @@
@@ -1944,7 +1959,7 @@ void COM_InitFilesystem (void) //johnfit
if (i && i < com_argc-1)
{
com_modified = true;

View file

@ -1,4 +1,4 @@
### GNU Makefile for QuakeSpasm unix targets, Aug. 31, 2010
### GNU Makefile for QuakeSpasm unix targets, Jan. 12, 2011
#
# You need the SDL library fully installed.
# "make DEBUG=1" to build a debug client.
@ -7,15 +7,17 @@
# instead of platform specific code.
# Build objects are separate from those of codeblocks
### Embed custom Quakespasm console background picture
USE_QS_CONBACK=1
### Enable/Disable codecs for streaming music support
#
# OGG (vorbis) playback requires libvorbis and libogg
# MP3 playback requires libmad
USE_CODEC_WAVE=yes
USE_CODEC_MP3=yes
USE_CODEC_VORBIS=yes
USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
# ============================================================================
# Helper functions
@ -23,6 +25,7 @@ USE_CODEC_VORBIS=yes
check_gcc = $(shell if echo | $(CC) $(1) -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;)
# ============================================================================
DEBUG ?= 0
SDLNET ?= 0
@ -114,15 +117,19 @@ else
NET_LIBS :=
endif
ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
CODECLIBS :=
ifeq ($(USE_CODEC_WAVE),yes)
ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
endif
ifeq ($(USE_CODEC_VORBIS),yes)
ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS
CODECLIBS+= vorbis vorbisfile ogg
endif
ifeq ($(USE_CODEC_MP3),yes)
ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
CODECLIBS+= mad
endif

View file

@ -1,20 +1,22 @@
# GNU Makefile for QuakeSpasm for Darwin only, Aug. 31, 2010
# GNU Makefile for QuakeSpasm for Darwin only, Jan. 12, 2011
#
# You need the SDL library fully installed.
# "make DEBUG=1" to build a debug client.
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
# "make SDLNET=1" to use SDL_net (not recommended)
# instead of platform specific code.
# Build objects are separate from those of codeblocks
### Embed custom Quakespasm console background picture
USE_QS_CONBACK=1
### Enable/Disable codecs for streaming music support
#
# OGG (vorbis) playback requires libvorbis and libogg
# MP3 playback requires libmad
USE_CODEC_WAVE=yes
USE_CODEC_MP3=yes
USE_CODEC_VORBIS=yes
USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
# ============================================================================
# Helper functions
@ -22,6 +24,8 @@ USE_CODEC_VORBIS=yes
check_gcc = $(shell if echo | $(CC) $(1) -S -o /dev/null -xc - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;)
# ============================================================================
DEBUG ?= 0
SDLNET ?= 0
@ -119,17 +123,21 @@ else
NET_LIBS :=
endif
ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
# FIXME: The codec libs stuff are copied over from the unix makefile
# They might need adaptations for Darwin
CODECLIBS :=
ifeq ($(USE_CODEC_WAVE),yes)
ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
endif
ifeq ($(USE_CODEC_VORBIS),yes)
ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS
CODECLIBS+= -lvorbis -lvorbisfile -logg
endif
ifeq ($(USE_CODEC_MP3),yes)
ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
CODECLIBS+= -lmad
endif

View file

@ -1,11 +1,19 @@
# GNU Makefile for cross-compiling quakespasm.exe (Win32 : MinGW)
# using cross-toolchains on a linux host / Aug. 31, 2010.
# using cross-toolchains on a linux host / Jan. 12, 2011.
# "make DEBUG=1" to build a debug client.
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
# "make WINSOCK2=1" to use WinSock2 api instead of old WinSock 1.1.
# "make SDLNET=1" to use SDL_net (not recommended) instead of platform
# specific code.
### Embed custom Quakespasm console background picture
USE_QS_CONBACK=1
### Enable/disable codecs for streaming music support
USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
# ============================================================================
# Helper functions
# ============================================================================
@ -14,11 +22,6 @@ check_gcc = $(shell if echo | $(CC) $(1) -S -o /dev/null -xc - > /dev/null 2>&1;
# ============================================================================
# Enable/disable codecs for streaming music support:
USE_CODEC_WAVE=yes
USE_CODEC_MP3=yes
USE_CODEC_VORBIS=yes
DEBUG ?= 0
WINSOCK2 ?= 0
SDLNET ?= 0
@ -86,19 +89,23 @@ CFLAGS += $(DEFWINSOCK)
NET_LIBS := $(LIBWINSOCK)
endif
ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
CODECLIBS :=
ifeq ($(USE_CODEC_WAVE),yes)
ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x86
endif
ifeq ($(USE_CODEC_VORBIS),yes)
ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x86
CODECLIBS+= -lvorbis -lvorbisfile -logg
endif
ifeq ($(USE_CODEC_MP3),yes)
ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x86

View file

@ -1,11 +1,19 @@
# GNU Makefile for cross-compiling quakespasm.exe (Win64 : MinGW-w64)
# using cross-toolchains on a linux host / Aug. 31, 2010.
# using cross-toolchains on a linux host / Jan. 12, 2011.
# "make DEBUG=1" to build a debug client.
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
# "make WINSOCK2=0" to use the old WinSock 1.1 api (not recommended).
# "make SDLNET=1" to use SDL_net (not recommended) instead of platform
# specific code.
### Embed custom Quakespasm console background picture
USE_QS_CONBACK=1
### Enable/disable codecs for streaming music support
USE_CODEC_WAVE=1
USE_CODEC_MP3=1
USE_CODEC_VORBIS=1
# ============================================================================
# Helper functions
# ============================================================================
@ -14,11 +22,6 @@ check_gcc = $(shell if echo | $(CC) $(1) -S -o /dev/null -xc - > /dev/null 2>&1;
# ============================================================================
# Enable/disable codecs for streaming music support:
USE_CODEC_WAVE=yes
USE_CODEC_MP3=yes
USE_CODEC_VORBIS=yes
DEBUG ?= 0
WINSOCK2 ?= 1
SDLNET ?= 0
@ -86,19 +89,23 @@ CFLAGS += $(DEFWINSOCK)
NET_LIBS := $(LIBWINSOCK)
endif
ifeq ($(USE_QS_CONBACK),1)
CFLAGS+= -DUSE_QS_CONBACK
endif
CODECLIBS :=
ifeq ($(USE_CODEC_WAVE),yes)
ifeq ($(USE_CODEC_WAVE),1)
CFLAGS+= -DUSE_CODEC_WAVE
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x64
endif
ifeq ($(USE_CODEC_VORBIS),yes)
ifeq ($(USE_CODEC_VORBIS),1)
CFLAGS+= -DUSE_CODEC_VORBIS
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x64
CODECLIBS+= -lvorbis -lvorbisfile -logg
endif
ifeq ($(USE_CODEC_MP3),yes)
ifeq ($(USE_CODEC_MP3),1)
CFLAGS+= -DUSE_CODEC_MP3
CODEC_INC = -I../Windows/codecs/include
CODEC_LINK= -L../Windows/codecs/x64

View file

@ -1862,6 +1862,7 @@ void COM_AddGameDirectory (const char *dir)
}
}
#if defined(USE_QS_CONBACK)
static void kill_id1_conback (void) /* QuakeSpasm customization: */
{
searchpath_t *search;
@ -1884,6 +1885,7 @@ static void kill_id1_conback (void) /* QuakeSpasm customization: */
}
}
}
#endif /* USE_QS_CONBACK */
/*
=================
@ -1911,10 +1913,12 @@ void COM_InitFilesystem (void) //johnfitz -- modified based on topaz's tutorial
COM_AddGameDirectory (va("%s/"GAMENAME, com_basedir));
strcpy (com_gamedir, va("%s/"GAMENAME, com_basedir));
#if defined(USE_QS_CONBACK)
if (!fitzmode)
{ /* QuakeSpasm customization: */
kill_id1_conback ();
}
#endif /* USE_QS_CONBACK */
//johnfitz -- track number of mission packs added
//since we don't want to allow the "game" command to strip them away

View file

@ -4,6 +4,7 @@
#include "quakedef.h"
#if defined(USE_QS_CONBACK)
static const byte conback_byte[] =
{
# include "conback.h"
@ -29,3 +30,5 @@ char *get_conback (void)
return custom_conback;
}
#endif /* USE_QS_CONBACK */

View file

@ -43,7 +43,9 @@ void Draw_NewGame (void);
void GL_SetCanvas (canvastype newcanvas); //johnfitz
#if defined(USE_QS_CONBACK)
void Draw_CheckConback (void); // QuakeSpasm customization
#endif /* USE_QS_CONBACK */
#endif /* _QUAKE_DRAW_H */

View file

@ -318,6 +318,12 @@ qpic_t *Draw_CachePic (const char *path)
Draw_ConbackPic -- QuakeSpasm custom conback drawing.
================
*/
#if !defined(USE_QS_CONBACK)
static inline qpic_t *Draw_ConbackPic (void)
{
return Draw_CachePic ("gfx/conback.lmp");
}
#else
extern char *get_conback(void);
static qboolean have_mod_conback;
void Draw_CheckConback (void)
@ -365,6 +371,7 @@ qpic_t *Draw_ConbackPic (void)
return &pic->pic;
} /* -- QuakeSpasm */
}
#endif /* USE_QS_CONBACK */
/*
================
@ -466,8 +473,10 @@ void Draw_Init (void)
// load game pics
Draw_LoadPics ();
#if defined(USE_QS_CONBACK)
/* QuakeSpasm customization: */
Draw_CheckConback ();
#endif /* USE_QS_CONBACK */
}
//==============================================================================

View file

@ -502,8 +502,10 @@ void TexMgr_NewGame (void)
{
TexMgr_FreeTextures (0, TEXPREF_PERSIST); //deletes all textures where TEXPREF_PERSIST is unset
TexMgr_LoadPalette ();
#if defined(USE_QS_CONBACK)
/* QuakeSpasm customization: */
Draw_CheckConback ();
#endif /* USE_QS_CONBACK */
}
/*

View file

@ -32,6 +32,7 @@
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-DUSE_QS_CONBACK" />
<Add option="-DUSE_CODEC_MP3" />
<Add option="-DUSE_CODEC_VORBIS" />
<Add option="-DUSE_CODEC_WAVE" />

View file

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\SDL\include;..\codecs\include;..\..\Quake;.;.."
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_QS_CONBACK;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -119,7 +119,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="C:\SDL\include;..\codecs\include;..\..\Quake;.;.."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_QS_CONBACK;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@ -197,7 +197,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\SDL\include;..\codecs\include;..\..\Quake;.;.."
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_QS_CONBACK;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -273,7 +273,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="C:\SDL\include;..\codecs\include;..\..\Quake;.;.."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_QS_CONBACK;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"