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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ if (BUILD_CLIENT OR WIN32)
endif()

find_package(SDL3 REQUIRED CONFIG)
message("Found SDL3 ${SDL3_VERSION}: ${SDL3_DIR}")

if (WIN32)
set(LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} SDL3::SDL3)
Expand Down
18 changes: 18 additions & 0 deletions cmake/DaemonArchitecture.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ if (LINUX OR FREEBSD)
# The nexe is system agnostic so there should be no difference with armel.
set(NACL_ARCH "armhf")
endif()

set(BOX64_USAGE ppc64el riscv64)
if (ARCH IN_LIST BOX64_USAGE)
option(DAEMON_NACL_BOX64_EMULATION "Use Box64 to emulate x86_64 NaCl loader on unsupported platforms" ON)
if (DAEMON_NACL_BOX64_EMULATION)
# Use Box64 to run x86_64 NaCl loader and amd64 nexe.
# Box64 must be installed and available in PATH at runtime.
set(NACL_ARCH "amd64")
add_definitions(-DDAEMON_NACL_BOX64_EMULATION)
endif()
endif()
elseif(APPLE)
if ("${ARCH}" STREQUAL arm64)
# You can get emulated NaCl going like this:
Expand All @@ -91,6 +102,12 @@ endif()

daemon_add_buildinfo("char*" "DAEMON_NACL_ARCH_STRING" "\"${NACL_ARCH}\"")

# NaCl runtime is only available on architectures that have a NaCl loader.
set(NACL_RUNTIME_ARCH amd64 i686 armhf)
if (NACL_ARCH IN_LIST NACL_RUNTIME_ARCH)
add_definitions(-DDAEMON_NACL_RUNTIME_ENABLED)
endif()

option(USE_ARCH_INTRINSICS "Enable custom code using intrinsics functions or asm declarations" ON)
mark_as_advanced(USE_ARCH_INTRINSICS)

Expand All @@ -111,6 +128,7 @@ set_arch_intrinsics(${ARCH})

set(amd64_PARENT "i686")
set(arm64_PARENT "armhf")
set(ppc64el_PARENT "ppc64")

