Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build
build*/
Makefile.local
*.swp
*tags
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if(NOT PRODUCT_VERSION)
endif()
endif()

add_compile_definitions(PRODUCT_VERSION="${PRODUCT_VERSION}")
# add_compile_definitions(PRODUCT_VERSION="${PRODUCT_VERSION}")

# For CI to read from
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/version.txt CONTENT ${PRODUCT_VERSION})
Expand All @@ -84,6 +84,10 @@ endif()

set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/code)

# configure identity header
configure_file(${PROJECT_SOURCE_DIR}/cmake/identity.h.in ${PROJECT_BINARY_DIR}/include/identity.h @ONLY)
include_directories(${PROJECT_BINARY_DIR}/include)

include(compilers/all)
include(platforms/all)
include(libraries/all)
Expand All @@ -93,7 +97,9 @@ include(renderer_gl1)
include(renderer_gl2)
include(client)
include(basegame)
include(missionpack)
if(NOT BUILD_STANDALONE)
include(missionpack)
endif()

include(post_configure)
include(installer)
40 changes: 26 additions & 14 deletions cmake/identity.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
set(PROJECT_NAME ioq3)
set(PROJECT_VERSION 1.36)
set(PROJECT_NAME ioq3 CACHE STRING "Project name")
set(PROJECT_VERSION 1.36 CACHE STRING "Project version")

set(SERVER_NAME ioq3ded)
set(CLIENT_NAME ioquake3)
set(SERVER_NAME ioq3ded CACHE STRING "Base name for dedicated server executable")
set(CLIENT_NAME ioquake3 CACHE STRING "Base name for client executable")

set(BASEGAME baseq3)
set(BASEGAME baseq3 CACHE STRING "Default game data folder name")

set(CGAME_MODULE cgame)
set(GAME_MODULE qagame)
set(UI_MODULE ui)
set(CGAME_MODULE cgame CACHE STRING "Base name for CGame module")
set(GAME_MODULE qagame CACHE STRING "Base name for Game module")
set(UI_MODULE ui CACHE STRING "Base name for UI module")

set(WINDOWS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/windows/quake3.ico)
set(WINDOWS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/windows/quake3.ico CACHE STRING "Path to icon file (ICO) for Windows executable")

set(MACOS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/macos/quake3_flat.icns)
set(MACOS_BUNDLE_ID org.ioquake.${CLIENT_NAME})
set(MACOS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/macos/quake3_flat.icns CACHE STRING "Path to icon file (ICNS) for Mac executable")
set(MACOS_BUNDLE_ID org.ioquake.${CLIENT_NAME} CACHE STRING "Mac bundle ID")

set(COPYRIGHT "QUAKE III ARENA Copyright © 1999-2000 id Software, Inc. All rights reserved.")
set(COPYRIGHT "QUAKE III ARENA Copyright © 1999-2000 id Software, Inc. All rights reserved." CACHE STRING "Coypright notice")

set(CONTACT_EMAIL "info@ioquake.org")
set(PROTOCOL_HANDLER_SCHEME quake3)
set(CONTACT_EMAIL "info@ioquake.org" CACHE STRING "Contact email address")
set(PROTOCOL_HANDLER quake3 CACHE STRING "Protocol handler name")

set(PRODUCT_NAME ${PROJECT_NAME} CACHE STRING "Product name")
set(CLIENT_WINDOW_TITLE ${CLIENT_NAME} CACHE STRING "Client window title")
set(CLIENT_WINDOW_MIN_TITLE ${PRODUCT_NAME} CACHE STRING "Client window short title")
set(HOMEPATH_NAME_UNIX_LEGACY ".q3a" CACHE STRING "UNIX legacy configuration folder name (will be placed in $HOME)")
set(HOMEPATH_NAME "Quake3" CACHE STRING "Configuration folder name")
set(GAMENAME_FOR_MASTER "Quake3Arena" CACHE STRING "Game name for master server (must not contain spaces!)")
set(CINEMATICS_LOGO "idlogo.RoQ" CACHE STRING "Logo video filename (set to blank string to disable)")
set(CINEMATICS_INTRO "intro.RoQ" CACHE STRING "Intro video filename (set to blank string to disable)")
option(LEGACY_PROTOCOL "Use legacy network protocol" ON)
set(CONFIG_PREFIX "q3config" CACHE STRING "Base name for config file")
set(DEMOEXT "dm_" CACHE STRING "Demo filename extension")
44 changes: 44 additions & 0 deletions cmake/identity.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.

This file is part of Quake III Arena source code.

Quake III Arena source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.

Quake III Arena source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Quake III Arena source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
//
#ifndef __IDENTITY_H
#define __IDENTITY_H

