Skip to content

Commit fd0a99d

Browse files
Rebase Changes from the Prey Fork
1 parent 36550c8 commit fd0a99d

File tree

459 files changed

+69978
-55630
lines changed

Some content is hidden

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

459 files changed

+69978
-55630
lines changed

.github/workflows/auto-update-vcpkg.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
schedule:
44
- cron: "0 0 1,25,29 * *"
55

6+
permissions:
7+
contents: write
8+
69
jobs:
710
build:
811
runs-on: ubuntu-latest

.github/workflows/linux_build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ on:
33
push:
44
branches:
55
- "master"
6+
paths-ignore:
7+
- .github/workflows/windows_build.yml
68
pull_request:
79
types:
810
- edited
911
- opened
1012
- synchronize
13+
paths-ignore:
14+
- .github/workflows/windows_build.yml
15+
workflow_dispatch:
1116
concurrency:
1217
# Cancel concurrent workflows for the same PR or commit hash.
1318
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
@@ -23,7 +28,7 @@ jobs:
2328
os: [ubuntu-latest]
2429
steps:
2530
- name: Download dependencies
26-
run: sudo apt install libgl1-mesa-dev libsdl2-dev libopenal-dev libcurl4-openssl-dev cmake ninja-build libfreetype6-dev
31+
run: sudo apt update && sudo apt install libgl1-mesa-dev libsdl2-dev libopenal-dev libcurl4-openssl-dev cmake ninja-build libfreetype6-dev
2732

2833
- name: Check out repository code
2934
uses: actions/checkout@v4

.github/workflows/windows_build.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ on:
33
push:
44
branches:
55
- "master"
6+
paths-ignore:
7+
- .github/workflows/linux_build.yml
68
pull_request:
79
types:
810
- edited
911
- opened
1012
- synchronize
13+
paths-ignore:
14+
- .github/workflows/linux_build.yml
15+
workflow_dispatch:
1116
concurrency:
1217
# Cancel concurrent workflows for the same PR or commit hash.
1318
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
@@ -32,16 +37,16 @@ jobs:
3237
- name: Restore from cache and setup vcpkg executable and data files.
3338
uses: lukka/run-vcpkg@v11
3439
with:
35-
vcpkgDirectory: "${{github.workspace}}/vcpkg"
40+
vcpkgDirectory: '${{github.workspace}}/vcpkg'
3641
runVcpkgInstall: true
37-
vcpkgJsonGlob: "**/neo/vcpkg.json"
42+
vcpkgJsonGlob: '**/neo/vcpkg.json'
3843

3944
- name: Run CMake+vcpkg+Ninja to build the engine.
4045
uses: lukka/run-cmake@v10
4146
with:
42-
cmakeListsTxtPath: "${{github.workspace}}/neo/CMakeLists.txt"
43-
configurePreset: "ninja-multi-vcpkg"
44-
buildPreset: "ninja-vcpkg-release"
47+
cmakeListsTxtPath: '${{github.workspace}}/neo/CMakeLists.txt'
48+
configurePreset: 'ninja-multi-vcpkg'
49+
buildPreset: 'ninja-vcpkg-release'
4550

4651
- name: Copy base files to the output folder
4752
shell: pwsh