if (${ARCH}_PARENT)
set_arch_intrinsics(${${ARCH}_PARENT})
Expand Down
2 changes: 1 addition & 1 deletion cmake/DaemonCBSE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function(CBSE target definition output)
COMMAND ${DAEMON_CBSE_PYTHON_PATH} -c "import jinja2, yaml, collections, argparse, sys, os.path, re"
RESULT_VARIABLE RET)
if (NOT RET EQUAL 0)
message(FATAL_ERROR "Missing dependences for CBSE generation. Please ensure you have python ≥ 2, python-yaml, and python-jinja installed.
message(FATAL_ERROR "Missing dependences for CBSE generation. Please ensure you have python with python-yaml and python-jinja installed.
Use pip install -r src/utils/cbse/requirements.txt to install")
endif()
set(GENERATED_CBSE ${output}/backend/CBSEBackend.cpp
Expand Down
17 changes: 17 additions & 0 deletions cmake/DaemonFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,18 @@ elseif (NOT NACL)
set(GCC_GENERIC_ARCH "armv6")
# There is no generic tuning option for armv6.
unset(GCC_GENERIC_TUNE)
elseif (ARCH STREQUAL "ppc64el")
# POWER8 minimum (first little-endian POWER).
# GCC uses -mcpu instead of -march/-mtune for POWER.
unset(GCC_GENERIC_ARCH)
unset(GCC_GENERIC_TUNE)
set(GCC_GENERIC_CPU "power8")
elseif (ARCH STREQUAL "ppc64")
# POWER5 minimum (first 64-bit POWER in wide use).
# GCC uses -mcpu instead of -march/-mtune for POWER.
unset(GCC_GENERIC_ARCH)
unset(GCC_GENERIC_TUNE)
set(GCC_GENERIC_CPU "power5")
else()
message(WARNING "Unknown architecture ${ARCH}")
endif()
Expand All @@ -676,6 +688,11 @@ elseif (NOT NACL)
if (GCC_GENERIC_TUNE)
try_c_cxx_flag_werror(MTUNE "-mtune=${GCC_GENERIC_TUNE}")
endif()

# POWER architectures use -mcpu instead of -march/-mtune.
if (GCC_GENERIC_CPU)
try_c_cxx_flag_werror(MCPU "-mcpu=${GCC_GENERIC_CPU}")
endif()
endif()

if (USE_CPU_RECOMMENDED_FEATURES)
Expand Down
6 changes: 5 additions & 1 deletion cmake/DaemonNacl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ else()
elseif( NACL_ARCH STREQUAL "armhf" )
add_definitions( -DNACL_BUILD_ARCH=arm )
else()
message(WARNING "Unknown architecture ${NACL_ARCH}")
# NaCl does not support this architecture natively, but these defines must
# be set because nacl_config.h is included unconditionally. Use dummy x86
# values as PNaCl does for architecture-independent builds.
add_definitions( -DNACL_BUILD_ARCH=x86 )
add_definitions( -DNACL_BUILD_SUBARCH=64 )
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/common/Defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define TEAMCONFIG_NAME "teamconfig.cfg"

#define UNNAMED_PLAYER "UnnamedPlayer"
#define UNNAMED_SERVER PRODUCT_NAME " " PRODUCT_VERSION " Server"
#define UNNAMED_SERVER "Unnamed " PRODUCT_NAME " Server"

/** file containing our RSA public and private keys */
#define RSAKEY_FILE "pubkey"
Expand Down
21 changes: 21 additions & 0 deletions src/common/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,27 @@ std::string Build(Str::StringRef base, Str::StringRef path)
return out;
}

std::string NormalizeSlashes(Str::StringRef path)
{
std::string out;
out.reserve(path.size());
bool lastSlash = true;

for (char c : path) {
if (c == '/' || c == '\\') {
if (!lastSlash) {
lastSlash = true;
out.push_back('/');
}
} else {
out.push_back( c );
lastSlash = false;
}
}

return out;
}

std::string DirName(Str::StringRef path)
{
if (path.empty())
Expand Down
5 changes: 5 additions & 0 deletions src/common/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ namespace Path {
// Build a path from components
std::string Build(Str::StringRef base, Str::StringRef path);

// Replace \ with /
// Remove multiple consecutive slashes
// Remove initial slashes
std::string NormalizeSlashes(Str::StringRef path);

// Get the directory portion of a path:
// a/b/c => a/b
// a/b/ => a
Expand Down
5 changes: 5 additions & 0 deletions src/common/cm/cm_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Maryland 20850 USA.
===========================================================================
*/

#ifndef COMMON_CM_CM_LOCAL_H_
#define COMMON_CM_CM_LOCAL_H_

#include "cm_public.h"
#include "cm_polylib.h"

Expand Down Expand Up @@ -313,3 +316,5 @@ bool CM_BoundsIntersect( const vec3_t mins, const vec3_t m
bool CM_BoundsIntersectPoint( const vec3_t mins, const vec3_t maxs, const vec3_t point );

// XreaL END

#endif // COMMON_CM_CM_LOCAL_H_
5 changes: 5 additions & 0 deletions src/common/cm/cm_patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Maryland 20850 USA.
===========================================================================
*/

#ifndef COMMON_CM_CM_PATCH_H_
#define COMMON_CM_CM_PATCH_H_

//#define CULL_BBOX

/*
Expand Down Expand Up @@ -86,3 +89,5 @@ void CM_SetGridWrapWidth( cGrid_t *grid );
void CM_SubdivideGridColumns( cGrid_t *grid );
void CM_RemoveDegenerateColumns( cGrid_t *grid );
void CM_TransposeGrid( cGrid_t *grid );

#endif // COMMON_CM_CM_PATCH_H_
5 changes: 5 additions & 0 deletions src/common/cm/cm_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Maryland 20850 USA.
===========================================================================
*/

#ifndef COMMON_CM_CM_PUBLIC_H_
#define COMMON_CM_CM_PUBLIC_H_

#include "engine/qcommon/q_shared.h"

void CM_LoadMap(Str::StringRef name);
Expand Down Expand Up @@ -79,3 +82,5 @@ int CM_WriteAreaBits( byte *buffer, int area );
// cm_marks.c
int CM_MarkFragments( int numPoints, const vec3_t *points, const vec3_t projection,
int maxPoints, vec3_t pointBuffer, int maxFragments, markFragment_t *fragmentBuffer );

#endif // COMMON_CM_CM_PUBLIC_H_
2 changes: 1 addition & 1 deletion src/engine/client/cg_msgdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define CG_MSGDEF_H

#include "cg_api.h"
#include "engine/RefAPI.h"
#include "engine/renderer/tr_types.h"
#include "common/IPC/CommonSyscalls.h"
#include "common/KeyIdentification.h"

Expand Down
10 changes: 2 additions & 8 deletions src/engine/client/cl_cgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ void CL_ConfigstringModified( Cmd::Args& csCmd )
/*
===================
CL_HandleServerCommand
CL_GetServerCommand

Returns true if the command should be passed to the cgame
===================
*/
bool CL_HandleServerCommand(Str::StringRef text, std::string& newText) {
Expand Down Expand Up @@ -255,13 +256,6 @@ void CL_FillServerCommands(std::vector<std::string>& commands, int start, int en
// if we have irretrievably lost a reliable command, drop the connection
if ( start <= clc.serverCommandSequence - MAX_RELIABLE_COMMANDS )
{
// when a demo record was started after the client got a whole bunch of
// reliable commands then the client never got those first reliable commands
if ( clc.demoplaying )
{
return;
}

Sys::Drop( "CL_FillServerCommand: a reliable command was cycled out" );
}

Expand Down
19 changes: 18 additions & 1 deletion src/engine/client/cl_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,17 @@ void CL_ParseGamestate( msg_t *msg )
CL_ClearState();

// a gamestate always marks a server command sequence
clc.serverCommandSequence = MSG_ReadLong( msg );
int commandNum = MSG_ReadLong( msg );

if ( commandNum < clc.serverCommandSequence )
{
Sys::Drop( "Gamestate moved serverCommandSequence backward" );
}

clc.serverCommandSequence = commandNum;

// trash any commands from previous game
clc.lastExecutedServerCommand = clc.serverCommandSequence;
}

// parse all the configstrings and baselines
Expand Down Expand Up @@ -496,6 +506,13 @@ void CL_ParseCommandString( msg_t *msg )
return;
}

if ( clc.serverCommandSequence + 1 != seq )
{
Sys::Drop( "Out-of-sequence server command: expected %d, got %d",
clc.serverCommandSequence + 1, seq );
return;
}

clc.serverCommandSequence = seq;

index = seq & ( MAX_RELIABLE_COMMANDS - 1 );
Expand Down
Loading
Loading