From 3a923a7a41d5b8b95533bfc040c70fe522534cc2 Mon Sep 17 00:00:00 2001 From: danij Date: Mon, 19 Nov 2012 16:14:13 +0000 Subject: [PATCH] Refactor: Renamed ResourceRecord as MetaFile and moved to filesys --- doomsday/engine/api/dd_share.h | 8 +- doomsday/engine/api/doomsday.h | 6 +- doomsday/engine/engine.pro | 4 +- doomsday/engine/include/de_filesys.h | 1 + doomsday/engine/include/de_resource.h | 1 - .../resourcerecord.h => filesys/metafile.h} | 71 ++++++++-------- doomsday/engine/include/game.h | 41 +++++----- doomsday/engine/src/dd_games.cpp | 18 ++--- doomsday/engine/src/dd_main.cpp | 22 ++--- doomsday/engine/src/def_main.cpp | 6 +- .../metafile.cpp} | 54 ++++++------- doomsday/engine/src/game.cpp | 80 +++++++++---------- doomsday/plugins/jdoom/src/d_api.c | 32 ++++---- doomsday/plugins/jdoom64/src/d_api.c | 4 +- doomsday/plugins/jheretic/src/h_api.c | 12 +-- doomsday/plugins/jhexen/src/x_api.c | 22 ++--- 16 files changed, 190 insertions(+), 192 deletions(-) rename doomsday/engine/include/{resource/resourcerecord.h => filesys/metafile.h} (55%) rename doomsday/engine/src/{resource/resourcerecord.cpp => filesys/metafile.cpp} (80%) diff --git a/doomsday/engine/api/dd_share.h b/doomsday/engine/api/dd_share.h index 56a2098469..2fd1fdf8bf 100644 --- a/doomsday/engine/api/dd_share.h +++ b/doomsday/engine/api/dd_share.h @@ -362,12 +362,12 @@ typedef struct gameinfo_s { void Game_Notify(int notification, void* param); /** - * @defgroup resourceFlags Resource Flags - * @ingroup apiFlags resource + * @defgroup fileFlags File Flags + * @ingroup apiFlags fs */ ///@{ -#define RF_STARTUP 0x1 ///< A required resource needed for and loaded during game start up (can't be a virtual file). -#define RF_FOUND 0x2 ///< Resource has been located. +#define FF_STARTUP 0x1 ///< A required file needed for and loaded during game start up (can't be a virtual file). +#define FF_FOUND 0x2 ///< File has been located. ///@} /** diff --git a/doomsday/engine/api/doomsday.h b/doomsday/engine/api/doomsday.h index 1d89875610..a48865e930 100644 --- a/doomsday/engine/api/doomsday.h +++ b/doomsday/engine/api/doomsday.h @@ -160,8 +160,8 @@ gameid_t DD_GameIdForKey(char const* identityKey); * recent. * * @param game Unique identifier/name of the game. - * @param classId Class of resource being added. - * @param rflags Resource flags (see @ref resourceFlags). + * @param classId Class of resource being defined. + * @param fFlags File flags (see @ref fileFlags). * @param names One or more known potential names, seperated by semicolon * (e.g.,
 "name1;name2" 
). Valid names include * absolute or relative file paths, possibly with encoded @@ -171,7 +171,7 @@ gameid_t DD_GameIdForKey(char const* identityKey); * For package resources this may be C-String containing a * semicolon delimited list of identity keys. */ -void DD_AddGameResource(gameid_t game, fileclassid_t classId, int rflags, +void DD_AddGameResource(gameid_t game, fileclassid_t classId, int fFlags, const char* names, void* params); /** diff --git a/doomsday/engine/engine.pro b/doomsday/engine/engine.pro index 6c4d8f4cea..935b36ca11 100644 --- a/doomsday/engine/engine.pro +++ b/doomsday/engine/engine.pro @@ -188,6 +188,7 @@ DENG_HEADERS += \ include/filesys/fs_util.h \ include/filesys/locator.h \ include/filesys/lumpindex.h \ + include/filesys/metafile.h \ include/filesys/sys_direc.h \ include/filesys/sys_findfile.h \ include/filesys/wad.h \ @@ -306,7 +307,6 @@ DENG_HEADERS += \ include/resource/models.h \ include/resource/pcx.h \ include/resource/r_data.h \ - include/resource/resourcerecord.h \ include/resource/texture.h \ include/resource/textures.h \ include/resource/texturevariant.h \ @@ -475,6 +475,7 @@ SOURCES += \ src/filesys/fs_util.cpp \ src/filesys/locator.cpp \ src/filesys/lumpindex.cpp \ + src/filesys/metafile.cpp \ src/filesys/sys_direc.c \ src/filesys/wad.cpp \ src/filesys/zip.cpp \ @@ -588,7 +589,6 @@ SOURCES += \ src/resource/models.cpp \ src/resource/pcx.c \ src/resource/r_data.c \ - src/resource/resourcerecord.cpp \ src/resource/texture.cpp \ src/resource/textures.cpp \ src/resource/texturevariant.cpp \ diff --git a/doomsday/engine/include/de_filesys.h b/doomsday/engine/include/de_filesys.h index a96c84201e..882e067f63 100644 --- a/doomsday/engine/include/de_filesys.h +++ b/doomsday/engine/include/de_filesys.h @@ -34,6 +34,7 @@ #include "filesys/fs_util.h" #include "filesys/locator.h" #include "filesys/lumpindex.h" +#include "filesys/metafile.h" #include "filesys/sys_direc.h" #include "filesys/sys_findfile.h" #include "filesys/wad.h" diff --git a/doomsday/engine/include/de_resource.h b/doomsday/engine/include/de_resource.h index 9967d5a1fc..76af69d564 100644 --- a/doomsday/engine/include/de_resource.h +++ b/doomsday/engine/include/de_resource.h @@ -30,6 +30,5 @@ #include "resource/font.h" #include "resource/fonts.h" #include "resource/models.h" -#include "resource/resourcerecord.h" #endif /* LIBDENG_RESOURCE_SUBSYSTEM_H */ diff --git a/doomsday/engine/include/resource/resourcerecord.h b/doomsday/engine/include/filesys/metafile.h similarity index 55% rename from doomsday/engine/include/resource/resourcerecord.h rename to doomsday/engine/include/filesys/metafile.h index a52acc249a..6540f84be9 100644 --- a/doomsday/engine/include/resource/resourcerecord.h +++ b/doomsday/engine/include/filesys/metafile.h @@ -1,11 +1,10 @@ /** - * @file resourcerecord.h + * @file metafile.h * - * Resource Record. - * - * @ingroup resource + * Metafile. @ingroup fs * * @author Copyright © 2010-2012 Daniel Swanson + * @author Copyright © 2010-2012 Jaakko Keränen * * @par License * GPL: http://www.gnu.org/licenses/gpl.html @@ -22,8 +21,8 @@ * 02110-1301 USA */ -#ifndef LIBDENG_RESOURCERECORD_H -#define LIBDENG_RESOURCERECORD_H +#ifndef LIBDENG_METAFILE_H +#define LIBDENG_METAFILE_H #ifdef __cplusplus @@ -35,79 +34,79 @@ namespace de { /** - * Stores high-level metadata for and manages a logical resource. + * Stores high-level metadata for and manages a logical file resource. * * @ingroup core */ - class ResourceRecord + class MetaFile { public: /** - * @param rClass Class of resource. - * @param rFlags @ref resourceFlags - * @param name An expected name for the associated resource. + * @param fClass Class of file. + * @param fFlags @ref fileFlags + * @param name An expected name for the associated file. */ - ResourceRecord(fileclassid_t rClass, int rFlags, String* name = 0); - ~ResourceRecord(); + MetaFile(fileclassid_t fClass, int fFlags, String* name = 0); + ~MetaFile(); - /// @return Class of resource. + /// @return Class of file. fileclassid_t fileClass() const; - /// @return Flags for this resource. - int resourceFlags() const; + /// @return Flags for this file. + int fileFlags() const; - /// @return List of "identity keys" used to identify the resource. + /// @return List of "identity keys" used to identify the file. QStringList const& identityKeys() const; - /// @return List of names for the associated resource. + /// @return List of names for the associated file. QStringList const& names() const; /** - * Attempt to locate this resource by systematically resolving and then + * Attempt to locate this file by systematically resolving and then * checking each search path. */ - ResourceRecord& locateResource(); + MetaFile& locateFile(); /** - * "Forget" the currently located resource if one has been found. + * "Forget" the currently located file if one has been found. */ - ResourceRecord& forgetResource(); + MetaFile& forgetFile(); /** - * Attempt to resolve a path to (and maybe locate) this resource. + * Attempt to resolve a path to (and maybe locate) this file. * - * @param tryLocate Attempt to locate the resource now. + * @param tryLocate @c true= Attempt to locate the file now. * - * @return Path to the found resource or an empty string. + * @return Path to the found file or an empty string. * - * @see locateResource() + * @see locateFile() */ String const& resolvedPath(bool tryLocate = true); /** - * Add a new sub-resource identity key to the list for this record. + * Add a new file segment identity key to the list for this metafile. * * @param newIdentityKey New identity key (e.g., a lump/file name). * @param didAdd If not @c =0, the outcome will be written here. */ - ResourceRecord& addIdentityKey(String newIdentityKey, bool* didAdd = 0); + MetaFile& addIdentityKey(String newIdentityKey, bool* didAdd = 0); /** - * Add a new resource name to the list of names for this record. + * Add a new file name to the list of names for this metafile. * - * @param newName New name for this resource. Newer names have precedence. + * @param newName New name for this file. Newer names have precedence. * @param didAdd If not @c =0, the outcome will be written here. */ - ResourceRecord& addName(String newName, bool* didAdd = 0); + MetaFile& addName(String newName, bool* didAdd = 0); /** - * Print information about a resource to the console. + * Print information about a file to the console. * - * @param record Record for the resource. + * @param metafile Metafile for the file. * @param showStatus @c true = print loaded/located status for the - * associated resource. + * associated file. */ - static void consolePrint(ResourceRecord& record, bool showStatus = true); + static void consolePrint(MetaFile& metafile, bool showStatus = true); private: struct Instance; @@ -118,4 +117,4 @@ namespace de #endif // __cplusplus -#endif /* LIBDENG_RESOURCERECORD_H */ +#endif /* LIBDENG_METAFILE_H */ diff --git a/doomsday/engine/include/game.h b/doomsday/engine/include/game.h index 6d48a75d04..491c876fdd 100644 --- a/doomsday/engine/include/game.h +++ b/doomsday/engine/include/game.h @@ -44,7 +44,7 @@ extern "C" { #define PGF_EVERYTHING (PGF_BANNER|PGF_STATUS|PGF_LIST_STARTUP_RESOURCES|PGF_LIST_OTHER_RESOURCES) ///@} -struct resourcerecord_s; +struct metafile_s; struct gamedef_s; #ifdef __cplusplus @@ -57,8 +57,8 @@ struct gamedef_s; namespace de { -class ResourceRecord; class File1; +class MetaFile; class GameCollection; /** @@ -70,7 +70,7 @@ class GameCollection; class Game { public: - typedef QMultiMap Resources; + typedef QMultiMap MetaFiles; public: /** @@ -111,21 +111,20 @@ class Game Game& setPluginId(pluginid_t newId); /** - * Add a new resource to the list of resources. + * Add a new metafile to the list of metafiles. * - * @note Resource registration order defines the order in which resources of each - * type are loaded. + * @note Registration order defines load order (among files of the same class). * - * @param record ResourceRecord to add. + * @param metafile MetaFile to add. */ - Game& addResource(ResourceRecord& record); + Game& addMetafile(MetaFile& metafile); - bool allStartupResourcesFound() const; + bool allStartupFilesFound() const; /** - * Provides access to resources for efficent traversals. + * Provides access to the metafiles for efficent traversals. */ - Resources const& resources() const; + MetaFiles const& metafiles() const; /** * Is @a file required by this game? This decision is made by comparing the @@ -159,15 +158,15 @@ class Game static void printBanner(Game const& game); /** - * Print the list of resources for @a Game. + * Print the list of resource files for @a Game. * - * @param game Game to list resources of. - * @param rflags Only consider resources whose @ref resourceFlags match + * @param game Game to list the files of. + * @param rflags Only consider files whose @ref fileFlags match * this value. If @c <0 the flags are ignored. * @param printStatus @c true to include the current availability/load status - * of each resource. + * of each file. */ - static void printResources(Game const& game, int rflags, bool printStatus = true); + static void printFiles(Game const& game, int rflags, bool printStatus = true); /** * Print extended information about game @a info. @@ -194,7 +193,7 @@ class NullGame : public Game public: NullGame(); - Game& addResource(struct resourcerecord_s& /*record*/) { + Game& addMetafile(struct metafile_s& /*record*/) { throw NullObjectError("NullGame::addResource", "Invalid action on null-object"); } @@ -202,11 +201,11 @@ class NullGame : public Game return false; // Never. } - bool allStartupResourcesFound() const { + bool allStartupFilesFound() const { return true; // Always. } - struct resourcerecord_s* const* resources(fileclassid_t /*classId*/, int* /*count*/) const { + struct metafile_s* const* metafiles(fileclassid_t /*classId*/, int* /*count*/) const { return 0; } @@ -238,9 +237,9 @@ void Game_Delete(Game* game); boolean Game_IsNullObject(Game const* game); -struct game_s* Game_AddResource(Game* game, struct resourcerecord_s* record); +struct game_s* Game_AddMetafile(Game* game, struct metafile_s* record); -boolean Game_AllStartupResourcesFound(Game const* game); +boolean Game_AllStartupFilesFound(Game const* game); Game* Game_SetPluginId(Game* game, pluginid_t pluginId); diff --git a/doomsday/engine/src/dd_games.cpp b/doomsday/engine/src/dd_games.cpp index c171d3d541..fb5504a36d 100644 --- a/doomsday/engine/src/dd_games.cpp +++ b/doomsday/engine/src/dd_games.cpp @@ -25,7 +25,7 @@ #include "de_filesys.h" #include "dd_games.h" -#include "resource/resourcerecord.h" +#include "filesys/metafile.h" #include "filesys/zip.h" namespace de { @@ -103,7 +103,7 @@ int GameCollection::numPlayable() const DENG2_FOR_EACH_CONST(Games, i, d->games) { Game* game = *i; - if(!game->allStartupResourcesFound()) continue; + if(!game->allStartupFilesFound()) continue; ++count; } return count; @@ -114,7 +114,7 @@ Game* GameCollection::firstPlayable() const DENG2_FOR_EACH_CONST(Games, i, d->games) { Game* game = *i; - if(game->allStartupResourcesFound()) return game; + if(game->allStartupFilesFound()) return game; } return NULL; } @@ -198,14 +198,14 @@ GameCollection& GameCollection::locateStartupResources(Game& game) F_ResetAllFileNamespaces(); } - DENG2_FOR_EACH_CONST(Game::Resources, i, game.resources()) + DENG2_FOR_EACH_CONST(Game::MetaFiles, i, game.metafiles()) { - ResourceRecord& record = **i; + MetaFile& record = **i; // We are only interested in startup resources at this time. - if(!(record.resourceFlags() & RF_STARTUP)) continue; + if(!(record.fileFlags() & FF_STARTUP)) continue; - record.locateResource(); + record.locateFile(); } if(d->currentGame != oldGame) @@ -275,11 +275,11 @@ D_CMD(ListGames) de::Game* game = i->game; Con_Printf(" %s %-16s %s (%s)\n", games->isCurrentGame(*game)? "*" : - !game->allStartupResourcesFound()? "!" : " ", + !game->allStartupFilesFound()? "!" : " ", Str_Text(&game->identityKey()), Str_Text(&game->title()), Str_Text(&game->author())); - if(game->allStartupResourcesFound()) + if(game->allStartupFilesFound()) numCompleteGames++; } diff --git a/doomsday/engine/src/dd_main.cpp b/doomsday/engine/src/dd_main.cpp index c6a9017a46..fdc1e7c7f2 100644 --- a/doomsday/engine/src/dd_main.cpp +++ b/doomsday/engine/src/dd_main.cpp @@ -370,7 +370,7 @@ boolean DD_ExchangeGamePluginEntryPoints(pluginid_t pluginId) return true; } -static void loadResource(ResourceRecord& record) +static void loadResource(MetaFile& record) { DENG_ASSERT(record.fileClass() == FC_PACKAGE); @@ -451,13 +451,13 @@ static int DD_LoadGameStartupResourcesWorker(void* parameters) */ Con_Message("Loading game resources%s\n", verbose >= 1? ":" : "..."); - de::Game::Resources const& gameResources = games->currentGame().resources(); - int const numPackages = gameResources.count(FC_PACKAGE); + de::Game::MetaFiles const& gameMetafiles = games->currentGame().metafiles(); + int const numPackages = gameMetafiles.count(FC_PACKAGE); int packageIdx = 0; - for(de::Game::Resources::const_iterator i = gameResources.find(FC_PACKAGE); - i != gameResources.end() && i.key() == FC_PACKAGE; ++i, ++packageIdx) + for(de::Game::MetaFiles::const_iterator i = gameMetafiles.find(FC_PACKAGE); + i != gameMetafiles.end() && i.key() == FC_PACKAGE; ++i, ++packageIdx) { - ResourceRecord& record = **i; + MetaFile& record = **i; loadResource(record); // Update our progress. @@ -851,8 +851,8 @@ void DD_AddGameResource(gameid_t gameId, fileclassid_t classId, int rflags, // Construct and attach the new resource record. de::Game& game = games->byId(gameId); - ResourceRecord* record = new ResourceRecord(classId, rflags); - game.addResource(*record); + MetaFile* record = new MetaFile(classId, rflags); + game.addMetafile(*record); // Add the name list to the resource record. QStringList nameList = String(names).split(";", QString::SkipEmptyParts); @@ -1201,7 +1201,7 @@ de::Game* DD_AutoselectGame(void) try { de::Game& game = games->byIdentityKey(identityKey); - if(game.allStartupResourcesFound()) + if(game.allStartupFilesFound()) { return &game; } @@ -2266,10 +2266,10 @@ D_CMD(Load) try { de::Game& game = games->byIdentityKey(Str_Text(&searchPath)); - if(!game.allStartupResourcesFound()) + if(!game.allStartupFilesFound()) { Con_Message("Failed to locate all required startup resources:\n"); - de::Game::printResources(game, RF_STARTUP); + de::Game::printFiles(game, FF_STARTUP); Con_Message("%s (%s) cannot be loaded.\n", Str_Text(&game.title()), Str_Text(&game.identityKey())); Str_Free(&searchPath); return true; diff --git a/doomsday/engine/src/def_main.cpp b/doomsday/engine/src/def_main.cpp index cf157d9f7f..2e12bdda1e 100644 --- a/doomsday/engine/src/def_main.cpp +++ b/doomsday/engine/src/def_main.cpp @@ -844,12 +844,12 @@ static void readAllDefinitions(void) // Now any definition files required by the game on load. if(DD_GameLoaded()) { - de::Game::Resources const& gameResources = reinterpret_cast(App_CurrentGame())->resources(); + de::Game::MetaFiles const& gameResources = reinterpret_cast(App_CurrentGame())->metafiles(); int packageIdx = 0; - for(de::Game::Resources::const_iterator i = gameResources.find(FC_DEFINITION); + for(de::Game::MetaFiles::const_iterator i = gameResources.find(FC_DEFINITION); i != gameResources.end() && i.key() == FC_DEFINITION; ++i, ++packageIdx) { - de::ResourceRecord& record = **i; + de::MetaFile& record = **i; /// Try to locate this resource now. QString const& path = record.resolvedPath(true/*try to locate*/); diff --git a/doomsday/engine/src/resource/resourcerecord.cpp b/doomsday/engine/src/filesys/metafile.cpp similarity index 80% rename from doomsday/engine/src/resource/resourcerecord.cpp rename to doomsday/engine/src/filesys/metafile.cpp index a028e5136f..75de64eb7d 100644 --- a/doomsday/engine/src/resource/resourcerecord.cpp +++ b/doomsday/engine/src/filesys/metafile.cpp @@ -25,18 +25,18 @@ #include "de_base.h" #include "de_console.h" #include "de_filesys.h" -#include "filesys/zip.h" -#include "resource/resourcerecord.h" +#include "filesys/zip.h" +#include "filesys/metafile.h" namespace de { -struct ResourceRecord::Instance +struct MetaFile::Instance { /// Class of resource. fileclassid_t classId; - /// @see resourceFlags. + /// @see fileFlags. int flags; /// Potential names for this resource. In precedence order - high (newest) to lowest. @@ -46,7 +46,7 @@ struct ResourceRecord::Instance /// Used for identification purposes. QStringList identityKeys; - /// Index (in ResourceRecord::Instance::names) of the name used to locate + /// Index (in MetaFile::Instance::names) of the name used to locate /// this resource if found. Set during resource location. int foundNameIndex; @@ -55,23 +55,23 @@ struct ResourceRecord::Instance String foundPath; Instance(fileclassid_t _rclass, int rflags) - : classId(_rclass), flags(rflags & ~RF_FOUND), names(), + : classId(_rclass), flags(rflags & ~FF_FOUND), names(), identityKeys(), foundNameIndex(-1), foundPath() {} }; -ResourceRecord::ResourceRecord(fileclassid_t classId, int rflags, String* name) +MetaFile::MetaFile(fileclassid_t fClass, int fFlags, String* name) { - d = new Instance(classId, rflags); + d = new Instance(fClass, fFlags); if(name) addName(*name); } -ResourceRecord::~ResourceRecord() +MetaFile::~MetaFile() { delete d; } -ResourceRecord& ResourceRecord::addName(String newName, bool* didAdd) +MetaFile& MetaFile::addName(String newName, bool* didAdd) { // Is this name unique? We don't want duplicates. if(newName.isEmpty() || d->names.contains(newName, Qt::CaseInsensitive)) @@ -87,7 +87,7 @@ ResourceRecord& ResourceRecord::addName(String newName, bool* didAdd) return *this; } -ResourceRecord& ResourceRecord::addIdentityKey(String newIdentityKey, bool* didAdd) +MetaFile& MetaFile::addIdentityKey(String newIdentityKey, bool* didAdd) { // Is this key unique? We don't want duplicates. if(newIdentityKey.isEmpty() || d->identityKeys.contains(newIdentityKey, Qt::CaseInsensitive)) @@ -154,10 +154,10 @@ static bool recognizeZIP(String const& filePath, QStringList const& /*identityKe return false; } -ResourceRecord& ResourceRecord::locateResource() +MetaFile& MetaFile::locateFile() { // Already found? - if(d->flags & RF_FOUND) return *this; + if(d->flags & FF_FOUND) return *this; // Perform the search. AutoStr* found = AutoStr_NewStd(); @@ -190,7 +190,7 @@ ResourceRecord& ResourceRecord::locateResource() if(!validated) continue; // This is the resource we've been looking for. - d->flags |= RF_FOUND; + d->flags |= FF_FOUND; d->foundPath = foundPath; d->foundNameIndex = nameIndex; break; @@ -199,50 +199,50 @@ ResourceRecord& ResourceRecord::locateResource() return *this; } -ResourceRecord& ResourceRecord::forgetResource() +MetaFile& MetaFile::forgetFile() { - if(d->flags & RF_FOUND) + if(d->flags & FF_FOUND) { d->foundPath.clear(); d->foundNameIndex = -1; - d->flags &= ~RF_FOUND; + d->flags &= ~FF_FOUND; } return *this; } -String const& ResourceRecord::resolvedPath(bool tryLocate) +String const& MetaFile::resolvedPath(bool tryLocate) { if(tryLocate) { - locateResource(); + locateFile(); } return d->foundPath; } -fileclassid_t ResourceRecord::fileClass() const +fileclassid_t MetaFile::fileClass() const { return d->classId; } -int ResourceRecord::resourceFlags() const +int MetaFile::fileFlags() const { return d->flags; } -QStringList const& ResourceRecord::identityKeys() const +QStringList const& MetaFile::identityKeys() const { return d->identityKeys; } -QStringList const& ResourceRecord::names() const +QStringList const& MetaFile::names() const { return d->names; } -void ResourceRecord::consolePrint(ResourceRecord& record, bool showStatus) +void MetaFile::consolePrint(MetaFile& metafile, bool showStatus) { - QByteArray names = record.names().join(";").toUtf8(); - bool const resourceFound = !!(record.resourceFlags() & RF_FOUND); + QByteArray names = metafile.names().join(";").toUtf8(); + bool const resourceFound = !!(metafile.fileFlags() & FF_FOUND); if(showStatus) Con_Printf("%s", !resourceFound? " ! ":" "); @@ -251,7 +251,7 @@ void ResourceRecord::consolePrint(ResourceRecord& record, bool showStatus) if(showStatus) { - QByteArray foundPath = resourceFound? record.resolvedPath(false/*don't try to locate*/).toUtf8() : QByteArray(""); + QByteArray foundPath = resourceFound? metafile.resolvedPath(false/*don't try to locate*/).toUtf8() : QByteArray(""); Con_Printf(" %s%s", !resourceFound? "- missing" : "- found ", F_PrettyPath(foundPath.constData())); } Con_Printf("\n"); diff --git a/doomsday/engine/src/game.cpp b/doomsday/engine/src/game.cpp index c7fa72280d..d029117006 100644 --- a/doomsday/engine/src/game.cpp +++ b/doomsday/engine/src/game.cpp @@ -26,7 +26,7 @@ #include "de_filesys.h" #include "updater/downloaddialog.h" -#include "resource/resourcerecord.h" +#include "filesys/metafile.h" #include #include @@ -40,8 +40,8 @@ struct Game::Instance /// Unique identifier of the plugin which registered this game. pluginid_t pluginId; - /// Records for required game resources (e.g., doomu.wad). - Game::Resources resources; + /// Records for required game files (e.g., doomu.wad). + Game::MetaFiles metafiles; /// Unique identifier string (e.g., "doom1-ultimate"). ddstring_t identityKey; @@ -59,7 +59,7 @@ struct Game::Instance ddstring_t bindingConfig; Instance(char const* _identityKey, char const* configDir) - : pluginId(0), resources() + : pluginId(0), metafiles() { Str_Set(Str_InitStd(&identityKey), _identityKey); DENG_ASSERT(!Str_IsEmpty(&identityKey)); @@ -82,10 +82,10 @@ struct Game::Instance ~Instance() { - DENG2_FOR_EACH(Game::Resources, i, resources) + DENG2_FOR_EACH(Game::MetaFiles, i, metafiles) { - ResourceRecord* record = *i; - delete record; + MetaFile* metafile = *i; + delete metafile; } Str_Free(&identityKey); @@ -114,25 +114,25 @@ GameCollection& Game::collection() const return *reinterpret_cast(App_GameCollection()); } -Game& Game::addResource(ResourceRecord& record) +Game& Game::addMetafile(MetaFile& metafile) { // Ensure we don't add duplicates. - Resources::const_iterator found = d->resources.find(record.fileClass(), &record); - if(found == d->resources.end()) + MetaFiles::const_iterator found = d->metafiles.find(metafile.fileClass(), &metafile); + if(found == d->metafiles.end()) { - d->resources.insert(record.fileClass(), &record); + d->metafiles.insert(metafile.fileClass(), &metafile); } return *this; } -bool Game::allStartupResourcesFound() const +bool Game::allStartupFilesFound() const { - DENG2_FOR_EACH_CONST(Resources, i, d->resources) + DENG2_FOR_EACH_CONST(MetaFiles, i, d->metafiles) { - ResourceRecord& record = **i; - int const flags = record.resourceFlags(); + MetaFile& metafile = **i; + int const flags = metafile.fileFlags(); - if((flags & RF_STARTUP) && !(flags & RF_FOUND)) + if((flags & FF_STARTUP) && !(flags & FF_FOUND)) return false; } return true; @@ -174,9 +174,9 @@ ddstring_t const& Game::author() const return d->author; } -Game::Resources const& Game::resources() const +Game::MetaFiles const& Game::metafiles() const { - return d->resources; + return d->metafiles; } bool Game::isRequiredFile(File1& file) @@ -190,13 +190,13 @@ bool Game::isRequiredFile(File1& file) bool isRequired = false; - for(Resources::const_iterator i = d->resources.find(FC_PACKAGE); - i != d->resources.end() && i.key() == FC_PACKAGE; ++i) + for(MetaFiles::const_iterator i = d->metafiles.find(FC_PACKAGE); + i != d->metafiles.end() && i.key() == FC_PACKAGE; ++i) { - ResourceRecord& record = **i; - if(!(record.resourceFlags() & RF_STARTUP)) continue; + MetaFile& metafile = **i; + if(!(metafile.fileFlags() & FF_STARTUP)) continue; - if(!record.resolvedPath(true/*try locate*/).compare(absolutePath, Qt::CaseInsensitive)) + if(!metafile.resolvedPath(true/*try locate*/).compare(absolutePath, Qt::CaseInsensitive)) { isRequired = true; break; @@ -218,22 +218,22 @@ void Game::printBanner(Game const& game) Con_PrintRuler(); } -void Game::printResources(Game const& game, int rflags, bool printStatus) +void Game::printFiles(Game const& game, int rflags, bool printStatus) { int numPrinted = 0; // Group output by resource class. - Resources const& resources = game.resources(); + MetaFiles const& metafiles = game.metafiles(); for(uint i = 0; i < FILECLASS_COUNT; ++i) { fileclassid_t const classId = fileclassid_t(i); - for(Resources::const_iterator i = resources.find(classId); - i != resources.end() && i.key() == classId; ++i) + for(MetaFiles::const_iterator i = metafiles.find(classId); + i != metafiles.end() && i.key() == classId; ++i) { - ResourceRecord& record = **i; - if(rflags >= 0 && (rflags & record.resourceFlags())) + MetaFile& metafile = **i; + if(rflags >= 0 && (rflags & metafile.fileFlags())) { - ResourceRecord::consolePrint(record, printStatus); + MetaFile::consolePrint(metafile, printStatus); numPrinted += 1; } } @@ -267,21 +267,21 @@ void Game::print(Game const& game, int flags) if(flags & PGF_LIST_STARTUP_RESOURCES) { Con_Printf("Startup resources:\n"); - printResources(game, RF_STARTUP, (flags & PGF_STATUS) != 0); + printFiles(game, FF_STARTUP, (flags & PGF_STATUS) != 0); } if(flags & PGF_LIST_OTHER_RESOURCES) { Con_Printf("Other resources:\n"); Con_Printf(" "); - printResources(game, 0, /*(flags & PGF_STATUS) != 0*/false); + printFiles(game, 0, /*(flags & PGF_STATUS) != 0*/false); } if(flags & PGF_STATUS) Con_Printf("Status: %s\n", game.collection().isCurrentGame(game)? "Loaded" : - game.allStartupResourcesFound()? "Complete/Playable" : - "Incomplete/Not playable"); + game.allStartupFilesFound()? "Complete/Playable" : + "Incomplete/Not playable"); } NullGame::NullGame() @@ -329,18 +329,18 @@ boolean Game_IsNullObject(Game const* game) return de::isNullGame(*reinterpret_cast(game)); } -struct game_s* Game_AddResource(struct game_s* game, struct resourcerecord_s* record) +struct game_s* Game_AddMetafile(struct game_s* game, struct metafile_s* metafile) { SELF(game); - DENG_ASSERT(record); - self->addResource(reinterpret_cast(*record)); + DENG_ASSERT(metafile); + self->addMetafile(reinterpret_cast(*metafile)); return game; } -boolean Game_AllStartupResourcesFound(struct game_s const* game) +boolean Game_AllStartupFilesFound(struct game_s const* game) { SELF_CONST(game); - return self->allStartupResourcesFound(); + return self->allStartupFilesFound(); } struct game_s* Game_SetPluginId(struct game_s* game, pluginid_t pluginId) @@ -400,7 +400,7 @@ void Game_PrintBanner(Game const* game) void Game_PrintResources(Game const* game, boolean printStatus, int rflags) { if(!game) return; - de::Game::printResources(*reinterpret_cast(game), rflags, CPP_BOOL(printStatus)); + de::Game::printFiles(*reinterpret_cast(game), rflags, CPP_BOOL(printStatus)); } void Game_Print(Game const* game, int flags) diff --git a/doomsday/plugins/jdoom/src/d_api.c b/doomsday/plugins/jdoom/src/d_api.c index 58f9d3090c..42eae6fe58 100644 --- a/doomsday/plugins/jdoom/src/d_api.c +++ b/doomsday/plugins/jdoom/src/d_api.c @@ -97,50 +97,50 @@ int G_RegisterGames(int hookType, int param, void* data) /* HacX */ gameIds[doom2_hacx] = DD_DefineGame(&hacxDef); - DD_AddGameResource(GID(doom2_hacx), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom2_hacx), FC_PACKAGE, RF_STARTUP, "hacx.wad", "HACX-R;PLAYPAL"); + DD_AddGameResource(GID(doom2_hacx), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2_hacx), FC_PACKAGE, FF_STARTUP, "hacx.wad", "HACX-R;PLAYPAL"); DD_AddGameResource(GID(doom2_hacx), FC_DEFINITION, 0, "hacx.ded", 0); /* Chex Quest */ gameIds[doom_chex] = DD_DefineGame(&chexDef); - DD_AddGameResource(GID(doom_chex), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom_chex), FC_PACKAGE, RF_STARTUP, "chex.wad", "E1M1;E4M1;_DEUTEX_;POSSH0M0"); + DD_AddGameResource(GID(doom_chex), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom_chex), FC_PACKAGE, FF_STARTUP, "chex.wad", "E1M1;E4M1;_DEUTEX_;POSSH0M0"); DD_AddGameResource(GID(doom_chex), FC_DEFINITION, 0, "chex.ded", 0); /* DOOM2 (TNT) */ gameIds[doom2_tnt] = DD_DefineGame(&doom2TntDef); - DD_AddGameResource(GID(doom2_tnt), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom2_tnt), FC_PACKAGE, RF_STARTUP, "tnt.wad", "CAVERN5;CAVERN7;STONEW1"); + DD_AddGameResource(GID(doom2_tnt), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2_tnt), FC_PACKAGE, FF_STARTUP, "tnt.wad", "CAVERN5;CAVERN7;STONEW1"); DD_AddGameResource(GID(doom2_tnt), FC_DEFINITION, 0, "doom2-tnt.ded", 0); /* DOOM2 (Plutonia) */ gameIds[doom2_plut] = DD_DefineGame(&doom2PlutDef); - DD_AddGameResource(GID(doom2_plut), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom2_plut), FC_PACKAGE, RF_STARTUP, "plutonia.wad", "_DEUTEX_;MAP01;MAP25;MC5;MC11;MC16;MC20"); + DD_AddGameResource(GID(doom2_plut), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2_plut), FC_PACKAGE, FF_STARTUP, "plutonia.wad", "_DEUTEX_;MAP01;MAP25;MC5;MC11;MC16;MC20"); DD_AddGameResource(GID(doom2_plut), FC_DEFINITION, 0, "doom2-plut.ded", 0); /* DOOM2 */ gameIds[doom2] = DD_DefineGame(&doom2Def); - DD_AddGameResource(GID(doom2), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom2), FC_PACKAGE, RF_STARTUP, "doom2f.wad;doom2.wad", "MAP01;MAP02;MAP03;MAP04;MAP10;MAP20;MAP25;MAP30;VILEN1;VILEO1;VILEQ1;GRNROCK"); + DD_AddGameResource(GID(doom2), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2), FC_PACKAGE, FF_STARTUP, "doom2f.wad;doom2.wad", "MAP01;MAP02;MAP03;MAP04;MAP10;MAP20;MAP25;MAP30;VILEN1;VILEO1;VILEQ1;GRNROCK"); DD_AddGameResource(GID(doom2), FC_DEFINITION, 0, "doom2.ded", 0); /* DOOM (Ultimate) */ gameIds[doom_ultimate] = DD_DefineGame(&doomUltimateDef); - DD_AddGameResource(GID(doom_ultimate), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom_ultimate), FC_PACKAGE, RF_STARTUP, "doomu.wad;doom.wad", "E4M1;E4M2;E4M3;E4M4;E4M5;E4M6;E4M7;E4M8;E4M9;M_EPI4"); + DD_AddGameResource(GID(doom_ultimate), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom_ultimate), FC_PACKAGE, FF_STARTUP, "doomu.wad;doom.wad", "E4M1;E4M2;E4M3;E4M4;E4M5;E4M6;E4M7;E4M8;E4M9;M_EPI4"); DD_AddGameResource(GID(doom_ultimate), FC_DEFINITION, 0, "doom1-ultimate.ded", 0); /* DOOM */ gameIds[doom] = DD_DefineGame(&doomDef); - DD_AddGameResource(GID(doom), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom), FC_PACKAGE, RF_STARTUP, "doom.wad", "E2M1;E2M2;E2M3;E2M4;E2M5;E2M6;E2M7;E2M8;E2M9;E3M1;E3M2;E3M3;E3M4;E3M5;E3M6;E3M7;E3M8;E3M9;CYBRE1;CYBRD8;FLOOR7_2"); + DD_AddGameResource(GID(doom), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom), FC_PACKAGE, FF_STARTUP, "doom.wad", "E2M1;E2M2;E2M3;E2M4;E2M5;E2M6;E2M7;E2M8;E2M9;E3M1;E3M2;E3M3;E3M4;E3M5;E3M6;E3M7;E3M8;E3M9;CYBRE1;CYBRD8;FLOOR7_2"); DD_AddGameResource(GID(doom), FC_DEFINITION, 0, "doom1.ded", 0); /* DOOM (Shareware) */ gameIds[doom_shareware] = DD_DefineGame(&doomShareDef); - DD_AddGameResource(GID(doom_shareware), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom_shareware), FC_PACKAGE, RF_STARTUP, "doom1.wad", "E1M1;E1M2;E1M3;E1M4;E1M5;E1M6;E1M7;E1M8;E1M9;D_E1M1;FLOOR4_8;FLOOR7_2"); + DD_AddGameResource(GID(doom_shareware), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom_shareware), FC_PACKAGE, FF_STARTUP, "doom1.wad", "E1M1;E1M2;E1M3;E1M4;E1M5;E1M6;E1M7;E1M8;E1M9;D_E1M1;FLOOR4_8;FLOOR7_2"); DD_AddGameResource(GID(doom_shareware), FC_DEFINITION, 0, "doom1-share.ded", 0); return true; diff --git a/doomsday/plugins/jdoom64/src/d_api.c b/doomsday/plugins/jdoom64/src/d_api.c index 784247802b..fccb0402b7 100644 --- a/doomsday/plugins/jdoom64/src/d_api.c +++ b/doomsday/plugins/jdoom64/src/d_api.c @@ -74,8 +74,8 @@ int G_RegisterGames(int hookType, int param, void* data) DENG_UNUSED(hookType); DENG_UNUSED(param); DENG_UNUSED(data); gameIds[doom64] = DD_DefineGame(&doom64Def); - DD_AddGameResource(GID(doom64), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(doom64), FC_PACKAGE, RF_STARTUP, "doom64.wad", "MAP01;MAP020;MAP38;F_SUCK"); + DD_AddGameResource(GID(doom64), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom64), FC_PACKAGE, FF_STARTUP, "doom64.wad", "MAP01;MAP020;MAP38;F_SUCK"); DD_AddGameResource(GID(doom64), FC_DEFINITION, 0, PLUGIN_NAMETEXT ".ded", 0); return true; diff --git a/doomsday/plugins/jheretic/src/h_api.c b/doomsday/plugins/jheretic/src/h_api.c index 1e425a6443..02772a62ba 100644 --- a/doomsday/plugins/jheretic/src/h_api.c +++ b/doomsday/plugins/jheretic/src/h_api.c @@ -84,20 +84,20 @@ int G_RegisterGames(int hookType, int param, void* data) /* Heretic (Extended) */ gameIds[heretic_extended] = DD_DefineGame(&hereticExtDef); - DD_AddGameResource(GID(heretic_extended), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(heretic_extended), FC_PACKAGE, RF_STARTUP, "heretic.wad", "EXTENDED;E5M2;E5M7;E6M2;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); + DD_AddGameResource(GID(heretic_extended), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(heretic_extended), FC_PACKAGE, FF_STARTUP, "heretic.wad", "EXTENDED;E5M2;E5M7;E6M2;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); DD_AddGameResource(GID(heretic_extended), FC_DEFINITION, 0, "heretic-ext.ded", 0); /* Heretic */ gameIds[heretic] = DD_DefineGame(&hereticDef); - DD_AddGameResource(GID(heretic), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(heretic), FC_PACKAGE, RF_STARTUP, "heretic.wad", "E2M2;E3M6;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); + DD_AddGameResource(GID(heretic), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(heretic), FC_PACKAGE, FF_STARTUP, "heretic.wad", "E2M2;E3M6;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); DD_AddGameResource(GID(heretic), FC_DEFINITION, 0, "heretic.ded", 0); /* Heretic (Shareware) */ gameIds[heretic_shareware] = DD_DefineGame(&hereticShareDef); - DD_AddGameResource(GID(heretic_shareware), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(heretic_shareware), FC_PACKAGE, RF_STARTUP, "heretic1.wad", "E1M1;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); + DD_AddGameResource(GID(heretic_shareware), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(heretic_shareware), FC_PACKAGE, FF_STARTUP, "heretic1.wad", "E1M1;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); DD_AddGameResource(GID(heretic_shareware), FC_DEFINITION, 0, "heretic-share.ded", 0); return true; diff --git a/doomsday/plugins/jhexen/src/x_api.c b/doomsday/plugins/jhexen/src/x_api.c index 11859107a6..b32512638c 100644 --- a/doomsday/plugins/jhexen/src/x_api.c +++ b/doomsday/plugins/jhexen/src/x_api.c @@ -88,33 +88,33 @@ int G_RegisterGames(int hookType, int param, void* data) /* Hexen (Death Kings) */ gameIds[hexen_deathkings] = DD_DefineGame(&deathkingsDef); - DD_AddGameResource(GID(hexen_deathkings), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(hexen_deathkings), FC_PACKAGE, RF_STARTUP, "hexdd.wad", "MAP59;MAP60"); - DD_AddGameResource(GID(hexen_deathkings), FC_PACKAGE, RF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); + DD_AddGameResource(GID(hexen_deathkings), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen_deathkings), FC_PACKAGE, FF_STARTUP, "hexdd.wad", "MAP59;MAP60"); + DD_AddGameResource(GID(hexen_deathkings), FC_PACKAGE, FF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); DD_AddGameResource(GID(hexen_deathkings), FC_DEFINITION, 0, "hexen-dk.ded", 0); /* Hexen */ gameIds[hexen] = DD_DefineGame(&hexenDef); - DD_AddGameResource(GID(hexen), FC_PACKAGE, RF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); - DD_AddGameResource(GID(hexen), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen), FC_PACKAGE, FF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); + DD_AddGameResource(GID(hexen), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); DD_AddGameResource(GID(hexen), FC_DEFINITION, 0, "hexen.ded", 0); /* Hexen (v1.0) */ gameIds[hexen_v10] = DD_DefineGame(&hexenV10Def); - DD_AddGameResource(GID(hexen_v10), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(hexen_v10), FC_PACKAGE, RF_STARTUP, "hexen.wad", "MAP08;MAP22;MAP41;TINTTAB;FOGMAP;DARTA1;ARTIPORK;SKYFOG;GROVER"); + DD_AddGameResource(GID(hexen_v10), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen_v10), FC_PACKAGE, FF_STARTUP, "hexen.wad", "MAP08;MAP22;MAP41;TINTTAB;FOGMAP;DARTA1;ARTIPORK;SKYFOG;GROVER"); DD_AddGameResource(GID(hexen_v10), FC_DEFINITION, 0, "hexen-v10.ded", 0); /* Hexen (Demo) */ gameIds[hexen_demo] = DD_DefineGame(&hexenDemoDef); - DD_AddGameResource(GID(hexen_demo), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(hexen_demo), FC_PACKAGE, RF_STARTUP, "hexendemo.wad;machexendemo.wad;hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;DARTA1;ARTIPORK;DEMO3==18150"); + DD_AddGameResource(GID(hexen_demo), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen_demo), FC_PACKAGE, FF_STARTUP, "hexendemo.wad;machexendemo.wad;hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;DARTA1;ARTIPORK;DEMO3==18150"); DD_AddGameResource(GID(hexen_demo), FC_DEFINITION, 0, "hexen-demo.ded", 0); /* Hexen (Beta Demo) */ gameIds[hexen_betademo] = DD_DefineGame(&hexenBetaDemoDef); - DD_AddGameResource(GID(hexen_betademo), FC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); - DD_AddGameResource(GID(hexen_betademo), FC_PACKAGE, RF_STARTUP, "hexendemo.wad;machexendemo.wad;hexenbeta.wad;hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;DARTA1;ARTIPORK;AFLYA0;DEMO3==13866"); + DD_AddGameResource(GID(hexen_betademo), FC_PACKAGE, FF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen_betademo), FC_PACKAGE, FF_STARTUP, "hexendemo.wad;machexendemo.wad;hexenbeta.wad;hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;DARTA1;ARTIPORK;AFLYA0;DEMO3==13866"); DD_AddGameResource(GID(hexen_betademo), FC_DEFINITION, 0, "hexen-demo.ded", 0); return true;