(svn r23384) -Remove: no longer allow a binary to be without AI support; the parts some compilers failed at, are integrated in other parts of the code now too

This commit is contained in:
truebrain
2011-12-01 12:03:34 +00:00
parent fa07d61b84
commit bf803e40cc
23 changed files with 33 additions and 198 deletions

View File

@@ -12,7 +12,6 @@
#ifndef AI_HPP
#define AI_HPP
#ifdef ENABLE_AI
#include "../script/api/script_event_types.hpp"
#include "../date_type.h"
#include "../core/string_compare_type.hpp"
@@ -153,27 +152,4 @@ private:
static class AIScannerLibrary *scanner_library; ///< ScriptScanner instance that is used to find AI Libraries
};
#else /* ENABLE_AI */
#include "../company_type.h"
#define NewEvent(cid, event) nop()
#define BroadcastNewEvent(...) nop()
class AI {
public:
static void StartNew(CompanyID company, bool rerandomise_ai = true) {}
static void Stop(CompanyID company) {}
static void Initialize() {}
static void Uninitialize(bool keepConfig) {}
static void KillAll() {}
static void GameLoop() {}
static bool HasAI(const struct ContentInfo *ci, bool md5sum) { return false; }
static bool HasAILibrary(const struct ContentInfo *ci, bool md5sum) { return false; }
static void Rescan() {}
static char *GetConsoleList(char *p, const char *last, bool newest_only = false) { return p; }
static void nop() { }
};
#endif /* ENABLE_AI */
#endif /* AI_HPP */

View File

@@ -14,22 +14,9 @@
#include "../company_type.h"
#ifdef ENABLE_AI
void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY);
void ShowAIConfigWindow();
void ShowAIDebugWindowIfAIError();
void InitializeAIGui();
#else
#include "../gui.h"
#include "table/strings.h"
static inline void ShowAIConfigWindow()
{
ShowErrorMessage(STR_ERROR_NO_AI, STR_ERROR_NO_AI_SUB, WL_INFO);
}
static inline void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY) {ShowAIConfigWindow();}
static inline void ShowAIDebugWindowIfAIError() {}
static inline void InitializeAIGui() {}
#endif /* ENABLE_AI */
#endif /* AI_GUI_HPP */

View File

@@ -12,8 +12,6 @@
#ifndef AI_INFO_HPP
#define AI_INFO_HPP
#ifdef ENABLE_AI
#include "../script/script_info.hpp"
#include "../script/script_config.hpp"
@@ -84,5 +82,4 @@ private:
const char *category; ///< The category this library is in.
};
#endif /* ENABLE_AI */
#endif /* AI_INFO_HPP */