Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
926efcf
Add modifications of the Damage functions and change some ammo variab…
LegendaryGuard Jul 23, 2023
835ccde
Add part of modifications of Damage and TestMelee functions in d3xp: …
LegendaryGuard Jul 23, 2023
cdc61a1
Add modified source code in framework and game directory (part 1)
LegendaryGuard Jul 24, 2023
e2d9b1d
Add 2 new files and modified player source code in game directory (pa…
LegendaryGuard Jul 24, 2023
b6b8a04
Add modified source code in game directory (part 3)
LegendaryGuard Jul 26, 2023
0e0bdc0
Add modified source code in game directory (part 4)
LegendaryGuard Jul 26, 2023
b1176b9
Convert the new added files from CRLF into LF and add modified source…
LegendaryGuard Jul 26, 2023
f9ca75f
Add modified source code in idlib
LegendaryGuard Jul 26, 2023
ef92e10
Add new source files in CMakeLists.txt
LegendaryGuard Jul 26, 2023
e29278f
Fix some stuff when trying to compile in Linux, remove applied #inclu…
LegendaryGuard Jul 26, 2023
1e694cd
Fix some stuff
LegendaryGuard Jul 27, 2023
7b3a83a
Fix more stuff
LegendaryGuard Jul 27, 2023
652fe79
Finally fix all errors, important: keep other classes in the correspo…
LegendaryGuard Jul 28, 2023
3a03b7b
Fix an error detected by Linux, &idEntity() can't be used. End of the…
LegendaryGuard Jul 28, 2023
02eddc5
Change the name of the compiled mod dll file
LegendaryGuard Jul 28, 2023
e1f6760
Clean up #include files in the code and disable some annoying asserti…
LegendaryGuard Jul 30, 2023
e6b192d
Fix alternatively the crash of when player picks up an item, somethin…
LegendaryGuard Jul 31, 2023
8928511
Disable other annoying assertion using #ifdef _DEBUG && 0
LegendaryGuard Jul 31, 2023
3ffc594
Change to README for HeXen: Edge Of Chaos
LegendaryGuard Jul 31, 2023
ffce9ca
load savegame
glKarin Nov 23, 2023
73d31bc
Merge pull request #2 from glKarin/patch-1
LegendaryGuard Mar 1, 2024
682cd5d
Merge branch 'master' into hexeneoc
LegendaryGuard Apr 18, 2024
164283a
Merge branch 'master' into hexeneoc
LegendaryGuard Aug 3, 2024
f924ef8
Fix newgranularity variable when using debug build
LegendaryGuard Aug 4, 2024
be7bac0
Fix idItem::GiveToPlayer in CallFunc function when picking up items l…
LegendaryGuard Aug 4, 2024
c511633
Change and fix when compiling debug builds with asserts, now disabled…
LegendaryGuard Aug 4, 2024
cf7dd5f
Add HEOC credits
LegendaryGuard Dec 23, 2025
e790cb9
Fix idItem::GiveToPlayer again, this time with function checks
LegendaryGuard Dec 25, 2025
7dfacbc
Rewrite, add license notes and give thanks to the main HEOC coder for…
LegendaryGuard Jan 5, 2026
e8e0e94
Add the last pieces of code of game/Trigger.cpp from HEOC and fix 'ne…
LegendaryGuard Jan 6, 2026
83b0423
Remove disabling macros in the assertions
LegendaryGuard Jan 6, 2026
e8640db
Update CMakeLists.txt
LegendaryGuard Jan 6, 2026
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
57 changes: 45 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8...3.22 FATAL_ERROR)
project(dhewm3sdk)

option(BASE "Build the base (game/) game code" ON)
set(BASE_NAME "base" CACHE STRING "Name of the mod built from game/ (will result in \${BASE_NAME}.dll)")
set(BASE_NAME "eoc" CACHE STRING "Name of the mod built from game/ (will result in \${BASE_NAME}.dll)")
set(BASE_DEFS "GAME_DLL" CACHE STRING "Compiler definitions for the mod built from game/")

option(D3XP "Build the d3xp/ game code" ON)
Expand Down Expand Up @@ -190,20 +190,30 @@ if(D3_COMPILER_IS_GCC_OR_CLANG)
endif ()
endif ()

set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG -O0")
if(cpu STREQUAL "e2k" AND CMAKE_COMPILER_IS_GNUCC)
# O3 on E2K mcst-lcc approximately equal to O2 at X86/ARM gcc
set(OPT_LEVEL "-O3")
else()
set(OPT_LEVEL "-O2")
endif()

set(CMAKE_C_FLAGS_DEBUG "-g -ggdb -D_DEBUG -O0")
set(CMAKE_C_FLAGS_DEBUGALL "-g -ggdb -D_DEBUG")
set(CMAKE_C_FLAGS_PROFILE "-g -ggdb -D_DEBUG -O1 -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-math-errno -fno-trapping-math -fomit-frame-pointer")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -fno-math-errno -fno-trapping-math -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-math-errno -fno-trapping-math -fomit-frame-pointer")
set(CMAKE_C_FLAGS_RELEASE "${OPT_LEVEL} -fno-math-errno -fno-trapping-math -ffinite-math-only -fomit-frame-pointer")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -ggdb ${OPT_LEVEL} -fno-math-errno -fno-trapping-math -ffinite-math-only -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-math-errno -fno-trapping-math -ffinite-math-only -fomit-frame-pointer")