#cmakedefine PRODUCT_NAME "@PRODUCT_NAME@"
#cmakedefine PRODUCT_VERSION "@PRODUCT_VERSION@"
#cmakedefine BASEGAME "@BASEGAME@"
#cmakedefine CLIENT_WINDOW_TITLE "@CLIENT_WINDOW_TITLE@"
#cmakedefine CLIENT_WINDOW_MIN_TITLE "@CLIENT_WINDOW_MIN_TITLE@"
#cmakedefine HOMEPATH_NAME_UNIX_LEGACY "@HOMEPATH_NAME_UNIX_LEGACY@"
#cmakedefine HOMEPATH_NAME "@HOMEPATH_NAME@"
#cmakedefine GAMENAME_FOR_MASTER "@GAMENAME_FOR_MASTER@"
#cmakedefine CINEMATICS_LOGO "@CINEMATICS_LOGO@"
#cmakedefine CINEMATICS_INTRO "@CINEMATICS_INTRO@"
#cmakedefine LEGACY_PROTOCOL
#cmakedefine PROTOCOL_HANDLER "@PROTOCOL_HANDLER@"
#cmakedefine CONFIG_PREFIX "@CONFIG_PREFIX@"
#cmakedefine DEMOEXT "@DEMOEXT@"
#cmakedefine CGAME_MODULE "@CGAME_MODULE@"
#cmakedefine GAME_MODULE "@GAME_MODULE@"
#cmakedefine UI_MODULE "@UI_MODULE@"

#endif // __IDENTITY_H
4 changes: 2 additions & 2 deletions cmake/platforms/macos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function(finish_macos_app)
set(MACOS_APP_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
set(MACOS_APP_COPYRIGHT ${COPYRIGHT})

if(PROTOCOL_HANDLER_SCHEME)
if(PROTOCOL_HANDLER)
set(MACOS_APP_PLIST_URL_TYPES
"<key>CFBundleURLTypes</key>
<array>
Expand All @@ -43,7 +43,7 @@ function(finish_macos_app)
<string>${MACOS_APP_BUNDLE_NAME}</string>
<key>CFBundleURLSchemes</key>
<array>
<string>${PROTOCOL_HANDLER_SCHEME}</string>
<string>${PROTOCOL_HANDLER}</string>
</array>
</dict>
</array>")
Expand Down
5 changes: 5 additions & 0 deletions cmake/utils/qvm_tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ function(add_qvm MODULE_NAME)
list(APPEND LCC_FLAGS "-D${DEFINITION}")
endforeach()

# identity.h include directory
set(IDENTITY_HEADER_DIR "${PROJECT_BINARY_DIR}/include")
cmake_path(RELATIVE_PATH IDENTITY_HEADER_DIR BASE_DIRECTORY ${PROJECT_SOURCE_DIR}/code/${MODULE_NAME}/) # FIXME!!!
list(APPEND LCC_FLAGS "-I${IDENTITY_HEADER_DIR}")

set(ASM_FILES "")
foreach(SOURCE ${ARG_SOURCES})
if(${SOURCE} MATCHES "\\.asm$")
Expand Down
2 changes: 1 addition & 1 deletion code/client/cl_cgame.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ void CL_InitCGame( void ) {
interpret = VMI_COMPILED;
}

cgvm = VM_Create( "cgame", CL_CgameSystemCalls, interpret );
cgvm = VM_Create( CGAME_MODULE, CL_CgameSystemCalls, interpret );
if ( !cgvm ) {
Com_Error( ERR_DROP, "VM_Create on cgame failed" );
}
Expand Down
2 changes: 1 addition & 1 deletion code/client/cl_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ void CL_InitUI( void ) {
interpret = VMI_COMPILED;
}

uivm = VM_Create( "ui", CL_UISystemCalls, interpret );
uivm = VM_Create( UI_MODULE, CL_UISystemCalls, interpret );
if ( !uivm ) {
Com_Error( ERR_FATAL, "VM_Create on UI failed" );
}
Expand Down
6 changes: 3 additions & 3 deletions code/qcommon/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,16 +1219,16 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
!FS_IsExt(filename, ".bot", len) &&
!FS_IsExt(filename, ".arena", len) &&
!FS_IsExt(filename, ".menu", len) &&
Q_stricmp(filename, "vm/qagame.qvm") != 0 &&
Q_stricmp(filename, "vm/" GAME_MODULE ".qvm") != 0 &&
!strstr(filename, "levelshots"))
{
pak->referenced |= FS_GENERAL_REF;
}
}

