Skip to content

Commit 6e0dbc1

Browse files
Restored Precompiled Headers
1 parent 71abba8 commit 6e0dbc1

File tree

885 files changed

+2269
-11505
lines changed

Some content is hidden

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

885 files changed

+2269
-11505
lines changed

neo/CMakeLists.txt

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ set_property( GLOBAL PROPERTY USE_FOLDERS ON )
1313

1414
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" )
1515

16-
project( dhewm3 )
16+
project( dhewm3 CXX C)
1717

1818
# build type
1919
if( NOT CMAKE_BUILD_TYPE )
2020
set( CMAKE_BUILD_TYPE "RelWithDebInfo" )
2121
endif()
2222

23-
set( DHEWM3BINARY "dhewm3" )
23+
set( DHEWM3BINARY "D3ModdingKit" )
2424

2525
include( CheckCXXCompilerFlag )
2626
include( GNUInstallDirs OPTIONAL RESULT_VARIABLE GNUINSTALLDIRS )
@@ -122,7 +122,7 @@ else()
122122
endif()
123123

124124
# MayaImport currently doesn't work in Linux/Mac
125-
if ( NOT WIN32 )
125+
if ( NOT WIN32 OR NOT TOOLS )
126126
set( MAYA_IMPORT OFF )
127127
endif()
128128

@@ -561,6 +561,15 @@ set(src_framework
561561
framework/minizip/unzip.cpp
562562
)
563563

564+
# Don't use precompiled headers for miniz/minizip sources.
565+
set_source_files_properties(
566+
framework/miniz/miniz.c
567+
framework/minizip/ioapi.c
568+
PROPERTIES
569+
SKIP_PRECOMPILE_HEADERS ON
570+
LANGUAGE C
571+
)
572+
564573
always_optimize_sourcefile(framework/miniz/miniz.c)
565574
always_optimize_sourcefile(framework/minizip/ioapi.c)
566575
always_optimize_sourcefile(framework/minizip/unzip.cpp)
@@ -711,6 +720,7 @@ set(src_idlib
711720
idlib/Dict.cpp
712721
idlib/Str.cpp
713722
idlib/Parser.cpp
723+
idlib/precompiled.cpp
714724
idlib/MapFile.cpp
715725
idlib/CmdArgs.cpp
716726
idlib/Token.cpp
@@ -726,6 +736,14 @@ set(src_mikktspace
726736
libs/mikktspace/mikktspace.c
727737
)
728738

739+
# Don't use precompiled headers for mikktspace sources.
740+
set_source_files_properties(
741+
libs/mikktspace/mikktspace.c
742+
PROPERTIES
743+
SKIP_PRECOMPILE_HEADERS ON
744+
LANGUAGE C
745+
)
746+
729747
add_globbed_headers(src_mikktspace "mikktspace")
730748

731749
if( IMGUI )
@@ -745,6 +763,19 @@ if( IMGUI )
745763
sys/sys_imgui.cpp
746764
sys/imgui_savestyle.cpp
747765
)
766+
767+
# Don't use precompiled headers for imgui sources.
768+
set_source_files_properties(
769+
libs/imgui/backends/imgui_impl_sdl2.cpp
770+
libs/imgui/backends/imgui_impl_opengl2.cpp
771+
libs/imgui/imgui.cpp
772+
libs/imgui/imgui_draw.cpp
773+
libs/imgui/imgui_tables.cpp
774+
libs/imgui/imgui_widgets.cpp
775+
libs/imgui/imgui_demo.cpp
776+
PROPERTIES
777+
SKIP_PRECOMPILE_HEADERS ON
778+
)
748779
else()
749780
set(src_imgui
750781
sys/sys_imgui.h
@@ -1042,12 +1073,11 @@ if ( TOOLS AND MFC_TOOLS AND MSVC )
10421073
${src_sound_editor}
10431074
${src_script_debugger}
10441075
"tools/edit_public.h"
1045-
"tools/edit_gui_common.h"
10461076
)
10471077
SET(CMAKE_MFC_FLAG 2)
10481078
set(TOOLS_DEFINES "ID_ALLOW_TOOLS;_AFXDLL")
10491079
else()
1050-
set(src_editor_tools "tools/edit_stub.cpp" "tools/edit_public.h" "tools/debugger/debugger_common.h")
1080+
set(src_editor_tools "tools/edit_stub.cpp" "tools/edit_public.h" )
10511081
list(APPEND src_editor_tools
10521082
${src_debuggerServer}
10531083
)
@@ -1091,6 +1121,14 @@ elseif(WIN32)
10911121
sys/win32/win_syscon.cpp
10921122
sys/win32/SDL_win32_main.c
10931123
)
1124+
1125+
# Don't use precompiled headers for our SDL Win32 c sources.
1126+
set_source_files_properties(
1127+
sys/win32/SDL_win32_main.c
1128+
PROPERTIES
1129+
SKIP_PRECOMPILE_HEADERS ON
1130+
LANGUAGE C
1131+
)
10941132