neo/CMakeLists.txt

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ if(NOT MSVC)
256256
check_c_source_compiles("#include <SDL_syswm.h>
257257
int main() { SDL_SysWMinfo wmInfo = {}; wmInfo.info.x11.display = NULL; return 0; }" HAVE_SDL_X11)
258258
unset(CMAKE_REQUIRED_LIBRARIES)
259-
259+
260260
if (HAVE_SDL_X11)
261261
message(STATUS "This SDL2 has X11 support")
262262
add_definitions(-DD3_SDL_X11)
@@ -322,7 +322,7 @@ if(D3_COMPILER_IS_GCC_OR_CLANG)
322322
if(cxx_has_fp-contract)
323323
add_compile_options(-ffp-contract=off)
324324
endif()
325-
325+
326326
if(ASAN)
327327
# if this doesn't work, ASan might not be available on your platform, don't set ASAN then..
328328
add_compile_options(-fsanitize=address)
@@ -349,7 +349,7 @@ if(D3_COMPILER_IS_GCC_OR_CLANG)
349349
if(cxx_has_Woverload_virtual)
350350
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
351351
endif()
352-
352+
353353
# shut up about using memcpy() on classes, in the cases doom3 uses it it seems to be fine
354354
CHECK_CXX_COMPILER_FLAG("-Wno-class-memaccess" cxx_has_Wno-class-memaccess)
355355
if(cxx_has_Wno-class-memaccess)
@@ -432,20 +432,21 @@ elseif(MSVC)
432432
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4286 /ignore:4217")
433433
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4286 /ignore:4217")
434434
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4286 /ignore:4217")
435-
435+
436+
436437
add_definitions(-D_ALLOW_KEYWORD_MACROS) # because of the "#define private public" and "#define protected public" in TypeInfo.cpp
437-
438+
438439
set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG /Od /Zi /MDd")
439440
set(CMAKE_C_FLAGS_RELEASE "/Ox /Oy /MD")
440441
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Ox /Oy /Zi /MD")
441442
set(CMAKE_C_FLAGS_MINSIZEREL "/Ox /Oy /Os /MD")
442-
443+
443444
# use 8MB stack instead of 1MB, so big models don't overflow it with _alloca()
444445
set(ldflags "${ldflags} /STACK:8388608")
445-
446+
446447
# let the 32bit app use more than 2gb of ram
447448
set(ldflags "${ldflags} /LARGEADDRESSAWARE")
448-
449+
449450
# Don't let the linker generate manifest files for shared dlls
450451
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")
451452
else()
@@ -583,7 +584,7 @@ set(src_renderer
583584
renderer/tr_turboshadow.cpp
584585
)
585586

586-
# Don't use precompiled headers for renderer/stblib_impls.c
587+
# Don't use precompiled headers for renderer/stblib_impls.c source.
587588
set_source_files_properties(
588589
renderer/stblib_impls.c
589590
PROPERTIES
@@ -730,7 +731,7 @@ set(src_snd
730731
sound/stbvorbis_impl.c
731732
)
732733

733-
# Don't use precompiled headers for sound/stbvorbis_impl.c
734+
# Don't use precompiled headers for sound/stbvorbis_impl.c source.
734735
set_source_files_properties(
735736
sound/stbvorbis_impl.c
736737
PROPERTIES
@@ -1366,9 +1367,9 @@ if(ENGINE)
13661367
${src_imgui}
13671368
${src_editor_tools}
13681369
)
1369-
1370+
13701371
if(MSVC)
1371-
# set MSVC default debug directory on executable
1372+
# set MSVC default debug directory on executable
13721373
set_target_properties(${DHEWM3BINARY} PROPERTIES VS_STARTUP_PROJECT ${DHEWM3BINARY})
13731374
set_target_properties(${DHEWM3BINARY} PROPERTIES VS_DEBUGGER_COMMAND "${OUTPUT_FOLDER}/${DHEWM3BINARY}.exe")
13741375
set_target_properties(${DHEWM3BINARY} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${OUTPUT_FOLDER}")
@@ -1378,13 +1379,13 @@ if(ENGINE)
13781379
endif()
13791380

13801381
target_precompile_headers(${DHEWM3BINARY} PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h")
1381-
1382+
13821383
target_include_directories(${DHEWM3BINARY} PRIVATE "${CMAKE_SOURCE_DIR}/idlib" "${CMAKE_SOURCE_DIR}/libs/imgui")
13831384

13841385
if(HARDLINK_GAME)
13851386
set_target_properties(${DHEWM3BINARY} PROPERTIES COMPILE_DEFINITIONS "${TOOLS_DEFINES}")
13861387
target_include_directories(${DHEWM3BINARY} PRIVATE ${game_includes})
1387-
1388+
13881389
# Hack to get .natvis added
13891390
if (MSVC)
13901391
target_sources(${DHEWM3BINARY} PRIVATE "sys/win32/natvis/game.natvis")
@@ -1427,19 +1428,19 @@ if(DEDICATED)
14271428
${src_sys_base}
14281429
${src_debuggerServer}
14291430
)
1430-
1431+
14311432
if(MSVC)
14321433
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_stub_openal} ${src_stub_gl} ${src_debuggerServer})
14331434
endif()
1434-
1435+
14351436
target_precompile_headers(${DHEWM3BINARY}ded PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h")
1436-
1437+
14371438
target_include_directories(${DHEWM3BINARY}ded PRIVATE "${CMAKE_SOURCE_DIR}/idlib")
14381439

14391440
if(HARDLINK_GAME)
14401441
set_target_properties(${DHEWM3BINARY}ded PROPERTIES COMPILE_DEFINITIONS "IMGUI_DISABLE;ID_DEDICATED")
14411442
target_include_directories(${DHEWM3BINARY}ded PRIVATE ${game_includes})
1442-
1443+
14431444
# Hack to get .natvis added
14441445
if (MSVC)
14451446
target_sources(${DHEWM3BINARY} PRIVATE "sys/win32/natvis/game.natvis")
@@ -1455,7 +1456,7 @@ if(DEDICATED)
14551456
set_target_properties(${DHEWM3BINARY}ded PROPERTIES LINK_FLAGS "${ldflags}")
14561457
set_target_properties(${DHEWM3BINARY}ded PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<1:>${OUTPUT_FOLDER})
14571458
set_target_properties(${DHEWM3BINARY}ded PROPERTIES FOLDER "exes")
1458-
1459+
14591460
list(REMOVE_ITEM sys_thirdparty_libs ${OPENAL_LIBRARY})
14601461

14611462
target_link_libraries(${DHEWM3BINARY}ded
@@ -1549,16 +1550,16 @@ endif()
15491550

15501551
if(BASE AND NOT HARDLINK_GAME)
15511552
add_library(Game${cpu} SHARED ${src_game})
1552-
1553+
15531554
if (MSVC)
15541555
target_sources(Game${cpu} PRIVATE "sys/win32/natvis/game.natvis")
15551556
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_game})
15561557
endif()
1557-
1558+
15581559
target_precompile_headers(Game${cpu} PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h")
1559-
1560+
15601561
target_include_directories(Game${cpu} PRIVATE "${CMAKE_SOURCE_DIR}/idlib")
1561-
1562+
15621563
set_target_properties(Game${cpu} PROPERTIES PREFIX "")
15631564
set_target_properties(Game${cpu} PROPERTIES COMPILE_DEFINITIONS "GAME_DLL")
15641565
target_include_directories(Game${cpu} PRIVATE "${CMAKE_SOURCE_DIR}/game")

neo/cm/CollisionModel_contents.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ int idCollisionModelManagerLocal::ContentsTrm( trace_t *results, const idVec3 &s
502502
tw.trace.fraction = 1.0f;
503503
tw.trace.c.contents = 0;
504504
tw.trace.c.type = CONTACT_NONE;
505+
tw.trace.c.material = NULL;
506+
tw.trace.c.id = 0;
505507
tw.contents = contentMask;
506508
tw.isConvex = true;
507509
tw.rotation = false;

neo/cm/CollisionModel_load.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ void idCollisionModelManagerLocal::SetupTrmModelStructure( void ) {
775775
trmBrushes[0]->b->bounds.Clear();
776776
trmBrushes[0]->b->checkcount = 0;
777777
trmBrushes[0]->b->contents = -1; // all contents
778+
trmBrushes[0]->b->material = trmMaterial;
778779
trmBrushes[0]->b->numPlanes = 0;
779780
}
780781

@@ -3071,7 +3072,7 @@ cm_model_t *idCollisionModelManagerLocal::LoadRenderModel( const char *fileName
30713072
// shutdown the hash
30723073
ShutdownHash();
30733074

3074-
common->DPrintf( "...loaded collision model: " S_COLOR_WHITE "'%s'\n", model->name.c_str() );
3075+
common->DPrintf( "..loaded collision model: '%s'\n", model->name.c_str() );
30753076

30763077
return model;
30773078
}

neo/cm/CollisionModel_rotate.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,12 @@ int idCollisionModelManagerLocal::RotateEdgeThroughEdge( cm_traceWork_t *tw, con
324324
q = - b - sqrtd;
325325
}
326326
frac1 = q / a;
327-
frac2 = c / q;
327+
if ( q == 0.0f ) {
328+
frac2 = 0.0f;
329+
}
330+
else {
331+
frac2 = c / q;
332+
}
328333
}
329334

330335
if ( tw->angle < 0.0f ) {

neo/cm/CollisionModel_translate.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@ void idCollisionModelManagerLocal::Translation( trace_t *results, const idVec3 &
802802
tw.trace.fraction = 1.0f;
803803
tw.trace.c.contents = 0;
804804
tw.trace.c.type = CONTACT_NONE;
805+
tw.trace.c.material = NULL;
806+
tw.trace.c.id = 0;
805807
tw.contents = contentMask;
806808
tw.isConvex = true;
807809
tw.rotation = false;
@@ -889,8 +891,8 @@ void idCollisionModelManagerLocal::Translation( trace_t *results, const idVec3 &
889891
if ( session->rw ) {
890892
session->rw->DebugArrow( colorRed, start, end, 1 );
891893
}
892-
common->Printf( "idCollisionModelManagerLocal::Translation: huge translation from (%.2f %.2f %.2f) to (%.2f %.2f %.2f)\n",
893-
start.x, start.y, start.z, end.x, end.y, end.z);
894+
common->Printf( "idCollisionModelManagerLocal::Translation: huge translation from (%.2f %.2f %.2f) to (%.2f %.2f %.2f) of entity: %s\n",
895+
start.x, start.y, start.z, end.x, end.y, end.z, tw.model->name.c_str() );
894896
return;
895897
}
896898

0 commit comments

Comments
 (0)