if(strstr(filename, "cgame.qvm"))
if(strstr(filename, CGAME_MODULE ".qvm"))
pak->referenced |= FS_CGAME_REF;
if(strstr(filename, "ui.qvm"))
if(strstr(filename, UI_MODULE ".qvm"))
pak->referenced |= FS_UI_REF;

if(uniqueFILE)
Expand Down
34 changes: 1 addition & 33 deletions code/qcommon/q_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// q_shared.h -- included first by ALL program modules.
// A user mod should never modify this file

#ifdef STANDALONE
#define PRODUCT_NAME "iofoo3"
#define BASEGAME "foobar"
#define CLIENT_WINDOW_TITLE "changeme"
#define CLIENT_WINDOW_MIN_TITLE "changeme2"
#define HOMEPATH_NAME_UNIX_LEGACY ".foo"
#define HOMEPATH_NAME "FooBar"
#define GAMENAME_FOR_MASTER "foobar" // must NOT contain whitespace
#define CINEMATICS_LOGO "foologo.roq"
#define CINEMATICS_INTRO "intro.roq"
// #define LEGACY_PROTOCOL // You probably don't need this for your standalone game
// #define PROTOCOL_HANDLER "foobar"
#define CONFIG_PREFIX "fooconfig"
#else
#define PRODUCT_NAME "ioq3"
#define BASEGAME "baseq3"
#define CLIENT_WINDOW_TITLE "ioquake3"
#define CLIENT_WINDOW_MIN_TITLE "ioq3"
#define HOMEPATH_NAME_UNIX_LEGACY ".q3a"
#define HOMEPATH_NAME "Quake3"
#define GAMENAME_FOR_MASTER "Quake3Arena"
#define CINEMATICS_LOGO "idlogo.RoQ"
#define CINEMATICS_INTRO "intro.RoQ"
#define LEGACY_PROTOCOL
#define PROTOCOL_HANDLER "quake3"
#define CONFIG_PREFIX "q3config"
#endif
#include "identity.h" // generated by cmake

// Heartbeat for dpmaster protocol. You shouldn't change this unless you know what you're doing
#define HEARTBEAT_FOR_MASTER "DarkPlaces"
Expand All @@ -64,10 +38,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#define BASETA "missionpack"

#ifndef PRODUCT_VERSION
#define PRODUCT_VERSION "1.36"
#endif

#ifndef PRODUCT_DATE
# define PRODUCT_DATE __DATE__
#endif
Expand All @@ -77,8 +47,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define MAX_TEAMNAME 32
#define MAX_MASTER_SERVERS 5 // number of supported master servers

#define DEMOEXT "dm_" // standard demo extension

#ifdef _MSC_VER

#pragma warning(disable : 4018) // signed/unsigned mismatch
Expand Down
4 changes: 2 additions & 2 deletions code/server/sv_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,9 +1245,9 @@ static void SV_VerifyPaks_f( client_t *cl ) {

nChkSum1 = nChkSum2 = 0;
// we run the game, so determine which cgame and ui the client "should" be running
bGood = (FS_FileIsInPAK("vm/cgame.qvm", &nChkSum1) == 1);
bGood = (FS_FileIsInPAK("vm/" CGAME_MODULE ".qvm", &nChkSum1) == 1);
if (bGood)
bGood = (FS_FileIsInPAK("vm/ui.qvm", &nChkSum2) == 1);
bGood = (FS_FileIsInPAK("vm/" UI_MODULE ".qvm", &nChkSum2) == 1);

nClientPaks = Cmd_Argc();

Expand Down
2 changes: 1 addition & 1 deletion code/server/sv_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ void SV_InitGameProgs( void ) {
}

// load the dll or bytecode
gvm = VM_Create( "qagame", SV_GameSystemCalls, Cvar_VariableValue( "vm_game" ) );
gvm = VM_Create( GAME_MODULE, SV_GameSystemCalls, Cvar_VariableValue( "vm_game" ) );
if ( !gvm ) {
Com_Error( ERR_FATAL, "VM_Create on game failed" );
}
Expand Down
4 changes: 2 additions & 2 deletions code/server/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ void SV_SpawnServer( char *server, qboolean killBots ) {
// we need to touch the cgame and ui qvm because they could be in
// separate pk3 files and the client will need to download the pk3
// files with the latest cgame and ui qvm to pass the pure check
SV_TouchFile( "vm/cgame.qvm" );
SV_TouchFile( "vm/ui.qvm" );
SV_TouchFile( "vm/" CGAME_MODULE ".qvm" );
SV_TouchFile( "vm/" UI_MODULE ".qvm" );
}
else {
Cvar_Set( "sv_paks", "" );
Expand Down