10951133
# adding the few relevant headers in sys/ manually..
10961134
set(src_sys_base ${src_sys_base}
@@ -1154,9 +1192,11 @@ endif()
11541192

11551193
if ( MSVC )
11561194
target_sources( idlib INTERFACE "sys/win32/natvis/idlib.natvis" )
1195+
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_idlib} )
11571196
endif()
11581197

1159-
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_idlib} )
1198+
target_include_directories( idlib PRIVATE "${CMAKE_SOURCE_DIR}/idlib" )
1199+
target_precompile_headers( idlib PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h" )
11601200

11611201
set_target_properties( idlib PROPERTIES FOLDER "libs" )
11621202

@@ -1185,12 +1225,18 @@ if( ENGINE )
11851225
)
11861226

11871227
if( MSVC )
1188-
set_property( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${DHEWM3BINARY} )
1189-
endif()
1228+
# set MSVC default debug directory on executable
1229+
set_target_properties( ${DHEWM3BINARY} PROPERTIES VS_STARTUP_PROJECT ${DHEWM3BINARY} )
1230+
set_target_properties( ${DHEWM3BINARY} PROPERTIES VS_DEBUGGER_COMMAND "${OUTPUT_FOLDER}/${DHEWM3BINARY}.exe" )
1231+
set_target_properties( ${DHEWM3BINARY} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${OUTPUT_FOLDER}" )
1232+
set_target_properties( ${DHEWM3BINARY} PROPERTIES VS_DEBUGGER_COMMAND_ARGUMENTS "+set developer 1" )
11901233

1191-
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_sys_core} ${src_imgui} ${src_editor_tools} )
1234+
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_sys_core} ${src_imgui} ${src_editor_tools} )
1235+
endif()
11921236

1193-
target_include_directories( ${DHEWM3BINARY} PRIVATE "${CMAKE_SOURCE_DIR}/libs/imgui" )
1237+
target_precompile_headers( ${DHEWM3BINARY} PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h" )
1238+
1239+
target_include_directories( ${DHEWM3BINARY} PRIVATE "${CMAKE_SOURCE_DIR}/idlib" "${CMAKE_SOURCE_DIR}/libs/imgui" )
11941240

11951241
if( HARDLINK_GAME )
11961242
set_target_properties( ${DHEWM3BINARY} PROPERTIES COMPILE_DEFINITIONS "${TOOLS_DEFINES}" )
@@ -1239,7 +1285,13 @@ if( DEDICATED )
12391285
${src_debuggerServer}
12401286
)
12411287

1242-
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_stub_openal} ${src_stub_gl} ${src_debuggerServer} )
1288+
if( MSVC )
1289+
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_core} ${src_sys_base} ${src_stub_openal} ${src_stub_gl} ${src_debuggerServer} )
1290+
endif()
1291+
1292+
target_precompile_headers( ${DHEWM3BINARY}ded PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h" )
1293+
1294+
target_include_directories( ${DHEWM3BINARY}ded PRIVATE "${CMAKE_SOURCE_DIR}/idlib" )
12431295

12441296
if( HARDLINK_GAME )
12451297
set_target_properties( ${DHEWM3BINARY}ded PROPERTIES COMPILE_DEFINITIONS "IMGUI_DISABLE;ID_DEDICATED" )
@@ -1312,7 +1364,13 @@ if( TOOLS AND MAYA_IMPORT )
13121364

13131365
add_dependencies( MayaImport${MAYA_VERSION} MayaDevKit )
13141366

1315-
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_mayaimport} ${src_toolsupportsrc} ${src_enginestub} )
1367+
if( MSVC )
1368+
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_mayaimport} ${src_toolsupportsrc} ${src_enginestub} )
1369+
endif()
1370+
1371+
target_precompile_headers( MayaImport${MAYA_VERSION} PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h" )
1372+
1373+
target_include_directories( MayaImport${MAYA_VERSION} PRIVATE "${CMAKE_SOURCE_DIR}/idlib" )
13161374

13171375
if( HARDLINK_GAME )
13181376
if ( MSVC )
@@ -1351,9 +1409,12 @@ if( BASE AND NOT HARDLINK_GAME )
13511409

13521410
if ( MSVC )
13531411
target_sources( base PRIVATE "sys/win32/natvis/game.natvis" )
1412+
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_game} )
13541413
endif()
13551414

