Skip to content

Commit 262638a

Browse files
committed
Merge remote-tracking branch 'upstream/master' into for-0.56.0/sync
2 parents e723066 + 1397853 commit 262638a

22 files changed

+865
-1056
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,16 @@ if(NOT DAEMON_EXTERNAL_APP)
117117
option(USE_MUMBLE "Build Daemon with mumblelink sumpport" ON)
118118
endif()
119119

120-
cmake_dependent_option(USE_SMP "Compile with support for running the renderer in a separate thread" 1 BUILD_CLIENT 0)
120+
option(USE_SMP "Compile with support for running the renderer in a separate thread" ON)
121121
option(USE_BREAKPAD "Generate Daemon crash dumps (which require Breakpad tools to read)" OFF)
122122
endif()
123123

124124
option(BUILD_TESTS "Build unit test applications" OFF)
125125

126126
option(USE_LTO "Use link-time optimization for release builds" OFF)
127-
cmake_dependent_option(USE_SLIM_LTO "Generate slim LTO objects, improves build times" 1 "USE_LTO AND \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL GNU" 0)
127+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL GNU)
128+
option(USE_SLIM_LTO "Generate slim LTO objects, improves build times" OFF)
129+
endif()
128130
option(USE_HARDENING "Use stack protection and other hardening flags" OFF)
129131
option(USE_WERROR "Tell the compiler to make the build fail when warnings are present" OFF)
130132
option(USE_PEDANTIC "Tell the compiler to be pedantic" OFF)

cmake/DaemonGame.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ function(buildGameModule module_slug)
119119
set_target_properties(${module_target} PROPERTIES PREFIX "")
120120
set(GAMEMODULE_DEFINITIONS "${GAMEMODULE_DEFINITIONS};BUILD_VM_IN_PROCESS")
121121
else()
122+
if (module_slug STREQUAL "native-exe")
123+
set(GAMEMODULE_DEFINITIONS "${GAMEMODULE_DEFINITIONS};BUILD_VM_NATIVE_EXE")
124+
endif()
122125
add_executable("${module_target}" ${module_target_args})
123126
endif()
124127

external_deps/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ build_naclruntime() {
876876
"${download_only}" && return
877877

878878
cd "${dir_name}"
879-
scons --mode=opt-linux "platform=${NACL_ARCH}" werror=0 sysinfo=0 sel_ldr
879+
env -i /usr/bin/env bash -l -c "python3 /usr/bin/scons --mode=opt-linux 'platform=${NACL_ARCH}' werror=0 sysinfo=0 sel_ldr"
880880
cp "scons-out/opt-linux-${NACL_ARCH}/staging/nacl_helper_bootstrap" "${PREFIX}/nacl_helper_bootstrap"
881881
cp "scons-out/opt-linux-${NACL_ARCH}/staging/sel_ldr" "${PREFIX}/nacl_loader"
882882
}

src.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ set(RENDERERLIST
9494
${ENGINE_DIR}/renderer/tr_font.cpp
9595
${ENGINE_DIR}/renderer/GeometryCache.cpp
9696
${ENGINE_DIR}/renderer/GeometryCache.h
97+
${ENGINE_DIR}/renderer/GeometryOptimiser.cpp
98+
${ENGINE_DIR}/renderer/GeometryOptimiser.h
9799
${ENGINE_DIR}/renderer/InternalImage.cpp
98100
${ENGINE_DIR}/renderer/InternalImage.h
99101
${ENGINE_DIR}/renderer/Material.cpp

src/common/System.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,22 +312,38 @@ static const char *WindowsExceptionString(DWORD code)
312312
return "Unknown exception";
313313
}
314314
}
315+
316+
#ifdef _MSC_VER
317+
// The standard library implements calling std::terminate with an exception filter
318+
static LPTOP_LEVEL_EXCEPTION_FILTER originalExceptionFilter;
319+
#endif
320+
315321
ALIGN_STACK_FOR_MINGW static LONG WINAPI CrashHandler(PEXCEPTION_POINTERS ExceptionInfo)
316322
{
317323
// Reset handler so that any future errors cause a crash
318324
SetUnhandledExceptionFilter(nullptr);
319325

320-
// TODO: backtrace
326+
#ifdef _MSC_VER
327+
constexpr DWORD CPP_EXCEPTION = 0xe06d7363;
328+
if (ExceptionInfo->ExceptionRecord->ExceptionCode == CPP_EXCEPTION && originalExceptionFilter) {
329+
return originalExceptionFilter(ExceptionInfo);
330+
}
331+
#endif
321332

322333
Sys::Error("Crashed with exception 0x%lx: %s", ExceptionInfo->ExceptionRecord->ExceptionCode, WindowsExceptionString(ExceptionInfo->ExceptionRecord->ExceptionCode));
323334
}
324335
void SetupCrashHandler()
325336
{
337+
#ifdef _MSC_VER
338+
originalExceptionFilter =
339+
#endif
326340
SetUnhandledExceptionFilter(CrashHandler);
327341
}
328342
#elif defined(__native_client__)
329343
static void CrashHandler(const void* data, size_t n)
330344
{
345+
// Note: this only works on the main thread. Otherwise we hit
346+
// Sys::Error("SendMsg from non-main VM thread");
331347
VM::CrashDump(static_cast<const uint8_t*>(data), n);
332348
Sys::Error("Crashed with NaCl exception");
333349
}