set(CMAKE_CXX_FLAGS_DEBUGALL ${CMAKE_C_FLAGS_DEBUGALL})
set(CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE})

add_compile_options(-fno-strict-aliasing)
# dear idiot compilers, don't fuck up math code with useless FMA "optimizations"
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100839)
add_compile_options(-ffp-contract=off)
CHECK_CXX_COMPILER_FLAG("-ffp-contract=off" cxx_has_fp-contract)
if(cxx_has_fp-contract)
add_compile_options(-ffp-contract=off)
endif()

if(ASAN)
# if this doesn't work, ASan might not be available on your platform, don't set ASAN then..
Expand All @@ -212,7 +222,7 @@ if(D3_COMPILER_IS_GCC_OR_CLANG)
# set(ldflags ${ldflags} -fsanitize=address)
endif()

if(NOT AROS)
if(NOT AROS AND NOT WIN32)
CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" cxx_has_fvisibility)
if(NOT cxx_has_fvisibility)
message(FATAL_ERROR "Compiler does not support -fvisibility")
Expand All @@ -233,23 +243,35 @@ if(D3_COMPILER_IS_GCC_OR_CLANG)
add_compile_options(-Wno-class-memaccess)
endif()

CHECK_CXX_COMPILER_FLAG("-Wdangling-reference" cxx_has_Wdangling_reference)
if(cxx_has_Wdangling_reference)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=dangling-reference")
endif()

CHECK_CXX_COMPILER_FLAG("-Woverloaded-virtual" cxx_has_Woverload_virtual)
if(cxx_has_Woverload_virtual)
add_compile_options(-Woverloaded-virtual)
endif()

# ignore warnings about variables named "requires" for now (in C++20 it's a keyword,
# but currently we don't even use C++11 features)
CHECK_CXX_COMPILER_FLAG("-Wno-c++20-compat" cxx_has_Wno-cpp20-compat)
if(cxx_has_Wno-cpp20-compat)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++20-compat")
endif()

if(AROS)
set(CMAKE_SHARED_LIBRARY_SUFFIX ".aros-${cpu}")
add_definitions(-DIOAPI_NO_64)
elseif(APPLE)
add_definitions(-DMACOS_X=1)

if(cpu STREQUAL "x86_64")
add_compile_options(-arch x86_64 -mmacosx-version-min=10.6)
set(ldflags "${ldflags} -arch x86_64 -mmacosx-version-min=10.6")
add_compile_options(-arch x86_64 -mmacosx-version-min=10.7)
set(ldflags "${ldflags} -arch x86_64 -mmacosx-version-min=10.7")
elseif(cpu STREQUAL "arm64")
add_compile_options(-arch arm64 -mmacosx-version-min=11.0)
set(ldflags "${ldflags} -arch arm64 -mmacosx-version-min=11.0")
add_compile_options(-arch arm64 -mmacosx-version-min=10.7)
set(ldflags "${ldflags} -arch arm64 -mmacosx-version-min=10.7")
elseif(cpu STREQUAL "x86")
CHECK_CXX_COMPILER_FLAG("-arch i386" cxx_has_arch_i386)
if(cxx_has_arch_i386)
Expand Down Expand Up @@ -374,7 +396,9 @@ set(src_game
game/Moveable.cpp
game/MultiplayerGame.cpp
game/Player.cpp
game/PlayerArtifacts.cpp
game/PlayerIcon.cpp
game/PlayerScriptEvents.cpp
game/PlayerView.cpp
game/Projectile.cpp
game/Pvs.cpp
Expand All @@ -392,6 +416,9 @@ set(src_game
game/ai/AI.cpp
game/ai/AI_events.cpp
game/ai/AI_pathing.cpp
game/ai/AI_Golem.cpp
game/ai/AI_Shadowspawn.cpp
game/ai/AI_Veloxite.cpp
game/ai/AI_Vagary.cpp
game/gamesys/DebugGraph.cpp
game/gamesys/Class.cpp
Expand Down Expand Up @@ -425,6 +452,12 @@ set(src_game
game/physics/Physics_Static.cpp
game/physics/Physics_StaticMulti.cpp
game/physics/Push.cpp
game/objects/Leaf.cpp
game/objects/LeafEmitter.cpp
game/objects/Tree.cpp
game/projectiles/FireStorm.cpp
game/projectiles/Soul.cpp
game/projectiles/Wraithverge.cpp

${src_game_mod}
)
Expand Down Expand Up @@ -653,4 +686,4 @@ if(D3XP)
ARCHIVE DESTINATION "${libdir}"
)
endif()
endif()
endif()
Loading