1356-
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_game} )
1415+
target_precompile_headers( base PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h" )
1416+
1417+
target_include_directories( base PRIVATE "${CMAKE_SOURCE_DIR}/idlib" )
13571418

13581419
set_target_properties( base PROPERTIES PREFIX "" )
13591420
set_target_properties( base PROPERTIES COMPILE_DEFINITIONS "GAME_DLL" )
@@ -1380,9 +1441,12 @@ if( D3XP AND NOT HARDLINK_GAME )
13801441

13811442
if ( MSVC )
13821443
target_sources( d3xp PRIVATE "sys/win32/natvis/game.natvis" )
1444+
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_d3xp} )
13831445
endif()
13841446

1385-
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX neo FILES ${src_d3xp} )
1447+
target_precompile_headers( d3xp PRIVATE "${CMAKE_SOURCE_DIR}/idlib/precompiled.h" )
1448+
1449+
target_include_directories( d3xp PRIVATE "${CMAKE_SOURCE_DIR}/idlib" )
13861450

13871451
set_target_properties( d3xp PROPERTIES PREFIX "")
13881452
set_target_properties( d3xp PROPERTIES COMPILE_DEFINITIONS "GAME_DLL;_D3XP;CTF" )

neo/MayaImport/exporter.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ If you have questions concerning this license or the applicable additional terms
2929
#ifndef __EXPORTER_H__
3030
#define __EXPORTER_H__
3131

32-
#include "idlib/containers/Hierarchy.h"
33-
#include "idlib/containers/StrList.h"
34-
3532
#define MAYA_DEFAULT_CAMERA "camera1"
3633

3734
#define ANIM_TX BIT( 0 )

neo/MayaImport/maya_main.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ If you have questions concerning this license or the applicable additional terms
2828

2929
#define IDSTR_NO_REDIRECT
3030

31-
#include "sys/platform.h"
31+
#include "precompiled.h"
32+
#pragma hdrstop
3233

3334
#ifdef _WIN32
3435
#define _BOOL
@@ -74,13 +75,8 @@ If you have questions concerning this license or the applicable additional terms
7475
#undef _BOOL
7576
#endif // _WIN32
7677

77-
#include "idlib/math/Quat.h"
78-
#include "idlib/bv/Bounds.h"
79-
#include "framework/Licensee.h"
80-
#include "renderer/Model.h"
81-
82-
#include "MayaImport/exporter.h"
83-
#include "MayaImport/maya_main.h"
78+
#include "exporter.h"
79+
#include "maya_main.h"
8480

8581
idStr errorMessage;
8682
bool initialized = false;

neo/MayaImport/maya_main.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ If you have questions concerning this license or the applicable additional terms
2929
#ifndef __MAYA_MAIN_H__
3030
#define __MAYA_MAIN_H__
3131

32-
#include "framework/FileSystem.h"
33-
34-
class idCommon;
35-
class idSys;
36-
3732
#ifndef ID_MAYA_IMPORT_API
3833
#define ID_MAYA_IMPORT_API
3934
#endif

neo/cm/CollisionModel.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ If you have questions concerning this license or the applicable additional terms
2929
#ifndef __COLLISIONMODELMANAGER_H__
3030
#define __COLLISIONMODELMANAGER_H__
3131

