Skip to content

Commit 945ac4b

Browse files
committed
Add CMake support
1 parent de88093 commit 945ac4b

File tree

162 files changed

+2036
-700
lines changed

Some content is hidden

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

162 files changed

+2036
-700
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -521,3 +521,4 @@ Xbox-Release/
521521
!xCore/Tools/stringTool.exe
522522
!xCore/Tools/xCL.exe
523523
!xCore/Tools/xbmpTool.exe
524+
/build

Apps/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(GameApp)

Apps/GameApp/CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
file(GLOB GAMEAPP_SRC
2+
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
3+
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
4+
)
5+
6+
add_executable(GameApp WIN32 ${GAMEAPP_SRC})
7+
set_support_defaults(GameApp)
8+
9+
set_target_properties(GameApp PROPERTIES OUTPUT_NAME "Area51")
10+
11+
target_link_libraries(GameApp GameLib)
12+
13+
# DirectX linkage
14+
if (MSVC)
15+
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
16+
target_link_directories(GameApp PRIVATE "$ENV{DXSDK_DIR}/Lib/x64")
17+
else()
18+
target_link_directories(GameApp PRIVATE "$ENV{DXSDK_DIR}/Lib/x86")
19+
endif()
20+
21+
target_include_directories(GameApp PRIVATE "$ENV{DXSDK_DIR}/Include")
22+
target_link_libraries(GameApp d3d9 d3dx9 dxguid XInput dinput8 dsound)
23+
endif()
24+
25+
26+
# Miles linkage
27+
if (MSVC)
28+
target_link_directories(GameApp PRIVATE "${CMAKE_SOURCE_DIR}/xCore/3rdParty/Miles6/lib/win")
29+
target_link_libraries(GameApp Mss32)
30+
endif()

CMakeLists.txt

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
2+
project(Area51 C CXX)
3+
if(APPLE)
4+
enable_language(OBJC)
5+
endif()
6+
7+
set(CMAKE_CXX_STANDARD 11)
8+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
9+
set(CMAKE_CXX_EXTENSIONS OFF)
10+
11+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
12+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
13+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
14+
15+
if (MSVC)
16+
# Always generate PDBs
17+
add_compile_options(/Zi)
18+
add_link_options(/DEBUG)
19+
20+
add_compile_options(/W3) # Warning level
21+
endif()
22+
23+
# XCore utilities
24+
25+
set(XCORE_PATH "${CMAKE_SOURCE_DIR}/xCore")
26+
set(XCORE_AUX_PATH "${CMAKE_SOURCE_DIR}/xCore/Auxiliary")
27+
set(XCORE_X_FILES_PATH "${CMAKE_SOURCE_DIR}/xCore/x_files")
28+
set(XCORE_3RDPARTY_PATH "${CMAKE_SOURCE_DIR}/xCore/3rdParty")
29+
30+
function(set_xcore_defaults TARGET)
31+
target_include_directories(${TARGET} PRIVATE ${XCORE_PATH}
32+
PRIVATE ${XCORE_AUX_PATH}
33+
PRIVATE ${XCORE_X_FILES_PATH})
34+
35+
# Compile definitions
36+
target_compile_definitions(${TARGET} PRIVATE TARGET_PC
37+
PRIVATE $<$<CONFIG:Debug>:CONFIG_DEBUG>
38+
PRIVATE $<$<CONFIG:Release>:CONFIG_RETAIL>)
39+
endfunction()
40+
41+
# Support utilities
42+
43+
set(SUPPORT_PATH "${CMAKE_SOURCE_DIR}/Support")
44+
45+
function(set_support_defaults TARGET)
46+
set_xcore_defaults(${TARGET})
47+
target_include_directories(${TARGET} PRIVATE "${SUPPORT_PATH}")
48+
endfunction()
49+
50+
add_subdirectory(xCore)
51+
add_subdirectory(Support)
52+
add_subdirectory(Apps)

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@ The main goal is to get the source code into a buildable state on modern systems
2727
To contribute, please fork the repository, make your changes, and submit a pull request with your updates. For discussion, collaboration, and support, join our community on platforms like Discord or participate in GitHub Discussions for this project.
2828

2929

30+
## How to Build
31+
Currently, the only compiler supported is Visual Studio and Win32 configuration.
32+
Build system is based on CMake, so version of Visual Studio is doesn't mean, it's should be higher or equal to Visual Studio 2013.
33+
34+
For build project run from command-line:
35+
36+
Visual Studio 2019+:
37+
```
38+
cmake -B build -A Win32
39+
```
40+
41+
Visual Studio 2013-2017:
42+
```
43+
cmake -B build
44+
```
45+
46+
After you should run:
47+
```
48+
cmake --build build --config Release
49+
```
50+
51+
Release or Debug binaries are located in bin folder.
52+
3053
## Releases
3154

3255
[Here](https://github.com/ProjectDreamland/area51/releases/)

Support/Animation/AnimCompress.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#ifndef DISABLE_LEGACY_CODE
12
//=========================================================================
23
//
34
// ANIMCOMPRESS.CPP
@@ -986,3 +987,5 @@ void CompressAnimationData( bitstream& aBS,
986987

987988
//=========================================================================
988989

990+
991+
#endif // !DISABLE_LEGACY_CODE

Support/Animation/AnimData.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#ifndef DISABLE_LEGACY_CODE
12
//=========================================================================
23
//
34
// ANIMDATA.CPP
@@ -1611,3 +1612,4 @@ void anim_loader::Unload( void* pData, const char* pFileName )
16111612
}
16121613

16131614
//==============================================================================
1615+
#endif // !DISABLE_LEGACY_CODE

Support/AudioMgr/AudioMgr.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,13 @@ voice_id audio_manager::Play( const char* pIdentifier, sound_type SoundType, con
521521
voice_id VoiceID = 0;
522522
vector3 FinalPos = Position;
523523

524+
// #TODO: Research the Zone argument in the PlayVolumeClipped and Play methods of audio_mgr class.
525+
// For now ZONELESS
526+
524527
if( VolumeClipped )
525-
VoiceID = g_AudioMgr.PlayVolumeClipped( pIdentifier, FinalPos, AutoStart );
528+
VoiceID = g_AudioMgr.PlayVolumeClipped( pIdentifier, FinalPos, ZONELESS, AutoStart );
526529
else
527-
VoiceID = g_AudioMgr.Play( pIdentifier, FinalPos, AutoStart );
530+
VoiceID = g_AudioMgr.Play( pIdentifier, FinalPos, ZONELESS, AutoStart );
528531

529532
m_Receiver[ m_CurrentReceiverCursor ].Guid = Guid;
530533
m_Receiver[ m_CurrentReceiverCursor ].Pos = FinalPos;

Support/AudioMgr/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
file(GLOB AUDIOMGR_SRC
2+
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
3+
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
4+
)
5+
6+
add_library(audiomgr STATIC ${AUDIOMGR_SRC})
7+
set_support_defaults(audiomgr)
8+
9+
target_link_libraries(audiomgr Entropy)

Support/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
add_subdirectory(AudioMgr)
2+
add_subdirectory(ConversationMgr)
3+
add_subdirectory(EventMgr)
4+
add_subdirectory(Render)
5+
add_subdirectory(NetworkMgr)
6+
add_subdirectory(UI)
7+
add_subdirectory(Dialogs)
8+
add_subdirectory(Music_mgr)
9+
add_subdirectory(GameLib)

Support/Characters/AStar.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "Navigation\ng_node2.hpp"
55
#include "Navigation\ng_connection2.hpp"
6-
#include "..\MiscUtils\PriorityQueue.hpp"
6+
#include "MiscUtils\PriorityQueue.hpp"
77
#include "AStarNode.hpp"
88

99

Support/Characters/Character.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "Character.hpp"
1818
#include "Navigation\CoverNode.hpp"
1919
#include "Navigation\AlarmNode.hpp"
20-
#include "..\MiscUtils\TrajectoryGenerator.hpp"
20+
#include "MiscUtils\TrajectoryGenerator.hpp"
2121
#include "objects\GrenadeProjectile.hpp"
2222
#include "objects\GravChargeProjectile.hpp"
2323
#include "Objects\Player.hpp"

Support/Characters/CharacterState.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/////////////////////////////////////////////////////////////////////////////
33

44
#include "CharacterState.hpp"
5-
#include "..\..\MiscUtils\SimpleUtils.hpp"
5+
#include "MiscUtils\SimpleUtils.hpp"
66
#include "God.hpp"
77
#include "Character.hpp"
88

Support/Characters/GenericNPC/GenericNPC.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
#include "objects\GrenadeProjectile.hpp"
1414
#include "objects\NewWeapon.hpp"
15-
#include "..\MiscUtils\SimpleUtils.hpp"
16-
#include "..\MiscUtils\TrajectoryGenerator.hpp"
15+
#include "MiscUtils\SimpleUtils.hpp"
16+
#include "MiscUtils\TrajectoryGenerator.hpp"
1717
#include "Debris\debris_mgr.hpp"
1818
#include "Debris\debris_rigid.hpp"
1919
#include "gamelib\StatsMgr.hpp"

Support/Characters/Grunt/Grunt.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
#include "objects\GrenadeProjectile.hpp"
1414
#include "objects\NewWeapon.hpp"
15-
#include "..\MiscUtils\SimpleUtils.hpp"
16-
#include "..\MiscUtils\TrajectoryGenerator.hpp"
15+
#include "MiscUtils\SimpleUtils.hpp"
16+
#include "MiscUtils\TrajectoryGenerator.hpp"
1717
#include "Debris\debris_mgr.hpp"
1818
#include "Debris\debris_rigid.hpp"
1919
#include "gamelib\StatsMgr.hpp"

Support/Characters/MutantTank/MutantTank_Attack_State.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "Objects\WeaponSMP.hpp"
44
#include "Objects\WeaponShotgun.hpp"
55
#include "Objects\SuperDestructible.hpp"
6-
#include "..\MiscUtils\SimpleUtils.hpp"
6+
#include "MiscUtils\SimpleUtils.hpp"
77

88
//=========================================================================
99
// DEFINES

Support/Characters/MutantTank/Mutant_Tank.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//=========================================================================
1010

1111
#include "Mutant_Tank.hpp"
12-
#include "..\MiscUtils\SimpleUtils.hpp"
12+
#include "MiscUtils\SimpleUtils.hpp"
1313
#include "Gamelib\StatsMgr.hpp"
1414
#include "Objects\Player.hpp"
1515
#include "Objects\SuperDestructible.hpp"

Support/Characters/ResponseList.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//=========================================================================
44
// OBJECT DESCRIPTION
55
//=========================================================================
6-
#include "..\MiscUtils\SimpleUtils.hpp"
6+
#include "MiscUtils\SimpleUtils.hpp"
77

88
void response_list::AddFlags( u32 newFlags )
99
{

Support/Characters/TaskSystem/character_task.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "character_task.hpp"
1212
#include "character_task_set.hpp"
13-
#include "..\MiscUtils\SimpleUtils.hpp"
13+
#include "MiscUtils\SimpleUtils.hpp"
1414

1515
static const s32 MAX_STRING_TASK_DESC_LEN = 255;
1616

Support/Characters/TaskSystem/character_task_set.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "CollisionMgr\CollisionMgr.hpp"
1313
#include "Entropy.hpp"
1414
#include "Render\editor_icons.hpp"
15-
#include "..\MiscUtils\SimpleUtils.hpp"
15+
#include "MiscUtils\SimpleUtils.hpp"
1616
#include "Characters\Character.hpp"
1717

1818
#define MAX_TASK_STRING_LEN 255
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
file(GLOB CONVERSATIONMGR_SRC
2+
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
3+
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
4+
)
5+
6+
add_library(ConversationMgr STATIC ${CONVERSATIONMGR_SRC})
7+
set_support_defaults(ConversationMgr)
8+
9+
target_link_libraries(ConversationMgr Entropy)

Support/Debris/debris_alien_grenade_explosion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "debris_alien_grenade_explosion.hpp"
22
#include "NetworkMgr\Networkmgr.hpp"
3-
#include "..\MiscUtils\SimpleUtils.hpp"
3+
#include "MiscUtils\SimpleUtils.hpp"
44
#include "..\Objects\Player.hpp"
55
#include "objects\ParticleEmiter.hpp"
66
#include "Tracers\TracerMgr.hpp"

Support/Debris/debris_cannon.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "GameLib\RenderContext.hpp"
1414
#include "Render\RigidGeom.hpp"
1515
#include "NetworkMgr\Networkmgr.hpp"
16-
#include "..\MiscUtils\SimpleUtils.hpp"
16+
#include "MiscUtils\SimpleUtils.hpp"
1717
#include "..\Objects\Player.hpp"
1818

1919
//=============================================================================

Support/Debris/debris_frag_explosion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "debris_frag_explosion.hpp"
22
#include "NetworkMgr\Networkmgr.hpp"
3-
#include "..\MiscUtils\SimpleUtils.hpp"
3+
#include "MiscUtils\SimpleUtils.hpp"
44
#include "..\Objects\Player.hpp"
55
#include "objects\ParticleEmiter.hpp"
66
#include "Decals\DecalMgr.hpp"

Support/Debris/debris_meson_lash.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "debris_meson_lash.hpp"
22
#include "NetworkMgr\Networkmgr.hpp"
3-
#include "..\MiscUtils\SimpleUtils.hpp"
3+
#include "MiscUtils\SimpleUtils.hpp"
44
#include "..\Objects\Player.hpp"
55
#include "objects\ParticleEmiter.hpp"
66
#include "Tracers\TracerMgr.hpp"

Support/Dialogs/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
file(GLOB DIALOGS_SRC
2+
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
3+
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
4+
)
5+
6+
add_library(UIDialogs STATIC ${DIALOGS_SRC})
7+
set_support_defaults(UIDialogs)
8+
9+
target_link_libraries(UIDialogs UI)

Support/Dialogs/dlg_BuddyList.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if 0
12
//=========================================================================
23
//
34
// dlg_buddy_list.cpp
@@ -478,3 +479,4 @@ void dlg_buddy_list::RefreshBuddyList( void )
478479
}
479480

480481
//=========================================================================
482+
#endif

Support/Dialogs/dlg_MemcardSelect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ xbool dlg_memcard_select::Create( s32 UserID,
257257

258258
//=========================================================================
259259

260-
void dlg_memcard_select::Configure( card_data_mode mode, s32 size = 0 )
260+
void dlg_memcard_select::Configure( card_data_mode mode, s32 size/* = 0*/ )
261261
{
262262
m_Mode = mode;
263263
m_Size = size;

Support/Dialogs/dlg_OnlineConnect.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ void dlg_online_connect::Render( s32 ox, s32 oy )
296296

297297
xbool PalMode;
298298
irect textPos;
299-
eng_GetPALMode( PalMode );
299+
//eng_GetPALMode( PalMode ); // #TODO: !!!
300300
if( PalMode )
301301
{
302302
textPos.Set( tempW-150, 370, tempW+150, 50 );
@@ -832,8 +832,8 @@ void dlg_online_connect::OnUpdate ( ui_win* pWin, f32 DeltaTime )
832832
if( Error==ATTACH_STATUS_ERROR )
833833
{
834834
connect_status ConnStatus;
835-
836-
net_GetConnectStatus( ConnStatus );
835+
// #TODO: !!!
836+
// net_GetConnectStatus( ConnStatus );
837837
// Literal error text from the connection
838838
if( ConnStatus.ErrorText[0] )
839839
{

Support/Dialogs/dlg_OnlineConnect.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class dlg_online_connect : public ui_dialog
114114
void UpdateAuthUser ( void );
115115

116116

117-
#if defined(TARGET_PS2)
117+
#if 1// defined(TARGET_PS2)
118118
s32 PopulateConfigurationList( void );
119119
#endif
120120
ui_frame* m_pFrame1;
@@ -150,7 +150,7 @@ class dlg_online_connect : public ui_dialog
150150

151151
cancel_mode m_CancelMode;
152152
connect_states m_RetryDestination;
153-
#if defined(TARGET_PS2)
153+
#if 1// defined(TARGET_PS2)
154154
// DNAS logo controls
155155
s32 m_DNASIconID[NUM_DNAS_LOGOS];
156156
xbool m_bRenderLogo[NUM_DNAS_LOGOS];

0 commit comments

Comments
 (0)