1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

(svn r17139) -Change: add the concept of sound sets

This commit is contained in:
rubidium
2009-08-09 19:50:44 +00:00
parent 35d5a197d6
commit 9ee2a66c86
21 changed files with 274 additions and 83 deletions

View File

@@ -23,6 +23,7 @@ enum ContentType {
CONTENT_TYPE_AI_LIBRARY = 4, ///< The content consists of an AI library
CONTENT_TYPE_SCENARIO = 5, ///< The content consists of a scenario
CONTENT_TYPE_HEIGHTMAP = 6, ///< The content consists of a heightmap
CONTENT_TYPE_BASE_SOUNDS = 7, ///< The content consists of base sounds
CONTENT_TYPE_END, ///< Helper to mark the end of the types
};

View File

@@ -82,6 +82,10 @@ DEF_CONTENT_RECEIVE_COMMAND(Client, PACKET_CONTENT_SERVER_INFO)
proc = BaseGraphics::HasSet;
break;
case CONTENT_TYPE_BASE_SOUNDS:
proc = BaseSounds::HasSet;
break;
case CONTENT_TYPE_AI:
case CONTENT_TYPE_AI_LIBRARY:
proc = AI::HasAI; break;
@@ -149,6 +153,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentType type)
{
if (type == CONTENT_TYPE_END) {
this->RequestContentList(CONTENT_TYPE_BASE_GRAPHICS);
this->RequestContentList(CONTENT_TYPE_BASE_SOUNDS);
this->RequestContentList(CONTENT_TYPE_SCENARIO);
this->RequestContentList(CONTENT_TYPE_HEIGHTMAP);
this->RequestContentList(CONTENT_TYPE_AI);
@@ -290,6 +295,7 @@ static char *GetFullFilename(const ContentInfo *ci, bool compressed)
switch (ci->type) {
default: return NULL;
case CONTENT_TYPE_BASE_GRAPHICS: dir = DATA_DIR; break;
case CONTENT_TYPE_BASE_SOUNDS: dir = DATA_DIR; break;
case CONTENT_TYPE_NEWGRF: dir = DATA_DIR; break;
case CONTENT_TYPE_AI: dir = AI_DIR; break;
case CONTENT_TYPE_AI_LIBRARY: dir = AI_LIBRARY_DIR; break;

View File

@@ -95,6 +95,10 @@ public:
BaseGraphics::FindSets();
break;
case CONTENT_TYPE_BASE_SOUNDS:
BaseSounds::FindSets();
break;
case CONTENT_TYPE_NEWGRF:
ScanNewGRFFiles();
/* Yes... these are the NewGRF windows */