32-
#include "idlib/geometry/TraceModel.h"
33-
#include "idlib/math/Vector.h"
34-
#include "idlib/math/Matrix.h"
35-
#include "idlib/bv/Bounds.h"
36-
#include "idlib/MapFile.h"
37-
38-
class idMaterial;
39-
4032
/*
4133
===============================================================================
4234

neo/cm/CollisionModel_contacts.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ If you have questions concerning this license or the applicable additional terms
3434
===============================================================================
3535
*/
3636

37-
#include "sys/platform.h"
37+
#include "precompiled.h"
38+
#pragma hdrstop
3839

39-
#include "cm/CollisionModel_local.h"
40+
#include "CollisionModel_local.h"
4041

4142
/*
4243
===============================================================================

neo/cm/CollisionModel_contents.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ If you have questions concerning this license or the applicable additional terms
3434
===============================================================================
3535
*/
3636

37-
#include "sys/platform.h"
37+
#include "precompiled.h"
38+
#pragma hdrstop
3839

39-
#include "cm/CollisionModel_local.h"
40+
#include "CollisionModel_local.h"
4041

4142
/*
4243
===============================================================================

neo/cm/CollisionModel_debug.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,11 @@ If you have questions concerning this license or the applicable additional terms
3434
===============================================================================
3535
*/
3636

37-
#include "sys/platform.h"
38-
#include "idlib/Timer.h"
39-
#include "framework/Common.h"
40-
#include "framework/Session.h"
41-
#include "renderer/Material.h"
42-
#include "renderer/RenderWorld.h"
43-
#include "sys/sys_public.h"
44-
45-
#include "cm/CollisionModel_local.h"
37+
#include "precompiled.h"
38+
#pragma hdrstop
39+
40+
#include "CollisionModel_local.h"
41+
4642

4743
/*
4844
===============================================================================

neo/cm/CollisionModel_files.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ If you have questions concerning this license or the applicable additional terms
3434
===============================================================================
3535
*/
3636

37-
#include "sys/platform.h"
38-
#include "framework/FileSystem.h"
39-
#include "renderer/Material.h"
40-
#include "renderer/RenderWorld.h"
37+
#include "precompiled.h"
38+
#pragma hdrstop
4139

42-
#include "cm/CollisionModel_local.h"
40+
#include "CollisionModel_local.h"
4341

4442
#define CM_FILE_EXT "cm"
4543
#define CM_FILEID "CM"

neo/cm/CollisionModel_load.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ If you have questions concerning this license or the applicable additional terms
4545
===============================================================================
4646
*/
4747

48-
#include "sys/platform.h"
49-
#include "idlib/Timer.h"
50-
#include "renderer/Model.h"
51-
#include "renderer/ModelManager.h"
52-
#include "renderer/RenderWorld.h"
48+
#include "precompiled.h"
49+
#pragma hdrstop
50+
51+
#include "CollisionModel_local.h"
5352

54-
#include "cm/CollisionModel_local.h"
5553

5654
idCollisionModelManagerLocal collisionModelManagerLocal;
5755
idCollisionModelManager * collisionModelManager = &collisionModelManagerLocal;

neo/cm/CollisionModel_local.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ If you have questions concerning this license or the applicable additional terms
3434
===============================================================================
3535
*/
3636

37-
#include "idlib/math/Pluecker.h"
38-
#include "cm/CollisionModel.h"
37+
#include "CollisionModel.h"
3938

4039
#define MIN_NODE_SIZE 64.0f
4140
#define MAX_NODE_POLYGONS 128

neo/cm/CollisionModel_rotate.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ If you have questions concerning this license or the applicable additional terms
3434
===============================================================================
3535
*/
3636

37-
#include "sys/platform.h"
37+
#include "precompiled.h"
38+
#pragma hdrstop
3839

39-
#include "cm/CollisionModel_local.h"
40+
#include "CollisionModel_local.h"
4041

4142
/*
4243
===============================================================================

neo/cm/CollisionModel_trace.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ If you have questions concerning this license or the applicable additional terms
3434
===============================================================================
3535
*/
3636

37-
#include "sys/platform.h"
37+
#include "precompiled.h"
38+
#pragma hdrstop
3839

39-
#include "cm/CollisionModel_local.h"
40+
#include "CollisionModel_local.h"
4041

4142
/*
4243
===============================================================================

0 commit comments

Comments
 (0)