diff -Naur --exclude '*.o' quake3/Makefile quake3-USE_Q3_DATA/Makefile --- quake3/Makefile 2006-08-25 18:35:28.000000000 +0200 +++ quake3-USE_Q3_DATA/Makefile 2006-08-25 17:57:03.000000000 +0200 @@ -83,6 +83,10 @@ GENERATE_DEPENDENCIES=1 endif +ifndef USE_Q3_DATA +USE_Q3_DATA=1 +endif + ifndef USE_CCACHE USE_CCACHE=0 endif @@ -199,6 +203,10 @@ GL_CFLAGS = -I/usr/X11R6/include endif + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer ifeq ($(ARCH),x86_64) @@ -368,6 +376,10 @@ #CLIENT_LDFLAGS += -L/usr/X11R6/$(LIB) -lX11 -lXext -lXxf86dga -lXxf86vm endif + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + OPTIMIZE += -O3 -ffast-math -falign-loops=16 ifneq ($(HAVE_VM_COMPILED),true) @@ -408,6 +420,10 @@ BASE_CFLAGS += -DUSE_CODEC_VORBIS=1 endif + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + GL_CFLAGS = MINGW_CFLAGS = -DDONT_TYPEDEF_INT32 @@ -478,6 +494,10 @@ BASE_CFLAGS += $(shell sdl-config --cflags) -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1 endif + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + ifeq ($(ARCH),axp) CC=gcc BASE_CFLAGS += -DNO_VM_COMPILED @@ -549,6 +569,10 @@ BASE_CFLAGS += -DNO_VM_COMPILED endif + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + BUILD_CLIENT = 0 BUILD_GAME_QVM = 0 @@ -568,6 +592,10 @@ RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 DEBUG_CFLAGS=$(BASE_CFLAGS) -g + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + SHLIBEXT=so SHLIBCFLAGS= SHLIBLDFLAGS=-shared @@ -610,6 +638,10 @@ GL_CFLAGS = -I/usr/openwin/include endif + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + OPTIMIZE = -O3 -ffast-math -funroll-loops ifeq ($(ARCH),sparc) @@ -658,6 +690,11 @@ ############################################################################# CC=cc BASE_CFLAGS=-DNO_VM_COMPILED + + ifeq ($(USE_Q3_DATA),1) + BASE_CFLAGS += -DUSE_Q3_DATA=1 + endif + DEBUG_CFLAGS=$(BASE_CFLAGS) -g RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 diff -Naur --exclude '*.o' quake3/code/client/cl_main.c quake3-USE_Q3_DATA/code/client/cl_main.c --- quake3/code/client/cl_main.c 2006-08-25 18:35:27.000000000 +0200 +++ quake3-USE_Q3_DATA/code/client/cl_main.c 2006-08-25 18:28:43.000000000 +0200 @@ -890,7 +890,9 @@ */ void CL_RequestAuthorization( void ) { char nums[64]; +#ifdef USE_Q3_DATA int i, j, l; +#endif cvar_t *fs; if ( !cls.authorizeServer.port ) { @@ -913,6 +915,7 @@ if ( Cvar_VariableValue( "fs_restrict" ) ) { Q_strncpyz( nums, "demota", sizeof( nums ) ); } else { +#ifdef USE_Q3_DATA // only grab the alphanumeric values from the cdkey, to avoid any dashes or spaces j = 0; l = strlen( cl_cdkey ); @@ -929,6 +932,9 @@ } } nums[j] = 0; +#else + nums[0] = 0; +#endif // USE_Q3_DATA } fs = Cvar_Get ("cl_anonymous", "0", CVAR_INIT|CVAR_SYSTEMINFO ); @@ -3413,6 +3419,7 @@ Sys_ShowIP(); } +#ifdef USE_Q3_DATA /* ================= bool CL_CDKeyValidate @@ -3476,5 +3483,5 @@ return qfalse; } - +#endif // USE_Q3_DATA diff -Naur --exclude '*.o' quake3/code/client/cl_ui.c quake3-USE_Q3_DATA/code/client/cl_ui.c --- quake3/code/client/cl_ui.c 2006-08-25 18:35:27.000000000 +0200 +++ quake3-USE_Q3_DATA/code/client/cl_ui.c 2006-08-25 18:25:59.000000000 +0200 @@ -680,7 +680,7 @@ cls.keyCatchers = catcher; } - +#ifdef USE_Q3_DATA /* ==================== CLUI_GetCDKey @@ -718,6 +718,7 @@ cvar_modifiedFlags |= CVAR_ARCHIVE; } } +#endif // USE_Q3_DATA /* ==================== @@ -1016,13 +1017,18 @@ return Hunk_MemoryRemaining(); case UI_GET_CDKEY: +#ifdef USE_Q3_DATA CLUI_GetCDKey( VMA(1), args[2] ); +#endif // USE_Q3_DATA return 0; case UI_SET_CDKEY: +#ifdef USE_Q3_DATA CLUI_SetCDKey( VMA(1) ); +#endif // USE_Q3_DATA return 0; + case UI_SET_PBCLSTATUS: return 0; @@ -1104,8 +1110,11 @@ return 0; case UI_VERIFY_CDKEY: +#ifdef USE_Q3_DATA return CL_CDKeyValidate(VMA(1), VMA(2)); - +#else + return 0; +#endif // USE_Q3_DATA default: @@ -1173,6 +1182,7 @@ } } +#ifdef USE_Q3_DATA qboolean UI_usesUniqueCDKey( void ) { if (uivm) { return (VM_Call( uivm, UI_HASUNIQUECDKEY) == qtrue); @@ -1180,6 +1190,7 @@ return qfalse; } } +#endif // USE_Q3_DATA /* ==================== diff -Naur --exclude '*.o' quake3/code/client/client.h quake3-USE_Q3_DATA/code/client/client.h --- quake3/code/client/client.h 2006-08-25 18:35:27.000000000 +0200 +++ quake3-USE_Q3_DATA/code/client/client.h 2006-08-25 18:17:39.000000000 +0200 @@ -391,7 +391,9 @@ void CL_ShutdownRef( void ); void CL_InitRef( void ); +#ifdef USE_Q3_DATA qboolean CL_CDKeyValidate( const char *key, const char *checksum ); +#endif // USE_Q3_DATA int CL_ServerStatus( char *serverAddress, char *serverStatusString, int maxLen ); diff -Naur --exclude '*.o' quake3/code/qcommon/common.c quake3-USE_Q3_DATA/code/qcommon/common.c --- quake3/code/qcommon/common.c 2006-08-25 18:35:23.000000000 +0200 +++ quake3-USE_Q3_DATA/code/qcommon/common.c 2006-08-25 18:20:45.000000000 +0200 @@ -2252,6 +2252,7 @@ * ( int * ) 0 = 0x12345678; } +#ifdef USE_Q3_DATA // TTimo: centralizing the cl_cdkey stuff after I discovered a buffer overflow problem with the dedicated server version // not sure it's necessary to have different defaults for regular and dedicated, but I don't want to risk it // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=470 @@ -2368,7 +2369,8 @@ #endif return; } -#endif +#endif // DEDICATED +#endif // USE_Q3_DATA static void Com_DetectAltivec(void) @@ -2599,6 +2601,7 @@ Com_WriteConfigToFile( "q3config.cfg" ); +#ifdef USE_Q3_DATA // bk001119 - tentative "not needed for dedicated" #ifndef DEDICATED fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO ); @@ -2607,7 +2610,8 @@ } else { Com_WriteCDKey( BASEGAME, cl_cdkey ); } -#endif +#endif // DEDICATED +#endif // USE_Q3_DATA } diff -Naur --exclude '*.o' quake3/code/qcommon/files.c quake3-USE_Q3_DATA/code/qcommon/files.c --- quake3/code/qcommon/files.c 2006-08-25 18:35:23.000000000 +0200 +++ quake3-USE_Q3_DATA/code/qcommon/files.c 2006-08-25 18:29:10.000000000 +0200 @@ -2755,8 +2755,10 @@ #endif } +#ifdef USE_Q3_DATA void Com_AppendCDKey( const char *filename ); void Com_ReadCDKey( const char *filename ); +#endif // USE_Q3_DATA /* ================ @@ -2805,8 +2807,6 @@ */ static void FS_Startup( const char *gameName ) { const char *homePath; - cvar_t *fs; - Com_Printf( "----- FS_Startup -----\n" ); fs_debug = Cvar_Get( "fs_debug", "0", 0 ); @@ -2861,11 +2861,15 @@ } } +#ifdef USE_Q3_DATA + cvar_t *fs; + Com_ReadCDKey(BASEGAME); fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO ); if (fs && fs->string[0] != 0) { Com_AppendCDKey( fs->string ); } +#endif // add our commands Cmd_AddCommand ("path", FS_Path_f); @@ -2901,11 +2905,19 @@ Q3 media pak0.pk3, you'll want to remove this function =================== */ +#ifdef USE_Q3_DATA static void FS_CheckPak0( void ) { searchpath_t *path; qboolean foundPak0 = qfalse; + // hobbes + // com_disablePak0check > 0 disables the check for Pak0 + if( Cvar_Get( "com_disablePak0check", "0", CVAR_ROM )->integer ) { // com_init did not yet happen, so get value directly + Com_Printf("Check for Pak0 disabled\n"); + return; + } + for( path = fs_searchpaths; path; path = path->next ) { if( path->pack && !Q_stricmpn( path->pack->pakBasename, "pak0", MAX_OSPATH ) && @@ -2938,6 +2950,7 @@ "in the %s directory is present and readable.", BASEGAME); } } +#endif // USE_Q3_DATA /* ===================== @@ -3312,7 +3325,9 @@ // try to start up normally FS_Startup( BASEGAME ); +#ifdef USE_Q3_DATA FS_CheckPak0( ); +#endif // USE_Q3_DATA // if we can't find default.cfg, assume that the paths are // busted and error out now, rather than getting an unreadable @@ -3348,7 +3363,9 @@ // try to start up normally FS_Startup( BASEGAME ); +#ifdef USE_Q3_DATA FS_CheckPak0( ); +#endif // USE_Q3_DATA // if we can't find default.cfg, assume that the paths are // busted and error out now, rather than getting an unreadable diff -Naur --exclude '*.o' quake3/code/qcommon/qcommon.h quake3-USE_Q3_DATA/code/qcommon/qcommon.h --- quake3/code/qcommon/qcommon.h 2006-08-25 18:35:23.000000000 +0200 +++ quake3-USE_Q3_DATA/code/qcommon/qcommon.h 2006-08-25 18:02:07.000000000 +0200 @@ -700,9 +700,11 @@ #define Q_vsnprintf vsnprintf #endif +#ifdef USE_Q3_DATA // centralizing the declarations for cl_cdkey // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=470 extern char cl_cdkey[34]; +#endif // returnbed by Sys_GetProcessorId #define CPUID_GENERIC 0 // any unrecognized processor