Skip to content

Commit aba3407

Browse files
committed
Merge remote-tracking branch 'upstream/master' into for-0.56.0/sync
2 parents 9790f41 + de6c5d7 commit aba3407

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1477
-877
lines changed

CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,6 @@ if (DEPS_DIR)
506506
set(CMAKE_FRAMEWORK_PATH ${DEPS_DIR} ${CMAKE_FRAMEWORK_PATH} PARENT_SCOPE)
507507
set(CMAKE_PREFIX_PATH ${DEPS_DIR} ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
508508
endif()
509-
510-
# Force OpenAL Soft on Mac, otherwise the system framework will be selected
511-
if (APPLE)
512-
set(OPENAL_INCLUDE_DIR ${DEPS_DIR}/include/AL)
513-
set(OPENAL_LIBRARY ${DEPS_DIR}/lib/libopenal.dylib)
514-
endif()
515509
endif()
516510

517511
# These variables are defined:
@@ -822,7 +816,10 @@ if (BUILD_CLIENT)
822816
include_directories(${GLEW_INCLUDE_DIR})
823817
set(LIBS_CLIENT ${LIBS_CLIENT} ${GLEW_LIBRARIES})
824818

819+
set(backup_find_framework ${CMAKE_FIND_FRAMEWORK})
820+
set(CMAKE_FIND_FRAMEWORK NEVER) # Mac's system OpenAL doesn't have efx.h
825821
find_package(OpenAL REQUIRED)
822+
set(CMAKE_FIND_FRAMEWORK ${backup_find_framework})
826823
include_directories(${OPENAL_INCLUDE_DIR})
827824
set(LIBS_CLIENT ${LIBS_CLIENT} ${OPENAL_LIBRARY})
828825
endif()

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Dæmon is the standalone engine that powers the multiplayer first person shooter
44

55
[![GitHub tag](https://img.shields.io/github/tag/DaemonEngine/Daemon.svg)](https://github.com/DaemonEngine/Daemon/tags)
66

7-
[![IRC](https://img.shields.io/badge/irc-%23daemon--engine%2C%23unvanquished--dev-4cc51c.svg)](https://web.libera.chat/#daemon-engine,#unvanquished-dev)
7+
[![IRC](https://img.shields.io/badge/irc-%23unvanquished--dev-9cf.svg)](https://web.libera.chat/#unvanquished-dev)
88

99
| Windows | macOS | Linux |
1010
|---------|-----|-------|
@@ -124,4 +124,4 @@ If you want to run a dedicated server, you may want to use the non-graphical `da
124124
./daemonded +map <mapname>
125125
```
126126

127-
Map names and other options may be [specific to the game](https://github.com/Unvanquished/Unvanquished#configuring-the-server).
127+
Map names and other options may be [specific to the game](https://github.com/Unvanquished/Unvanquished#configuring-the-server).

azure-pipelines.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,21 @@ jobs:
6868
strategy:
6969
matrix:
7070
GCC:
71+
BUILD_TYPE: Release
7172
C_COMPILER: gcc
7273
CXX_COMPILER: g++
7374
EXTRA_PACKAGES:
7475
EXTRA_INSTALLS:
7576
TOOLCHAIN_FILE:
7677
Clang:
78+
BUILD_TYPE: Release
7779
C_COMPILER: clang
7880
CXX_COMPILER: clang++
7981
EXTRA_PACKAGES:
8082
EXTRA_INSTALLS:
8183
TOOLCHAIN_FILE:
8284
Mingw:
85+
BUILD_TYPE: Debug
8386
C_COMPILER: x86_64-w64-mingw32-gcc
8487
CXX_COMPILER: x86_64-w64-mingw32-g++
8588
EXTRA_PACKAGES: gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64-x86-64-dev
@@ -120,7 +123,7 @@ jobs:
120123
- bash: |
121124
set -e
122125
cmake --version
123-
cmake -G "Ninja" -Wdev -Wdeprecated -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) -DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DUSE_PRECOMPILED_HEADER=0 -DUSE_WERROR=1 -DBE_VERBOSE=1 -DBUILD_DUMMY_APP=1 -DBUILD_TESTS=1 -DCMAKE_BUILD_TYPE=Release -H. -Bbuild
126+
cmake -G "Ninja" -Wdev -Wdeprecated -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) -DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DUSE_PRECOMPILED_HEADER=0 -DUSE_WERROR=1 -DBE_VERBOSE=1 -DBUILD_DUMMY_APP=1 -DBUILD_TESTS=1 -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -H. -Bbuild
124127
cmake --build build -- -j`nproc`
125128
displayName: 'Build'
126129
- bash: |

cmake/DaemonArchitecture.cmake

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,20 @@ add_definitions(-DARCH_STRING=${ARCH})
7575

7676
# Modifying NACL_ARCH breaks engine compatibility with nexe game binaries
7777
# since NACL_ARCH contributes to the nexe file name.
78-
set(ARMHF_USAGE arm64 armel)
79-
if(ARCH IN_LIST ARMHF_USAGE)
80-
if (LINUX OR FREEBSD)
78+
set(NACL_ARCH "${ARCH}")
79+
if (LINUX OR FREEBSD)
80+
set(ARMHF_USAGE arm64 armel)
81+
if (ARCH IN_LIST ARMHF_USAGE)
8182
# Load 32-bit armhf nexe on 64-bit arm64 engine on Linux with multiarch.
8283
# The nexe is system agnostic so there should be no difference with armel.
8384
set(NACL_ARCH "armhf")
84-
else()
85-
message(FATAL_ERROR "${ARCH} architecture is not supported on this system")
8685
endif()
87-
else()
88-
set(NACL_ARCH "${ARCH}")
86+
elseif(APPLE)
87+
if ("${ARCH}" STREQUAL arm64)
88+
# You can get emulated NaCl going like this:
89+
# cp external_deps/macos-amd64-default_10/{nacl_loader,irt_core-amd64.nexe} build/
90+
set(NACL_ARCH "amd64")
91+
endif()
8992
endif()
9093

9194
# Quotes cannot be part of the define as support for them is not reliable.

src.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ set(RENDERERLIST
9292
${ENGINE_DIR}/renderer/gl_shader.cpp
9393
${ENGINE_DIR}/renderer/gl_shader.h
9494
${ENGINE_DIR}/renderer/iqm.h
95+
${ENGINE_DIR}/renderer/ShadeCommon.h
9596
${ENGINE_DIR}/renderer/shaders.cpp
9697
${ENGINE_DIR}/renderer/tr_animation.cpp
9798
${ENGINE_DIR}/renderer/tr_backend.cpp
@@ -147,6 +148,8 @@ set(RENDERERLIST
147148

148149
set(GLSLSOURCELIST
149150
${ENGINE_DIR}/renderer/glsl_source/common_cp.glsl
151+
${ENGINE_DIR}/renderer/glsl_source/shaderProfiler_vp.glsl
152+
${ENGINE_DIR}/renderer/glsl_source/shaderProfiler_fp.glsl
150153
${ENGINE_DIR}/renderer/glsl_source/clearSurfaces_cp.glsl
151154
${ENGINE_DIR}/renderer/glsl_source/cull_cp.glsl
152155
${ENGINE_DIR}/renderer/glsl_source/depthReduction_cp.glsl

src/common/Defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3737
/** No case, No spaces */
3838
#define PRODUCT_NAME_LOWER "unvanquished"
3939

40-
#define PRODUCT_VERSION "0.55"
40+
#define PRODUCT_VERSION "0.55.1"
4141

4242
/** Default base package */
4343
#define DEFAULT_BASE_PAK PRODUCT_NAME_LOWER

src/common/System.cpp

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636
#include <fcntl.h>
3737
#include <signal.h>
3838
#ifdef __linux__
39-
#include <linux/version.h>
40-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
41-
#include <sys/syscall.h>
42-
#include <linux/random.h>
43-
#define HAS_GETRANDOM_SYSCALL 1
44-
#endif
39+
#include <sys/random.h>
4540
#endif
4641
#ifdef __native_client__
4742
#include <nacl/nacl_exception.h>
@@ -63,7 +58,7 @@ namespace Sys {
6358
// TODO: also use in VMs when cvars can be observed from multiple modules
6459
// This option can be turned on when debugging memory management
6560
#ifdef BUILD_ENGINE
66-
Cvar::Cvar<bool> pedanticShutdown("common.pedanticShutdown", "run useless shutdown procedures before exit", Cvar::NONE,
61+
static Cvar::Cvar<bool> pedanticShutdown("common.pedanticShutdown", "run useless shutdown procedures before exit", Cvar::NONE,
6762
#ifdef USING_SANITIZER
6863
true);
6964
#else
@@ -417,7 +412,7 @@ intptr_t DynamicLib::InternalLoadSym(Str::StringRef sym, std::string& errorStrin
417412
#endif // __native_client__
418413

419414
#ifdef BUILD_ENGINE
420-
bool processTerminating = false;
415+
static bool processTerminating = false;
421416

422417
void OSExit(int exitCode) {
423418
processTerminating = true;
@@ -462,19 +457,32 @@ void GenRandomBytes(void* dest, size_t size)
462457
size_t bytes_written;
463458
if (nacl_secure_random(dest, size, &bytes_written) != 0 || bytes_written != size)
464459
Sys::Error("nacl_secure_random failed");
465-
#elif defined(__linux__) && defined(HAS_GETRANDOM_SYSCALL)
466-
if (syscall(SYS_getrandom, dest, size, GRND_NONBLOCK) == -1)
467-
Sys::Error("Failed getrandom syscall: %s", strerror(errno));
468460
#elif defined(__linux__)
469-
int fd = open("/dev/urandom", O_RDONLY);
470-
if (fd == -1)
471-
Sys::Error("Failed to open /dev/urandom: %s", strerror(errno));
472-
if (read(fd, dest, size) != (ssize_t) size)
473-
Sys::Error("Failed to read from /dev/urandom: %s", strerror(errno));
474-
close(fd);
461+
ssize_t ret = getrandom(dest, size, GRND_NONBLOCK);
462+
if (ret == -1)
463+
{
464+
if (errno == ENOSYS)
465+
{
466+
Log::Warn("getrandom syscall is not supported");
467+
468+
int fd = open("/dev/urandom", O_RDONLY);
469+
if (fd == -1)
470+
Sys::Error("Failed to open /dev/urandom: %s", strerror(errno));
471+
if (read(fd, dest, size) != (ssize_t) size)
472+
Sys::Error("Failed to read from /dev/urandom: %s", strerror(errno));
473+
close(fd);
474+
}
475+
else
476+
{
477+
Sys::Error("getrandom syscall failed: %s", strerror(errno));
478+
}
479+
}
480+
else if (static_cast<size_t>(ret) != size)
481+
{
482+
Sys::Error("getrandom syscall returned insufficient data");
483+
}
475484
#else
476485
arc4random_buf(dest, size);
477-
478486
#endif
479487
}
480488

src/common/cm/cm_load.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ clipMap_t cm;
5050
int c_pointcontents;
5151
int c_traces, c_brush_traces, c_patch_traces, c_trisoup_traces;
5252

53-
cmodel_t box_model;
54-
cplane_t *box_planes;
55-
cbrush_t *box_brush;
53+
static cmodel_t box_model;
54+
static cplane_t *box_planes;
55+
static cbrush_t *box_brush;
5656

5757
void CM_InitBoxHull();
5858
void CM_FloodAreaConnections();
@@ -771,7 +771,7 @@ void CM_LoadMap(Str::StringRef name)
771771
std::error_code err;
772772
std::string mapData = FS::PakPath::ReadFile(mapFile, err);
773773
if (err) {
774-
Sys::Drop("Could not load %s", mapFile.c_str());
774+
Sys::Drop("Could not load %s: %s (code: %d)", mapFile.c_str(), err.message(), err.value() );
775775
}
776776

777777
std::string externalEntities = FS::PakPath::ReadFile( "maps/" + name + ".ent", err );

src/common/cm/cm_patch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Maryland 20850 USA.
3636

3737
#include "cm_patch.h"
3838

39-
int c_totalPatchBlocks;
39+
static int c_totalPatchBlocks;
4040

4141
/*
4242
================================================================================

src/common/cm/cm_polylib.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ Maryland 20850 USA.
3838

3939
// counters are only bumped when running single threaded,
4040
// because they are an awefull coherence problem
41-
int c_active_windings;
42-
int c_peak_windings;
43-
int c_winding_allocs;
44-
int c_winding_points;
41+
static int c_active_windings;
42+
static int c_peak_windings;
43+
static int c_winding_allocs;
44+
static int c_winding_points;
4545

4646
/*
4747
=============

0 commit comments

Comments
 (0)