From ed08b20f4ccbdecf683ff96e654578d33917b2e7 Mon Sep 17 00:00:00 2001 From: danij Date: Fri, 10 Dec 2010 01:05:29 +0000 Subject: [PATCH] Refactored game and game resource registration so that any needed top-level definition files can be specified as game resources using DD_AddGameResource. Stop the title finale in DD_ChangeGame if it is currently playing at this time. --- doomsday/engine/api/dd_share.h | 7 +++ doomsday/engine/api/doomsday.h | 5 +- doomsday/engine/portable/include/gameinfo.h | 18 +++---- doomsday/engine/portable/src/dd_main.c | 39 ++++++++------ doomsday/engine/portable/src/def_main.c | 36 +++++++------ doomsday/engine/portable/src/gameinfo.c | 23 +++----- doomsday/plugins/exampleplugin/src/example.c | 2 +- doomsday/plugins/jdoom/src/d_main.c | 56 +++++++++++--------- doomsday/plugins/jdoom64/src/d_main.c | 7 +-- doomsday/plugins/jheretic/src/h_main.c | 21 ++++---- doomsday/plugins/jhexen/src/h2_main.c | 23 ++++---- 11 files changed, 127 insertions(+), 110 deletions(-) diff --git a/doomsday/engine/api/dd_share.h b/doomsday/engine/api/dd_share.h index 0c636eddde..0e66c7eee5 100644 --- a/doomsday/engine/api/dd_share.h +++ b/doomsday/engine/api/dd_share.h @@ -331,6 +331,13 @@ typedef struct { const char* identityKey; } ddgameinfo_t; +/** + * @defgroup resourceFlags ResourceFlags + */ +/*{@*/ +#define RF_STARTUP 0x1 // A required resource needed for and loaded during game start up (can't be a virtual file). +/*}@*/ + //------------------------------------------------------------------------ // // Fixed-Point Math diff --git a/doomsday/engine/api/doomsday.h b/doomsday/engine/api/doomsday.h index dc5842d7a1..d493c1f752 100644 --- a/doomsday/engine/api/doomsday.h +++ b/doomsday/engine/api/doomsday.h @@ -84,7 +84,6 @@ extern "C" { * - Sent out in netgames (a client can't connect unless mode strings match). * @param dataPath The base directory for all data-class resources. * @param defsPath The base directory for all defs-class resources. - * @param mainDef The name of the main/top-level definition file. Can be @c NULL. * @param mainConfig The name of the main game config file. Can be @c NULL. * @param defaultTitle Default game title. May be overridden later. * @param defaultAuthor Default game author. May be overridden later. Used for (e.g.) the map author name @@ -94,7 +93,7 @@ extern "C" { * * @return Unique identifier/name assigned to the game. */ -gameid_t DD_AddGame(const char* identityKey, const char* dataPath, const char* defsPath, const char* mainDef, +gameid_t DD_AddGame(const char* identityKey, const char* dataPath, const char* defsPath, const char* mainConfig, const char* defaultTitle, const char* defaultAuthor, const char* cmdlineFlag, const char* cmdlineFlag2); @@ -105,7 +104,7 @@ gameid_t DD_AddGame(const char* identityKey, const char* dataPath, const char* d * * @param game Unique identifier/name of the game. * @param rclass Class of resource being added. - * @param rflags Presently unused. Reserved for future use. + * @param rflags @see resourceFlags * @param names One or more known potential names, seperated by semicolon e.g., "name1;name2". * Names may include valid absolute, or relative file paths. These paths include * valid symbolbolic escape tokens, predefined symbols into the virtual file system. diff --git a/doomsday/engine/portable/include/gameinfo.h b/doomsday/engine/portable/include/gameinfo.h index 52ade4b430..a0d8111137 100644 --- a/doomsday/engine/portable/include/gameinfo.h +++ b/doomsday/engine/portable/include/gameinfo.h @@ -36,6 +36,9 @@ typedef struct { /// Class of resource. resourceclass_t rclass; + /// @see resourceFlags. + int rflags; + /// List of known potential names. Seperated with a semicolon. ddstring_t names; @@ -77,9 +80,6 @@ typedef struct { /// The base directory for all defs-class resources. ddstring_t _defsPath; - /// Name of the main/top-level definition file (e.g., "jdoom.ded"). - ddstring_t _mainDef; - /// Name of the main config file (e.g., "jdoom.cfg"). ddstring_t _mainConfig; @@ -100,7 +100,6 @@ typedef struct { * @param identityKey Unique game mode key/identifier, 16 chars max (e.g., "doom1-ultimate"). * @param dataPath The base directory for all data-class resources. * @param defsPath The base directory for all defs-class resources. - * @param mainDef The main/top-level definition file. Can be @c NULL. * @param mainConfig The main config file. Can be @c NULL. * @param title Default game title. * @param author Default game author. @@ -108,8 +107,8 @@ typedef struct { * @param cmdlineFlag2 Alternative override. Can be @c NULL. */ gameinfo_t* P_CreateGameInfo(pluginid_t pluginId, const char* identityKey, const char* dataPath, - const char* defsPath, const ddstring_t* mainDef, const ddstring_t* mainConfig, const char* title, - const char* author, const ddstring_t* cmdlineFlag, const ddstring_t* cmdlineFlag2); + const char* defsPath, const ddstring_t* mainConfig, const char* title, const char* author, + const ddstring_t* cmdlineFlag, const ddstring_t* cmdlineFlag2); void P_DestroyGameInfo(gameinfo_t* info); @@ -119,9 +118,11 @@ void P_DestroyGameInfo(gameinfo_t* info); * \note Resource registration order defines the order in which resources of each type are loaded. * * @param rclass Class of resource being added. + * @param rflags @see resourceFlags. * @param name Potential resource name. */ -gameresource_record_t* GameInfo_AddResource(gameinfo_t* info, resourceclass_t rclass, const ddstring_t* name); +gameresource_record_t* GameInfo_AddResource(gameinfo_t* info, resourceclass_t rclass, int rflags, + const ddstring_t* name); /** * Accessor methods. @@ -138,9 +139,6 @@ const ddstring_t* GameInfo_Title(gameinfo_t* info); /// @return Ptr to a string containing the default author. const ddstring_t* GameInfo_Author(gameinfo_t* info); -/// @return Ptr to a string containing the name of the main definition file. -const ddstring_t* GameInfo_MainDef(gameinfo_t* info); - /// @return Ptr to a string containing the name of the main config file. const ddstring_t* GameInfo_MainConfig(gameinfo_t* info); diff --git a/doomsday/engine/portable/src/dd_main.c b/doomsday/engine/portable/src/dd_main.c index ce625d71bf..d3773ce8ca 100644 --- a/doomsday/engine/portable/src/dd_main.c +++ b/doomsday/engine/portable/src/dd_main.c @@ -217,11 +217,11 @@ static void destroyPathList(ddstring_t*** list, size_t* listSize) } static gameinfo_t* addGameInfoRecord(pluginid_t pluginId, const char* identityKey, const char* dataPath, - const char* defsPath, const ddstring_t* mainDef, const ddstring_t* mainConfig, const char* title, - const char* author, const ddstring_t* cmdlineFlag, const ddstring_t* cmdlineFlag2) + const char* defsPath, const ddstring_t* mainConfig, const char* title, const char* author, + const ddstring_t* cmdlineFlag, const ddstring_t* cmdlineFlag2) { gameInfo = M_Realloc(gameInfo, sizeof(*gameInfo) * (numGameInfo + 1)); - gameInfo[numGameInfo] = P_CreateGameInfo(pluginId, identityKey, dataPath, defsPath, mainDef, mainConfig, title, author, cmdlineFlag, cmdlineFlag2); + gameInfo[numGameInfo] = P_CreateGameInfo(pluginId, identityKey, dataPath, defsPath, mainConfig, title, author, cmdlineFlag, cmdlineFlag2); return gameInfo[numGameInfo++]; } @@ -305,7 +305,7 @@ void DD_AddGameResource(gameid_t gameId, resourceclass_t rclass, int rflags, con Str_Init(&name); { gameresource_record_t* rec; - if((rec = GameInfo_AddResource(info, rclass, &names))) + if((rec = GameInfo_AddResource(info, rclass, rflags, &names))) { if(params) switch(rec->rclass) @@ -338,14 +338,14 @@ void DD_AddGameResource(gameid_t gameId, resourceclass_t rclass, int rflags, con Str_Free(&names); } -gameid_t DD_AddGame(const char* identityKey, const char* _dataPath, const char* _defsPath, const char* _mainDef, +gameid_t DD_AddGame(const char* identityKey, const char* _dataPath, const char* _defsPath, const char* _mainConfig, const char* defaultTitle, const char* defaultAuthor, const char* _cmdlineFlag, const char* _cmdlineFlag2) { assert(identityKey && identityKey[0] && _dataPath && _dataPath[0] && _defsPath && _defsPath[0] && defaultTitle && defaultTitle[0] && defaultAuthor && defaultAuthor[0]); { gameinfo_t* info; - ddstring_t mainDef, mainConfig, cmdlineFlag, cmdlineFlag2; + ddstring_t mainConfig, cmdlineFlag, cmdlineFlag2; filename_t dataPath, defsPath; pluginid_t pluginId = Plug_PluginIdForActiveHook(); @@ -359,10 +359,6 @@ gameid_t DD_AddGame(const char* identityKey, const char* _dataPath, const char* M_TranslatePath(defsPath, _defsPath, FILENAME_T_MAXLEN); Dir_ValidDir(defsPath, FILENAME_T_MAXLEN); - Str_Init(&mainDef); - if(_mainDef) - Str_Set(&mainDef, _mainDef); - Str_Init(&mainConfig); if(_mainConfig) Str_Set(&mainConfig, _mainConfig); @@ -387,9 +383,8 @@ gameid_t DD_AddGame(const char* identityKey, const char* _dataPath, const char* /** * Looking good. Add this game to our records. */ - info = addGameInfoRecord(pluginId, identityKey, dataPath, defsPath, &mainDef, &mainConfig, defaultTitle, defaultAuthor, _cmdlineFlag? &cmdlineFlag : 0, _cmdlineFlag2? &cmdlineFlag2 : 0); + info = addGameInfoRecord(pluginId, identityKey, dataPath, defsPath, &mainConfig, defaultTitle, defaultAuthor, _cmdlineFlag? &cmdlineFlag : 0, _cmdlineFlag2? &cmdlineFlag2 : 0); - Str_Free(&mainDef); Str_Free(&mainConfig); Str_Free(&cmdlineFlag); Str_Free(&cmdlineFlag2); @@ -497,7 +492,12 @@ static void locateGameResources(gameinfo_t* info) if((records = GameInfo_Resources(info, (resourceclass_t)i, 0))) { for(; *records; records++) - validateGameResource(*records, Str_Text(&(*records)->names)); + { + gameresource_record_t* rec = *records; + if(!(rec->rflags & RF_STARTUP)) + continue; + validateGameResource(rec, Str_Text(&rec->names)); + } } }} Str_Free(&name); @@ -524,7 +524,8 @@ static boolean allGameResourcesFound(gameinfo_t* info) if((records = GameInfo_Resources(info, (resourceclass_t)i, 0))) do { - if(Str_Length(&(*records)->path) == 0) + gameresource_record_t* rec = *records; + if((rec->rflags & RF_STARTUP) && Str_Length(&rec->path) == 0) return false; } while(*(++records)); } @@ -578,7 +579,7 @@ static void printGameInfo(gameinfo_t* info) Con_Printf(" %s:\n", F_ResourceClassStr((resourceclass_t)i)); do { - Con_Printf(" %i: \"%s\" > %s\n", n++, Str_Text(&(*records)->names), Str_Length(&(*records)->path) == 0? "--(!)missing" : M_PrettyPath(Str_Text(&(*records)->path))); + Con_Printf(" %i: %s\"%s\" %s%s\n", n++, ((*records)->rflags & RF_STARTUP)? "* ":"", Str_Text(&(*records)->names), Str_Length(&(*records)->path) == 0? "" : "> ", (((*records)->rflags & RF_STARTUP) && Str_Length(&(*records)->path) == 0)? "--(!)missing" : M_PrettyPath(Str_Text(&(*records)->path))); } while(*(++records)); } }} @@ -866,6 +867,12 @@ boolean DD_ChangeGame(gameinfo_t* info) return false; } + // If the title finale is in progress, stop it. + if(titleFinale != 0) + { + FI_ScriptTerminate(titleFinale); titleFinale = 0; + } + P_InitMapUpdate(); DAM_Init(); @@ -994,7 +1001,7 @@ int DD_EarlyInit(void) Dir_ValidDir(dataPath, FILENAME_T_MAXLEN); M_TranslatePath(defsPath, DD_BASEPATH_DEFS, FILENAME_T_MAXLEN); Dir_ValidDir(defsPath, FILENAME_T_MAXLEN); - currentGameInfoIndex = gameInfoIndex(addGameInfoRecord(0, "null-game", dataPath, defsPath, 0, 0, 0, 0, 0, 0)); + currentGameInfoIndex = gameInfoIndex(addGameInfoRecord(0, "null-game", dataPath, defsPath, 0, 0, 0, 0, 0)); } return true; } diff --git a/doomsday/engine/portable/src/def_main.c b/doomsday/engine/portable/src/def_main.c index 20e951ead3..035b627f41 100644 --- a/doomsday/engine/portable/src/def_main.c +++ b/doomsday/engine/portable/src/def_main.c @@ -740,25 +740,27 @@ static void readAllDefinitions(void) Con_Error("readAllDefinitions: Error, failed to locate main engine definition file \"doomsday.ded\"."); } - // Next the game's main/top-level definition file. - { const ddstring_t* mainDef; - if((mainDef = GameInfo_MainDef(DD_GameInfo())) && Str_Length(mainDef) != 0) + // Now any definition files required by the game on load. + if(!DD_IsNullGameInfo(DD_GameInfo())) { - filename_t foundPath; - if(F_FindResource(RC_DEFINITION, foundPath, Str_Text(mainDef), 0, FILENAME_T_MAXLEN)) - readDefinitionFile(foundPath); - else - Con_Error("readAllDefinitions: Error, failed to locate main game definition file \"%s\".", Str_Text(mainDef)); - }} + gameinfo_t* info = DD_GameInfo(); + gameresource_record_t* const* records; + if((records = GameInfo_Resources(info, RC_DEFINITION, 0))) + do + { + gameresource_record_t* rec = *records; + if(Str_Length(&rec->path) == 0) + { + filename_t foundPath; + if(F_FindResource(rec->rclass, foundPath, Str_Text(&rec->names), 0, FILENAME_T_MAXLEN)) + Str_Set(&rec->path, foundPath); + } - // Now any extra definition files required by the game. - { gameresource_record_t* const* records; - if((records = GameInfo_Resources(DD_GameInfo(), RC_DEFINITION, 0))) - do - { - if(Str_Length(&(*records)->path) != 0) - readDefinitionFile(Str_Text(&(*records)->path)); - } while(records++); + if(Str_Length(&rec->path) == 0) + Con_Error("readAllDefinitions: Error, failed to locate required game definition file \"%s\".", Str_Text(&rec->names)); + + readDefinitionFile(Str_Text(&rec->path)); + } while(*(++records)); } // Next up are definition files in the /auto directory. diff --git a/doomsday/engine/portable/src/gameinfo.c b/doomsday/engine/portable/src/gameinfo.c index add845e704..278aa594fc 100644 --- a/doomsday/engine/portable/src/gameinfo.c +++ b/doomsday/engine/portable/src/gameinfo.c @@ -29,8 +29,8 @@ #include "gameinfo.h" gameinfo_t* P_CreateGameInfo(pluginid_t pluginId, const char* identityKey, const char* dataPath, - const char* defsPath, const ddstring_t* mainDef, const ddstring_t* mainConfig, const char* title, - const char* author, const ddstring_t* cmdlineFlag, const ddstring_t* cmdlineFlag2) + const char* defsPath, const ddstring_t* mainConfig, const char* title, const char* author, + const ddstring_t* cmdlineFlag, const ddstring_t* cmdlineFlag2) { gameinfo_t* info = M_Malloc(sizeof(*info)); @@ -48,10 +48,6 @@ gameinfo_t* P_CreateGameInfo(pluginid_t pluginId, const char* identityKey, const if(defsPath) Str_Set(&info->_defsPath, defsPath); - Str_Init(&info->_mainDef); - if(mainDef) - Str_Copy(&info->_mainDef, mainDef); - Str_Init(&info->_mainConfig); Str_Init(&info->_bindingConfig); if(mainConfig) @@ -104,7 +100,6 @@ void P_DestroyGameInfo(gameinfo_t* info) Str_Free(&info->_identityKey); Str_Free(&info->_dataPath); Str_Free(&info->_defsPath); - Str_Free(&info->_mainDef); Str_Free(&info->_mainConfig); Str_Free(&info->_bindingConfig); Str_Free(&info->_title); @@ -144,7 +139,7 @@ void P_DestroyGameInfo(gameinfo_t* info) } gameresource_record_t* GameInfo_AddResource(gameinfo_t* info, resourceclass_t rclass, - const ddstring_t* names) + int rflags, const ddstring_t* names) { assert(info && VALID_RESOURCE_CLASS(rclass) && names); { @@ -152,13 +147,13 @@ gameresource_record_t* GameInfo_AddResource(gameinfo_t* info, resourceclass_t rc gameresource_record_t* record; rset->records = M_Realloc(rset->records, sizeof(*rset->records) * (rset->numRecords+2)); - record = rset->records[rset->numRecords] = M_Malloc(sizeof(*record)); + record = rset->records[rset->numRecords] = M_Calloc(sizeof(*record)); rset->records[rset->numRecords+1] = 0; // Terminate. rset->numRecords++; - Str_Init(&record->names); Str_Copy(&record->names, names); - Str_Init(&record->path); + Str_Copy(&record->names, names); record->rclass = rclass; + record->rflags = rflags; switch(record->rclass) { case RC_PACKAGE: @@ -195,12 +190,6 @@ const ddstring_t* GameInfo_DefsPath(gameinfo_t* info) return &info->_defsPath; } -const ddstring_t* GameInfo_MainDef(gameinfo_t* info) -{ - assert(info); - return &info->_mainDef; -} - const ddstring_t* GameInfo_MainConfig(gameinfo_t* info) { assert(info); diff --git a/doomsday/plugins/exampleplugin/src/example.c b/doomsday/plugins/exampleplugin/src/example.c index 3c58973f4a..ad44d81882 100644 --- a/doomsday/plugins/exampleplugin/src/example.c +++ b/doomsday/plugins/exampleplugin/src/example.c @@ -192,7 +192,7 @@ game_export_t* GetGameAPI(game_import_t* imports) */ int ExampleHook(int hookType, int parm, void *data) { - DD_AddGame(PLUGIN_NAMETEXT, DD_BASEPATH_DATA PLUGIN_NAMETEXT "\\", DD_BASEPATH_DEFS PLUGIN_NAMETEXT "\\", 0, PLUGIN_NAMETEXT ".cfg", PLUGIN_NICENAME, PLUGIN_NICEAUTHOR, PLUGIN_NAMETEXT, 0); + DD_AddGame(PLUGIN_NAMETEXT, DD_BASEPATH_DATA PLUGIN_NAMETEXT "\\", DD_BASEPATH_DEFS PLUGIN_NAMETEXT "\\", PLUGIN_NAMETEXT ".cfg", PLUGIN_NICENAME, PLUGIN_NICEAUTHOR, PLUGIN_NAMETEXT, 0); return true; } diff --git a/doomsday/plugins/jdoom/src/d_main.c b/doomsday/plugins/jdoom/src/d_main.c index 1936578e15..5a844b6dd5 100644 --- a/doomsday/plugins/jdoom/src/d_main.c +++ b/doomsday/plugins/jdoom/src/d_main.c @@ -196,44 +196,52 @@ int G_RegisterGames(int hookType, int parm, void* data) #define STARTUPPK3 PLUGIN_NAMETEXT ".pk3" /* HacX */ - gameIds[doom2_hacx] = DD_AddGame("hacx", DATAPATH, DEFSPATH, "hacx.ded", MAINCONFIG, "HACX - Twitch 'n Kill", "Banjo Software", "hacx", 0); - DD_AddGameResource(GID(doom2_hacx), RC_PACKAGE, 0, "hacx.wad", "HACX-R"); - DD_AddGameResource(GID(doom2_hacx), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom2_hacx] = DD_AddGame("hacx", DATAPATH, DEFSPATH, MAINCONFIG, "HACX - Twitch 'n Kill", "Banjo Software", "hacx", 0); + DD_AddGameResource(GID(doom2_hacx), RC_PACKAGE, RF_STARTUP, "hacx.wad", "HACX-R"); + DD_AddGameResource(GID(doom2_hacx), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2_hacx), RC_DEFINITION, 0, "hacx.ded", 0); /* Chex Quest */ - gameIds[doom_chex] = DD_AddGame("chex", DATAPATH, DEFSPATH, "chex.ded", MAINCONFIG, "Chex(R) Quest", "Digital Cafe", "chex", 0); - DD_AddGameResource(GID(doom_chex), RC_PACKAGE, 0, "chex.wad", "E1M1;E4M1;_DEUTEX_;POSSH0M0"); - DD_AddGameResource(GID(doom_chex), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom_chex] = DD_AddGame("chex", DATAPATH, DEFSPATH, MAINCONFIG, "Chex(R) Quest", "Digital Cafe", "chex", 0); + DD_AddGameResource(GID(doom_chex), RC_PACKAGE, RF_STARTUP, "chex.wad", "E1M1;E4M1;_DEUTEX_;POSSH0M0"); + DD_AddGameResource(GID(doom_chex), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom_chex), RC_DEFINITION, 0, "chex.ded", 0); /* DOOM2 (TNT) */ - gameIds[doom2_tnt] = DD_AddGame("doom2-tnt", DATAPATH, DEFSPATH, "doom2-tnt.ded", MAINCONFIG, "Final DOOM: TNT: Evilution", "Team TNT", "tnt", 0); - DD_AddGameResource(GID(doom2_tnt), RC_PACKAGE, 0, "tnt.wad", "CAVERN5;CAVERN7;STONEW1"); - DD_AddGameResource(GID(doom2_tnt), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom2_tnt] = DD_AddGame("doom2-tnt", DATAPATH, DEFSPATH, MAINCONFIG, "Final DOOM: TNT: Evilution", "Team TNT", "tnt", 0); + DD_AddGameResource(GID(doom2_tnt), RC_PACKAGE, RF_STARTUP, "tnt.wad", "CAVERN5;CAVERN7;STONEW1"); + DD_AddGameResource(GID(doom2_tnt), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2_tnt), RC_DEFINITION, 0, "doom2-tnt.ded", 0); /* DOOM2 (Plutonia) */ - gameIds[doom2_plut] = DD_AddGame("doom2-plut", DATAPATH, DEFSPATH, "doom2-plut.ded", MAINCONFIG, "Final DOOM: The Plutonia Experiment", "Dario Casali and Milo Casali", "plutonia", "plut"); - DD_AddGameResource(GID(doom2_plut), RC_PACKAGE, 0, "plutonia.wad", "_DEUTEX_;MAP01;MAP25;MC5;MC11;MC16;MC20"); - DD_AddGameResource(GID(doom2_plut), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom2_plut] = DD_AddGame("doom2-plut", DATAPATH, DEFSPATH, MAINCONFIG, "Final DOOM: The Plutonia Experiment", "Dario Casali and Milo Casali", "plutonia", "plut"); + DD_AddGameResource(GID(doom2_plut), RC_PACKAGE, RF_STARTUP, "plutonia.wad", "_DEUTEX_;MAP01;MAP25;MC5;MC11;MC16;MC20"); + DD_AddGameResource(GID(doom2_plut), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2_plut), RC_DEFINITION, 0, "doom2-plut.ded", 0); /* DOOM2 */ - gameIds[doom2] = DD_AddGame("doom2", DATAPATH, DEFSPATH, "doom2.ded", MAINCONFIG, "DOOM 2: Hell on Earth", "id Software", "doom2", 0); - DD_AddGameResource(GID(doom2), RC_PACKAGE, 0, "doom2f.wad;doom2.wad", "MAP01;MAP02;MAP03;MAP04;MAP10;MAP20;MAP25;MAP30;VILEN1;VILEO1;VILEQ1;GRNROCK"); - DD_AddGameResource(GID(doom2), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom2] = DD_AddGame("doom2", DATAPATH, DEFSPATH, MAINCONFIG, "DOOM 2: Hell on Earth", "id Software", "doom2", 0); + DD_AddGameResource(GID(doom2), RC_PACKAGE, RF_STARTUP, "doom2f.wad;doom2.wad", "MAP01;MAP02;MAP03;MAP04;MAP10;MAP20;MAP25;MAP30;VILEN1;VILEO1;VILEQ1;GRNROCK"); + DD_AddGameResource(GID(doom2), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom2), RC_DEFINITION, 0, "doom2.ded", 0); /* DOOM (Ultimate) */ - gameIds[doom_ultimate] = DD_AddGame("doom1-ultimate", DATAPATH, DEFSPATH, "doom1-ultimate.ded", MAINCONFIG, "The Ultimate DOOM", "id Software", "ultimatedoom", "udoom"); - DD_AddGameResource(GID(doom_ultimate), RC_PACKAGE, 0, "doomu.wad;doom.wad", "E4M1;E4M2;E4M3;E4M4;E4M5;E4M6;E4M7;E4M8;E4M9;M_EPI4"); - DD_AddGameResource(GID(doom_ultimate), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom_ultimate] = DD_AddGame("doom1-ultimate", DATAPATH, DEFSPATH, MAINCONFIG, "The Ultimate DOOM", "id Software", "ultimatedoom", "udoom"); + DD_AddGameResource(GID(doom_ultimate), RC_PACKAGE, RF_STARTUP, "doomu.wad;doom.wad", "E4M1;E4M2;E4M3;E4M4;E4M5;E4M6;E4M7;E4M8;E4M9;M_EPI4"); + DD_AddGameResource(GID(doom_ultimate), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom_ultimate), RC_DEFINITION, 0, "doom1-ultimate.ded", 0); /* DOOM */ - gameIds[doom] = DD_AddGame("doom1", DATAPATH, DEFSPATH, "doom1.ded", MAINCONFIG, "DOOM Registered", "id Software", "doom", 0); - DD_AddGameResource(GID(doom), RC_PACKAGE, 0, "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), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom] = DD_AddGame("doom1", DATAPATH, DEFSPATH, MAINCONFIG, "DOOM Registered", "id Software", "doom", 0); + DD_AddGameResource(GID(doom), RC_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), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom), RC_DEFINITION, 0, "doom1.ded", 0); /* DOOM (Shareware) */ - gameIds[doom_shareware] = DD_AddGame("doom1-share", DATAPATH, DEFSPATH, "doom1-share.ded", MAINCONFIG, "DOOM Shareware", "id Software", "sdoom", 0); - DD_AddGameResource(GID(doom_shareware), RC_PACKAGE, 0, "doom1.wad", "E1M1;E1M2;E1M3;E1M4;E1M5;E1M6;E1M7;E1M8;E1M9;D_E1M1;FLOOR4_8;FLOOR7_2"); - DD_AddGameResource(GID(doom_shareware), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom_shareware] = DD_AddGame("doom1-share", DATAPATH, DEFSPATH, MAINCONFIG, "DOOM Shareware", "id Software", "sdoom", 0); + DD_AddGameResource(GID(doom_shareware), RC_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), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom_shareware), RC_DEFINITION, 0, "doom1-share.ded", 0); return true; #undef STARTUPPK3 diff --git a/doomsday/plugins/jdoom64/src/d_main.c b/doomsday/plugins/jdoom64/src/d_main.c index 9b3a852b67..d7454f5db0 100644 --- a/doomsday/plugins/jdoom64/src/d_main.c +++ b/doomsday/plugins/jdoom64/src/d_main.c @@ -203,9 +203,10 @@ int G_RegisterGames(int hookType, int parm, void* data) #define MAINCONFIG PLUGIN_NAMETEXT ".cfg" #define STARTUPPK3 PLUGIN_NAMETEXT ".pk3" - gameIds[doom64] = DD_AddGame("doom64", DATAPATH, DEFSPATH, PLUGIN_NAMETEXT ".ded", MAINCONFIG, "Doom 64", "Midway Software", "doom64", 0); - DD_AddGameResource(GID(doom64), RC_PACKAGE, 0, "doom64.wad", "MAP01;MAP020;MAP38;F_SUCK"); - DD_AddGameResource(GID(doom64), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[doom64] = DD_AddGame("doom64", DATAPATH, DEFSPATH, MAINCONFIG, "Doom 64", "Midway Software", "doom64", 0); + DD_AddGameResource(GID(doom64), RC_PACKAGE, RF_STARTUP, "doom64.wad", "MAP01;MAP020;MAP38;F_SUCK"); + DD_AddGameResource(GID(doom64), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(doom64), RC_DEFINITION, 0, PLUGIN_NAMETEXT ".ded", 0); return true; #undef STARTUPPK3 diff --git a/doomsday/plugins/jheretic/src/h_main.c b/doomsday/plugins/jheretic/src/h_main.c index 6bece577d6..653bafb289 100644 --- a/doomsday/plugins/jheretic/src/h_main.c +++ b/doomsday/plugins/jheretic/src/h_main.c @@ -202,19 +202,22 @@ int G_RegisterGames(int hookType, int parm, void* data) #define STARTUPPK3 PLUGIN_NAMETEXT ".pk3" /* Heretic (Extended) */ - gameIds[heretic_extended] = DD_AddGame("heretic-ext", DATAPATH, DEFSPATH, "heretic-ext.ded", MAINCONFIG, "Heretic: Shadow of the Serpent Riders", "Raven Software", "hereticext", "xheretic"); - DD_AddGameResource(GID(heretic_extended), RC_PACKAGE, 0, "heretic.wad", "EXTENDED;E5M2;E5M7;E6M2;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); - DD_AddGameResource(GID(heretic_extended), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[heretic_extended] = DD_AddGame("heretic-ext", DATAPATH, DEFSPATH, MAINCONFIG, "Heretic: Shadow of the Serpent Riders", "Raven Software", "hereticext", "xheretic"); + DD_AddGameResource(GID(heretic_extended), RC_PACKAGE, RF_STARTUP, "heretic.wad", "EXTENDED;E5M2;E5M7;E6M2;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); + DD_AddGameResource(GID(heretic_extended), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(heretic_extended), RC_DEFINITION, 0, "heretic-ext.ded", 0); /* Heretic */ - gameIds[heretic] = DD_AddGame("heretic", DATAPATH, DEFSPATH, "heretic.ded", MAINCONFIG, "Heretic Registered", "Raven Software", "heretic", 0); - DD_AddGameResource(GID(heretic), RC_PACKAGE, 0, "heretic.wad", "E2M2;E3M6;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); - DD_AddGameResource(GID(heretic), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[heretic] = DD_AddGame("heretic", DATAPATH, DEFSPATH, MAINCONFIG, "Heretic Registered", "Raven Software", "heretic", 0); + DD_AddGameResource(GID(heretic), RC_PACKAGE, RF_STARTUP, "heretic.wad", "E2M2;E3M6;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); + DD_AddGameResource(GID(heretic), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(heretic), RC_DEFINITION, 0, "heretic.ded", 0); /* Heretic (Shareware) */ - gameIds[heretic_shareware] = DD_AddGame("heretic-share", DATAPATH, DEFSPATH, "heretic-share.ded", MAINCONFIG, "Heretic Shareware", "Raven Software", "sheretic", 0); - DD_AddGameResource(GID(heretic_shareware), RC_PACKAGE, 0, "heretic1.wad", "E1M1;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); - DD_AddGameResource(GID(heretic_shareware), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[heretic_shareware] = DD_AddGame("heretic-share", DATAPATH, DEFSPATH, MAINCONFIG, "Heretic Shareware", "Raven Software", "sheretic", 0); + DD_AddGameResource(GID(heretic_shareware), RC_PACKAGE, RF_STARTUP, "heretic1.wad", "E1M1;MUMSIT;WIZACT;MUS_CPTD;CHKNC5;SPAXA1A5"); + DD_AddGameResource(GID(heretic_shareware), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(heretic_shareware), RC_DEFINITION, 0, "heretic-share.ded", 0); return true; #undef STARTUPPK3 diff --git a/doomsday/plugins/jhexen/src/h2_main.c b/doomsday/plugins/jhexen/src/h2_main.c index 4b974e9665..8746444efb 100644 --- a/doomsday/plugins/jhexen/src/h2_main.c +++ b/doomsday/plugins/jhexen/src/h2_main.c @@ -200,20 +200,23 @@ int G_RegisterGames(int hookType, int parm, void* data) #define STARTUPPK3 PLUGIN_NAMETEXT ".pk3" /* Hexen (Death Kings) */ - gameIds[hexen_deathkings] = DD_AddGame("hexen-dk", DATAPATH, DEFSPATH, "hexen-dk.ded", MAINCONFIG, "Hexen (Deathkings of the Dark Citadel)", "Raven Software", "deathkings", "dk"); - DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, 0, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); - DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, 0, "hexdd.wad", "MAP59;MAP60"); - DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[hexen_deathkings] = DD_AddGame("hexen-dk", DATAPATH, DEFSPATH, MAINCONFIG, "Hexen (Deathkings of the Dark Citadel)", "Raven Software", "deathkings", "dk"); + DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, RF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); + DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, RF_STARTUP, "hexdd.wad", "MAP59;MAP60"); + DD_AddGameResource(GID(hexen_deathkings), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen_deathkings), RC_DEFINITION, 0, "hexen-dk.ded", 0); /* Hexen */ - gameIds[hexen] = DD_AddGame("hexen", DATAPATH, DEFSPATH, "hexen.ded", MAINCONFIG, "Hexen", "Raven Software", "hexen", 0); - DD_AddGameResource(GID(hexen), RC_PACKAGE, 0, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); - DD_AddGameResource(GID(hexen), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[hexen] = DD_AddGame("hexen", DATAPATH, DEFSPATH, MAINCONFIG, "Hexen", "Raven Software", "hexen", 0); + DD_AddGameResource(GID(hexen), RC_PACKAGE, RF_STARTUP, "hexen.wad", "MAP08;MAP22;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); + DD_AddGameResource(GID(hexen), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen), RC_DEFINITION, 0, "hexen.ded", 0); /* Hexen (Demo) */ - gameIds[hexen_demo] = DD_AddGame("hexen-demo", DATAPATH, DEFSPATH, "hexen-demo.ded", MAINCONFIG, "Hexen 4-map Beta Demo", "Raven Software", "dhexen", 0); - DD_AddGameResource(GID(hexen_demo), RC_PACKAGE, 0, "hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); - DD_AddGameResource(GID(hexen_demo), RC_PACKAGE, 0, STARTUPPK3, 0); + gameIds[hexen_demo] = DD_AddGame("hexen-demo", DATAPATH, DEFSPATH, MAINCONFIG, "Hexen 4-map Beta Demo", "Raven Software", "dhexen", 0); + DD_AddGameResource(GID(hexen_demo), RC_PACKAGE, RF_STARTUP, "hexen.wad", "MAP01;MAP04;TINTTAB;FOGMAP;TRANTBLA;DARTA1;ARTIPORK;SKYFOG;TALLYTOP;GROVER"); + DD_AddGameResource(GID(hexen_demo), RC_PACKAGE, RF_STARTUP, STARTUPPK3, 0); + DD_AddGameResource(GID(hexen_demo), RC_DEFINITION, 0, "hexen-demo.ded", 0); return true; #undef STARTUPPK3