Skip to content

Commit e1fa93f

Browse files
author
nitrocaster
committed
Move AI navigation to xrAICore.
1 parent d0b5e12 commit e1fa93f

File tree

373 files changed

+2888
-3701
lines changed

Some content is hidden

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

373 files changed

+2888
-3701
lines changed

src/xrServerEntities/LevelGameDef.h renamed to src/Common/LevelGameDef.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//---------------------------------------------------------------------------
2-
#ifndef LevelGameDefH
3-
#define LevelGameDefH
1+
#pragma once
42

53
#define RPOINT_CHOOSE_NAME "$rpoint"
64
#define ENVMOD_CHOOSE_NAME "$env_mod"
@@ -20,9 +18,10 @@ enum EWayType{
2018
};
2119

2220
enum ERPpointType{ // [0..255]
23-
rptActorSpawn = 0,
24-
rptArtefactSpawn ,
25-
rptItemSpawn ,
21+
rptActorSpawn = 0,
22+
rptArtefactSpawn,
23+
rptItemSpawn,
24+
rptLast = 0xff
2625
};
2726

2827
enum EEnvModUsedParams{ eViewDist =(1<<0),
@@ -33,8 +32,14 @@ enum EEnvModUsedParams{ eViewDist =(1<<0),
3332
eHemiColor =(1<<5)
3433
};
3534

36-
extern ECORE_API xr_token rpoint_type[];
37-
extern ECORE_API xr_token rpoint_game_type[];
35+
/* // XXX: find better place for this (need cpp)
36+
xr_token rpoint_type[] = {
37+
{"Actor Spawn", rptActorSpawn},
38+
{"Artefact Spawn", rptArtefactSpawn},
39+
{"Item Spawn", rptItemSpawn},
40+
{nullptr, rptLast}
41+
};
42+
*/
3843

3944
// BASE offset
4045
#define WAY_BASE 0x1000
@@ -98,6 +103,3 @@ extern ECORE_API xr_token rpoint_game_type[];
98103
-//-
99104
100105
*/
101-
//---------------------------------------------------------------------------
102-
#endif //LevelGameDefH
103-

src/Common/LevelStructure.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ struct SNodePositionOld
288288
typedef SNodePositionOld NodePosition;
289289
#endif
290290

291+
const char LEVEL_GRAPH_NAME[] = "level.ai";
292+
291293
const u32 XRCL_CURRENT_VERSION = 18; // input
292294
const u32 XRCL_PRODUCTION_VERSION = 14; // output
293295
const u32 CFORM_CURRENT_VERSION = 4;

src/Include/xrAPI/xrAPI.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class IUIRender;
1717
class CGameMtlLibrary;
1818
class CRender;
1919
class CScriptEngine;
20+
class AISpaceBase;
2021

2122
class XRAPI_API EngineGlobalEnvironment
2223
{
@@ -33,6 +34,8 @@ class XRAPI_API EngineGlobalEnvironment
3334
#endif
3435
IRenderFactory* RenderFactory;
3536
CScriptEngine* ScriptEngine;
37+
AISpaceBase *AISpace;
3638
};
3739

38-
extern XRAPI_API EngineGlobalEnvironment GlobalEnv;
40+
extern XRAPI_API EngineGlobalEnvironment GlobalEnv; // XXX: rename to GEnv
41+
extern XRAPI_API bool g_dedicated_server; // XXX: move to EngineGlobalEnvironment

src/Layers/xrAPI/xrAPI.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
#include "Include/xrAPI/xrAPI.h"
33

44
EngineGlobalEnvironment GlobalEnv = {};
5+
bool g_dedicated_server = false;

src/utils/xrAI/compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct vertex // definition of "patch" or "node"
5151

5252
DEF_VECTOR(DWORDs,u32);
5353

54-
#include "xrGame/level_graph.h"
54+
#include "xrAICore/Navigation/level_graph.h"
5555

5656
void Compress (CLevelGraph::CVertex& Dest, vertex& Src);
5757

src/utils/xrAI/compiler_load.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "stdafx.h"
22
#include "compiler.h"
3-
#include "levelgamedef.h"
4-
#include "xrGame/level_graph.h"
3+
#include "Common/LevelGameDef.h"
4+
#include "xrAICore/Navigation/level_graph.h"
55
#include "AIMapExport.h"
66

77
IC const Fvector vertex_position(const CLevelGraph::CPosition &Psrc, const Fbox &bb, const SAIParams &params)

src/utils/xrAI/game_graph_builder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#include "stdafx.h"
1010
#include "game_graph_builder.h"
11-
#include "xrGame/level_graph.h"
12-
#include "xrGame/graph_abstract.h"
11+
#include "xrAICore/Navigation/level_graph.h"
12+
#include "xrAICore/Navigation/graph_abstract.h"
1313
#include "xrMessages.h"
1414
#include "xrServer_Objects_ALife.h"
1515
#include "factory_api.h"
16-
#include "xrGame/game_level_cross_table.h"
16+
#include "xrAICore/Navigation/game_level_cross_table.h"
1717
#include "xrCrossTable.h"
1818
#include "guid_generator.h"
19-
#include "xrGame/graph_engine.h"
19+
#include "xrAICore/Navigation/graph_engine.h"
2020

2121
CGameGraphBuilder::CGameGraphBuilder ()
2222
{

src/utils/xrAI/game_spawn_constructor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include "xrServer_Objects_ALife_All.h"
1414
#include "xrai.h"
1515
#include "server_entity_wrapper.h"
16-
#include "xrGame/graph_engine.h"
17-
#include "xrGame/patrol_path_storage.h"
16+
#include "xrAICore/Navigation/graph_engine.h"
17+
#include "xrAICore/Navigation/PatrolPath/patrol_path_storage.h"
1818

1919
extern LPCSTR GAME_CONFIG;
2020
extern LPCSTR generate_temp_file_name (LPCSTR header0, LPCSTR header1, string_path& buffer);

src/utils/xrAI/game_spawn_constructor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "alife_space.h"
1212
#include "xr_graph_merge.h"
1313
#include "utils/xrLCUtil/xrThread.hpp"
14-
#include "xrGame/graph_abstract.h"
14+
#include "xrAICore/Navigation/graph_abstract.h"
1515
#include "xrServer_Object_Base.h"
1616
#include "spawn_constructor_space.h"
1717
#include "server_entity_wrapper.h"

src/utils/xrAI/level_spawn_constructor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88

99
#include "stdafx.h"
1010
#include "level_spawn_constructor.h"
11-
#include "xrGame/game_level_cross_table.h"
12-
#include "xrGame/level_graph.h"
13-
#include "xrGame/graph_engine.h"
11+
#include "xrAICore/Navigation/game_level_cross_table.h"
12+
#include "xrAICore/Navigation/level_graph.h"
13+
#include "xrAICore/Navigation/graph_engine.h"
1414
#include "xrmessages.h"
1515
#include "xrServer_Objects_ALife_All.h"
1616
#include "factory_api.h"
1717
#include "clsid_game.h"
1818
#include "game_base_space.h"
1919
#include "game_spawn_constructor.h"
20-
#include "xrGame/patrol_path_storage.h"
20+
#include "xrAICore/Navigation/PatrolPath/patrol_path_storage.h"
2121
#include "space_restrictor_wrapper.h"
2222
#include "Common/object_broker.h"
2323
#include "restriction_space.h"

0 commit comments

Comments
 (0)