Skip to content

Commit

Permalink
Small code and dependency cleaning for xrAI.
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr authored and Xottab-DUTY committed Dec 28, 2017
1 parent 810d0ee commit cb29816
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 51 deletions.
24 changes: 4 additions & 20 deletions src/utils/xrAI/StdAfx.h
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
#pragma once

#define ENGINE_API
#define ECORE_API
#define XR_EPROPS_API

#include "Common/Common.hpp"
#include "xrCore/xrCore.h"

#pragma warning(push)
#pragma warning(disable : 4995)
#include <d3dx9.h>
#include <commctrl.h>
#pragma warning(pop)

#define ENGINE_API
#define ECORE_API
#define XR_EPROPS_API
#include "xrCore/clsid.h"
#include "xrCDB/xrCDB.h"
#include "Common/_d3d_extensions.h"

#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <stdio.h>
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
#include "utils/xrLCUtil/xrThread.hpp"

Expand All @@ -36,8 +25,6 @@ extern CThreadManager::ReportProgressFunc ProxyProgress;
#define READ_IF_EXISTS(ltx, method, section, name, default_value)\
(ltx->line_exist(section, name)) ? ltx->method(section, name) : default_value

#undef THROW

#if XRAY_EXCEPTIONS
IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
#define THROW(xpr)\
Expand Down Expand Up @@ -67,6 +54,3 @@ IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
#define THROW2 VERIFY2
#define THROW3 VERIFY3
#endif

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
28 changes: 2 additions & 26 deletions src/utils/xrAI/xrAI.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// xrAI.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "xrCore/xr_ini.h"
#include "process.h"
#include <process.h>
#include "xrAI.h"

#include "xr_graph_merge.h"
Expand All @@ -16,17 +13,8 @@

#pragma comment(linker, "/STACK:0x800000,0x400000")

#pragma comment(lib, "comctl32.lib")
#pragma comment(lib, "d3dx9.lib")
#pragma comment(lib, "IMAGEHLP.LIB")
#pragma comment(lib, "winmm.LIB")
#pragma comment(lib, "xrcdb.LIB")
#pragma comment(lib, "MagicFM.LIB")
#pragma comment(lib, "xrCore.LIB")
#pragma comment(lib, "xrLCUtil.lib")
#pragma comment(lib, "xrAICore.lib")

#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
#include "xrCore/cdecl_cast.hpp"
#include "xrCore/ModuleLookup.hpp"

Expand All @@ -49,14 +37,7 @@ CThreadManager::ReportStatusFunc ProxyStatus = cdecl_cast([](const char* format,
CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast([](float progress) { Logger.Progress(progress); });

extern void xrCompiler(LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name);
extern void test_smooth_path(LPCSTR name);
extern void test_hierarchy(LPCSTR name);
extern void xrConvertMaps();
extern void test_goap();
extern void smart_cover(LPCSTR name);
extern void verify_level_graph(LPCSTR name, bool verbose);
extern void compare_graphs(LPCSTR level_name);
extern void test_levels();

static const char* h_str =
"The following keys are supported / required:\n"
Expand Down Expand Up @@ -190,8 +171,6 @@ void Startup(LPSTR lpCmdLine)

#include "factory_api.h"

#include "xrGame/quadtree.h"

Factory_Create* create_entity = 0;
Factory_Destroy* destroy_entity = 0;

Expand All @@ -200,10 +179,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
xrDebug::Initialize(false);
Core.Initialize("xrai", 0);


constexpr pcstr g_name = "xrSE_Factory";
Log("Loading DLL:", g_name);
const auto hFactory = std::make_unique<XRay::Module>(g_name);
const auto hFactory = std::make_unique<XRay::Module>("xrSE_Factory");

if (!hFactory->exist())
R_CHK(GetLastError());
Expand Down
8 changes: 4 additions & 4 deletions src/utils/xrAI/xrAI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,13 @@
<ProjectReference Include="$(SolutionDir)xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\Externals\MagicFM.vcxproj">
<Project>{848e8ab3-9962-4c04-b813-5690399c8a3e}</Project>
<ProjectReference Include="$(SolutionDir)xrCDB\xrCDB.vcxproj">
<Project>{a19b1df2-82ec-4364-8bdf-85d13a1c89b5}</Project>
</ProjectReference>
<ProjectReference Include="..\xrLCUtil\xrLCUtil.vcxproj">
<ProjectReference Include="$(SolutionDir)Utils\xrLCUtil\xrLCUtil.vcxproj">
<Project>{b90bdc22-a891-4b33-b562-29d701f65dbd}</Project>
</ProjectReference>
<ProjectReference Include="..\xrMiscMath\xrMiscMath.vcxproj">
<ProjectReference Include="$(SolutionDir)Utils\xrMiscMath\xrMiscMath.vcxproj">
<Project>{7885cf3c-ee04-4c67-9467-1fbf9a36b037}</Project>
</ProjectReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/xrServerEntities/xrServer_Objects_ALife.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "restriction_space.h"

#ifdef _MSC_VER
#pragma warning(disable 4100) // unreferenced formal parameter
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
#ifndef AI_COMPILER
#include "character_info.h"
Expand Down

0 comments on commit cb29816

Please sign in to comment.