src/engine/qcommon/net_ip.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ using sa_family_t = unsigned short;
6464

6565
# define socketError WSAGetLastError()
6666

67+
# if !defined(WSA_FLAG_NO_HANDLE_INHERIT)
68+
#define WSA_FLAG_NO_HANDLE_INHERIT 0x80
69+
# endif
70+
6771
namespace net {
6872
namespace errc {
6973
constexpr auto resource_unavailable_try_again = WSAEWOULDBLOCK;

src/engine/qcommon/q_shared.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -288,45 +288,6 @@ int Com_HashKey( char *string, int maxlen )
288288
/*
289289
============================================================================
290290
291-
q_shared.h-enum to name conversion
292-
293-
============================================================================
294-
*/
295-
296-
const char *Com_EntityTypeName(entityType_t entityType)
297-
{
298-
switch (entityType)
299-
{
300-
case entityType_t::ET_GENERAL: return "GENERAL";
301-
case entityType_t::ET_PLAYER: return "PLAYER";
302-
case entityType_t::ET_ITEM: return "ITEM";
303-
case entityType_t::ET_BUILDABLE: return "BUILDABLE";
304-
case entityType_t::ET_LOCATION: return "LOCATION";
305-
case entityType_t::ET_MISSILE: return "MISSILE";
306-
case entityType_t::ET_MOVER: return "MOVER";
307-
case entityType_t::ET_PORTAL: return "PORTAL";
308-
case entityType_t::ET_SPEAKER: return "SPEAKER";
309-
case entityType_t::ET_PUSHER: return "PUSHER";
310-
case entityType_t::ET_TELEPORTER: return "TELEPORTER";
311-
case entityType_t::ET_INVISIBLE: return "INVISIBLE";
312-
case entityType_t::ET_FIRE: return "FIRE";
313-
case entityType_t::ET_CORPSE: return "CORPSE";
314-
case entityType_t::ET_PARTICLE_SYSTEM: return "PARTICLE_SYSTEM";
315-
case entityType_t::ET_ANIMMAPOBJ: return "ANIMMAPOBJ";
316-
case entityType_t::ET_MODELDOOR: return "MODELDOOR";
317-
case entityType_t::ET_LIGHTFLARE: return "LIGHTFLARE";
318-
case entityType_t::ET_LEV2_ZAP_CHAIN: return "LEV2_ZAP_CHAIN";
319-
case entityType_t::ET_BEACON: return "BEACON";
320-
default:
321-
if(entityType >= entityType_t::ET_EVENTS)
322-
return "EVENT";
323-
return nullptr;
324-
}
325-
}
326-
327-
/*
328-
============================================================================
329-
330291
PARSING
331292
332293
============================================================================

src/engine/qcommon/q_shared.h

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,56 +2085,10 @@ union OpaquePlayerState {
20852085
//----(SA) removed
20862086
};
20872087

2088-
// entityState_t is the information conveyed from the server
2089-
// in an update message about entities that the client will
2090-
// need to render in some way
2091-
// Different eTypes may use the information in different ways
2092-
// The messages are delta compressed, so it doesn't really matter if
2093-
// the structure size is fairly large
2094-
//
2095-
// NOTE: all fields in here must be 32 bits (or those within sub-structures)
2096-
//
2097-
// You can use Com_EntityTypeName to get a String representation of this enum
2098-
enum class entityType_t
2099-
{
2100-
ET_GENERAL,
2101-
ET_PLAYER,
2102-
ET_ITEM,
2103-
2104-
ET_BUILDABLE, // buildable type
2105-
2106-
ET_LOCATION,
2107-
2108-
ET_MISSILE,
2109-
ET_MOVER,
2110-
ET_UNUSED,
2111-
ET_PORTAL,
2112-
ET_SPEAKER,
2113-
ET_PUSHER,
2114-
ET_TELEPORTER,
2115-
ET_INVISIBLE,
2116-
ET_FIRE,
2117-
2118-
ET_CORPSE,
2119-
ET_PARTICLE_SYSTEM,
2120-
ET_ANIMMAPOBJ,
2121-
ET_MODELDOOR,
2122-
ET_LIGHTFLARE,
2123-
ET_LEV2_ZAP_CHAIN,
2124-
2125-
ET_BEACON,
2126-
2127-
ET_EVENTS // any of the EV_* events can be added freestanding
2128-
// by setting eType to ET_EVENTS + eventNum
2129-
// this avoids having to set eFlags and eventNum
2130-
};
2131-
2132-
const char *Com_EntityTypeName(entityType_t entityType);
2133-
21342088
struct entityState_t
21352089
{
21362090
int number; // entity index
2137-
entityType_t eType; // entityType_t
2091+
int eType; // entityType_t
21382092
int eFlags;
21392093

21402094
trajectory_t pos; // for calculating position

0 commit comments

Comments
 (0)