mirror of https://github.com/OpenTTD/OpenTTD
(svn r24638) -Codechange: add some #ifndefs so MSU code doesn't need to compile it, and doesn't need all the required dependencies
parent
f64d50ec26
commit
9db98f3b14
|
@ -14,13 +14,14 @@
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
#include "../../stdafx.h"
|
#include "../../stdafx.h"
|
||||||
|
#ifndef OPENTTD_MSU
|
||||||
#include "../../textfile_gui.h"
|
#include "../../textfile_gui.h"
|
||||||
#include "../../fileio_func.h"
|
|
||||||
#include "../../newgrf_config.h"
|
#include "../../newgrf_config.h"
|
||||||
#include "../../base_media_base.h"
|
#include "../../base_media_base.h"
|
||||||
#include "../../ai/ai.hpp"
|
#include "../../ai/ai.hpp"
|
||||||
#include "../../game/game.hpp"
|
#include "../../game/game.hpp"
|
||||||
#include "../../fios.h"
|
#include "../../fios.h"
|
||||||
|
#endif /* OPENTTD_MSU */
|
||||||
#include "tcp_content.h"
|
#include "tcp_content.h"
|
||||||
|
|
||||||
/** Clear everything in the struct */
|
/** Clear everything in the struct */
|
||||||
|
@ -93,6 +94,7 @@ bool ContentInfo::IsValid() const
|
||||||
return this->state < ContentInfo::INVALID && this->type >= CONTENT_TYPE_BEGIN && this->type < CONTENT_TYPE_END;
|
return this->state < ContentInfo::INVALID && this->type >= CONTENT_TYPE_BEGIN && this->type < CONTENT_TYPE_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENTTD_MSU
|
||||||
/**
|
/**
|
||||||
* Search a textfile file next to this file in the content list.
|
* Search a textfile file next to this file in the content list.
|
||||||
* @param type The type of the textfile to search for.
|
* @param type The type of the textfile to search for.
|
||||||
|
@ -139,6 +141,7 @@ const char *ContentInfo::GetTextfile(TextfileType type) const
|
||||||
if (tmp == NULL) return NULL;
|
if (tmp == NULL) return NULL;
|
||||||
return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp);
|
return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp);
|
||||||
}
|
}
|
||||||
|
#endif /* OPENTTD_MSU */
|
||||||
|
|
||||||
void NetworkContentSocketHandler::Close()
|
void NetworkContentSocketHandler::Close()
|
||||||
{
|
{
|
||||||
|
@ -217,6 +220,7 @@ bool NetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p) { return this->
|
||||||
bool NetworkContentSocketHandler::Receive_CLIENT_CONTENT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_CLIENT_CONTENT); }
|
bool NetworkContentSocketHandler::Receive_CLIENT_CONTENT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_CLIENT_CONTENT); }
|
||||||
bool NetworkContentSocketHandler::Receive_SERVER_CONTENT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_SERVER_CONTENT); }
|
bool NetworkContentSocketHandler::Receive_SERVER_CONTENT(Packet *p) { return this->ReceiveInvalidPacket(PACKET_CONTENT_SERVER_CONTENT); }
|
||||||
|
|
||||||
|
#ifndef OPENTTD_MSU
|
||||||
/**
|
/**
|
||||||
* Helper to get the subdirectory a #ContentInfo is located in.
|
* Helper to get the subdirectory a #ContentInfo is located in.
|
||||||
* @param type The type of content.
|
* @param type The type of content.
|
||||||
|
@ -242,5 +246,6 @@ Subdirectory GetContentInfoSubDir(ContentType type)
|
||||||
return SCENARIO_DIR;
|
return SCENARIO_DIR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* OPENTTD_MSU */
|
||||||
|
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
|
@ -91,7 +91,9 @@ struct ContentInfo {
|
||||||
size_t Size() const;
|
size_t Size() const;
|
||||||
bool IsSelected() const;
|
bool IsSelected() const;
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
|
#ifndef OPENTTD_MSU
|
||||||
const char *GetTextfile(TextfileType type) const;
|
const char *GetTextfile(TextfileType type) const;
|
||||||
|
#endif /* OPENTTD_MSU */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Base socket handler for all Content TCP sockets */
|
/** Base socket handler for all Content TCP sockets */
|
||||||
|
@ -207,7 +209,9 @@ public:
|
||||||
void ReceivePackets();
|
void ReceivePackets();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef OPENTTD_MSU
|
||||||
Subdirectory GetContentInfoSubDir(ContentType type);
|
Subdirectory GetContentInfoSubDir(ContentType type);
|
||||||
|
#endif /* OPENTTD_MSU */
|
||||||
|
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue