diff --git a/doomsday/apps/client/include/dd_main.h b/doomsday/apps/client/include/dd_main.h index f9f040eb5c..d48f1bcd45 100644 --- a/doomsday/apps/client/include/dd_main.h +++ b/doomsday/apps/client/include/dd_main.h @@ -85,17 +85,17 @@ void DD_UpdateEngineState(); /** * Switch to/activate the specified game. */ -bool App_ChangeGame(de::Game &game, bool allowReload = false); +bool App_ChangeGame(Game &game, bool allowReload = false); /** * Returns the application's global Games (collection). */ -de::Games &App_Games(); +Games &App_Games(); /** * Returns the current game from the application's global collection. */ -de::Game &App_CurrentGame(); +Game &App_CurrentGame(); /** * Frees the info structures for all registered games. diff --git a/doomsday/apps/client/include/resource/mapdef.h b/doomsday/apps/client/include/resource/mapdef.h index 84e0b9edcd..f29923d34b 100644 --- a/doomsday/apps/client/include/resource/mapdef.h +++ b/doomsday/apps/client/include/resource/mapdef.h @@ -52,7 +52,7 @@ class MapDef : public de::PathTree::Node, public de::Record /** * Returns the id used to uniquely reference the map in some (old) definitions. */ - de::String composeUniqueId(de::Game const ¤tGame) const; + de::String composeUniqueId(Game const ¤tGame) const; MapDef &setSourceFile(de::File1 *newSourceFile); diff --git a/doomsday/apps/client/src/dd_main.cpp b/doomsday/apps/client/src/dd_main.cpp index 26df1b6ee5..c7ebd341b8 100644 --- a/doomsday/apps/client/src/dd_main.cpp +++ b/doomsday/apps/client/src/dd_main.cpp @@ -1198,7 +1198,7 @@ static dint DD_ActivateGameWorker(void *context) return 0; } -de::Games &App_Games() +Games &App_Games() { if(App::appExists()) { @@ -1218,7 +1218,7 @@ void App_ClearGames() App::app().setGame(App_Games().nullGame()); } -static void populateGameInfo(GameInfo &info, de::Game &game) +static void populateGameInfo(GameInfo &info, Game &game) { info.identityKey = AutoStr_FromTextStd(game.identityKey().toUtf8().constData()); info.title = AutoStr_FromTextStd(game.title().toUtf8().constData()); @@ -1318,7 +1318,7 @@ gameid_t DD_GameIdForKey(char const *identityKey) return 0; // Invalid id. } -de::Game &App_CurrentGame() +Game &App_CurrentGame() { return DoomsdayApp::currentGame(); } @@ -1811,7 +1811,7 @@ static void initialize() // Attempt automatic game selection. if(!CommandLine_Exists("-noautoselect") || isDedicated) { - if(de::Game *game = DD_AutoselectGame()) + if(Game *game = DD_AutoselectGame()) { // An implicit game session profile has been defined. // Add all resources specified using -file options on the command line diff --git a/doomsday/apps/client/src/def_main.cpp b/doomsday/apps/client/src/def_main.cpp index e3d278c312..3ab3df11ff 100644 --- a/doomsday/apps/client/src/def_main.cpp +++ b/doomsday/apps/client/src/def_main.cpp @@ -495,7 +495,7 @@ static void readAllDefinitions() if(App_GameLoaded()) { - de::Game &game = App_CurrentGame(); + Game &game = App_CurrentGame(); // Some games use definitions that are translated to DED. QStringList mapInfoUrns = allMapInfoUrns(); diff --git a/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp b/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp index 94910be714..455e68a8f0 100644 --- a/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp @@ -266,7 +266,7 @@ DENG_GUI_PIMPL(TaskBarWidget) void showOrHideMenuItems() { - de::Game &game = App_CurrentGame(); + Game &game = App_CurrentGame(); itemWidget(mainMenu, POS_GAMES) .show(!game.isNull()); itemWidget(mainMenu, POS_UNLOAD) .show(!game.isNull()); diff --git a/doomsday/apps/libdoomsday/include/doomsday/doomsdayapp.h b/doomsday/apps/libdoomsday/include/doomsday/doomsdayapp.h index 74c7641fac..7fe885fff6 100644 --- a/doomsday/apps/libdoomsday/include/doomsday/doomsdayapp.h +++ b/doomsday/apps/libdoomsday/include/doomsday/doomsdayapp.h @@ -24,6 +24,8 @@ #include "busymode.h" #include "gameapi.h" +class Players; + /** * Common application-level state and components. * @@ -46,8 +48,9 @@ class LIBDOOMSDAY_PUBLIC DoomsdayApp public: static DoomsdayApp &app(); static Plugins &plugins(); - static de::Games &games(); - static de::Game ¤tGame(); + static Games &games(); + static Players &players(); + static Game ¤tGame(); static BusyMode &busyMode(); private: diff --git a/doomsday/apps/libdoomsday/include/doomsday/game.h b/doomsday/apps/libdoomsday/include/doomsday/game.h index 45874264dd..ede78ed6c6 100644 --- a/doomsday/apps/libdoomsday/include/doomsday/game.h +++ b/doomsday/apps/libdoomsday/include/doomsday/game.h @@ -65,10 +65,7 @@ typedef struct gamedef_s { #include class ResourceManifest; - -namespace de { - -class File1; +namespace de { class File1; } /** * Records top-level game configurations registered by the loaded game plugin(s). @@ -97,12 +94,12 @@ class Game : public de::game::Game * @param legacySavegameSubfoler Game-specific subdirectory of /home for legacy savegames. * @param mapMapInfo Base relative path to the main MAPINFO definition data. */ - Game(String const &identityKey, Path const &configDir, - String const &title = "Unnamed", - String const &author = "Unknown", - String const &legacySavegameNameExp = "", - String const &legacySavegameSubfolder = "", - String const &mainMapInfo = ""); + Game(de::String const &identityKey, de::Path const &configDir, + de::String const &title = "Unnamed", + de::String const &author = "Unknown", + de::String const &legacySavegameNameExp = "", + de::String const &legacySavegameSubfolder = "", + de::String const &mainMapInfo = ""); virtual ~Game(); @@ -118,13 +115,13 @@ class Game : public de::game::Game * * @see status() */ - String const &statusAsText() const; + de::String const &statusAsText() const; /** * Returns information about the game as styled text. Printed by "inspectgame", * for instance. */ - String description() const; + de::String description() const; /** * Returns the unique identifier of the plugin which registered the game. @@ -175,7 +172,7 @@ class Game : public de::game::Game /** * Returns the regular expression used for locating legacy savegame files. */ - String legacySavegameNameExp() const; + de::String legacySavegameNameExp() const; /** * Determine the absolute path to the legacy savegame folder for the game. If there is @@ -183,7 +180,7 @@ class Game : public de::game::Game * the introduction of the modern, package-based .save format) then a zero length string * is returned. */ - String legacySavegamePath() const; + de::String legacySavegamePath() const; /** * Add a new manifest to the list of manifests. @@ -213,7 +210,7 @@ class Game : public de::game::Game * * @return @c true iff @a file is required by this game. */ - bool isRequiredFile(File1 &file); + bool isRequiredFile(de::File1 &file); public: /** @@ -239,7 +236,7 @@ class Game : public de::game::Game * @param withStatus @c true to include the current availability/load status * of each file. */ - String filesAsText(int rflags, bool withStatus = true) const; + de::String filesAsText(int rflags, bool withStatus = true) const; static void printFiles(Game const &game, int rflags, bool printStatus = true); @@ -270,8 +267,6 @@ class NullGame : public Game } }; -} // namespace de - #endif // __cplusplus #endif /* LIBDOOMSDAY_GAME_H */ diff --git a/doomsday/apps/libdoomsday/include/doomsday/games.h b/doomsday/apps/libdoomsday/include/doomsday/games.h index edad9bac55..980f4aeefb 100644 --- a/doomsday/apps/libdoomsday/include/doomsday/games.h +++ b/doomsday/apps/libdoomsday/include/doomsday/games.h @@ -27,10 +27,8 @@ #include #include -namespace de { - /** - * Encapsulates a collection of de::Game instances and the logical operations + * Encapsulates a collection of Game instances and the logical operations * which are performed upon it (such as searches and various index printing * algorithms). * @@ -91,7 +89,7 @@ class Games * * @throws NotFoundError if no game is associated with @a identityKey. */ - Game &byIdentityKey(String identityKey) const; + Game &byIdentityKey(de::String identityKey) const; /** * @return Game associated with @a gameId. @@ -161,6 +159,4 @@ class Games DENG2_PRIVATE(d) }; -} // namespace de - #endif // LIBDOOMSDAY_GAMES_H diff --git a/doomsday/apps/libdoomsday/include/doomsday/players.h b/doomsday/apps/libdoomsday/include/doomsday/players.h new file mode 100644 index 0000000000..d90684c3f8 --- /dev/null +++ b/doomsday/apps/libdoomsday/include/doomsday/players.h @@ -0,0 +1,38 @@ +/** @file doomsday/players.h + * + * @authors Copyright (c) 2015 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. This program is distributed in the hope that it + * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. You should have received a copy of the GNU + * General Public License along with this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBDOOMSDAY_PLAYERS_H +#define LIBDOOMSDAY_PLAYERS_H + +#include "libdoomsday.h" + +/** + * Base class for player state: common functionality shared by both the server + * and the client. + */ +class LIBDOOMSDAY_PUBLIC Players +{ +public: + Players(); + +private: + DENG2_PRIVATE(d) +}; + +#endif // LIBDOOMSDAY_PLAYERS_H + diff --git a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp index 43cd7194dd..dd3829db62 100644 --- a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp +++ b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp @@ -192,7 +192,7 @@ Games &DoomsdayApp::games() Game &DoomsdayApp::currentGame() { - return App::game().as(); + return App::game().as(); } BusyMode &DoomsdayApp::busyMode() diff --git a/doomsday/apps/libdoomsday/src/game.cpp b/doomsday/apps/libdoomsday/src/game.cpp index 189badcbb8..e2d00e67a1 100644 --- a/doomsday/apps/libdoomsday/src/game.cpp +++ b/doomsday/apps/libdoomsday/src/game.cpp @@ -32,7 +32,7 @@ #include #include -namespace de { +using namespace de; DENG2_PIMPL(Game) { @@ -391,5 +391,3 @@ void Game::consoleRegister() //static NullGame::NullGame() : Game("" /*null*/, "doomsday", "null-game", "null-game") {} - -} // namespace de diff --git a/doomsday/apps/libdoomsday/src/games.cpp b/doomsday/apps/libdoomsday/src/games.cpp index 6e5c410b24..64163819db 100644 --- a/doomsday/apps/libdoomsday/src/games.cpp +++ b/doomsday/apps/libdoomsday/src/games.cpp @@ -32,7 +32,7 @@ #include #include -namespace de { +using namespace de; DENG2_PIMPL(Games) { @@ -364,5 +364,3 @@ void Games::consoleRegister() //static Game::consoleRegister(); } - -} // namespace de diff --git a/doomsday/apps/libdoomsday/src/players.cpp b/doomsday/apps/libdoomsday/src/players.cpp new file mode 100644 index 0000000000..aa1d891c4f --- /dev/null +++ b/doomsday/apps/libdoomsday/src/players.cpp @@ -0,0 +1,29 @@ +/** @file doomsday/players.cpp + * + * @authors Copyright (c) 2015 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. This program is distributed in the hope that it + * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. You should have received a copy of the GNU + * General Public License along with this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "doomsday/players.h" + +using namespace de; + +DENG2_PIMPL_NOREF(Players) +{ + +}; + +Players::Players() : d(new Instance) +{} diff --git a/doomsday/apps/server/src/shelluser.cpp b/doomsday/apps/server/src/shelluser.cpp index 2fabe3614a..11154e89bc 100644 --- a/doomsday/apps/server/src/shelluser.cpp +++ b/doomsday/apps/server/src/shelluser.cpp @@ -96,7 +96,7 @@ void ShellUser::sendInitialUpdate() void ShellUser::sendGameState() { - de::Game &game = App_CurrentGame(); + Game &game = App_CurrentGame(); String mode = (App_GameLoaded()? game.identityKey() : ""); /** diff --git a/doomsday/sdk/libcore/include/de/game/game.h b/doomsday/sdk/libcore/include/de/game/game.h index b6b0b91021..1599a37878 100644 --- a/doomsday/sdk/libcore/include/de/game/game.h +++ b/doomsday/sdk/libcore/include/de/game/game.h @@ -35,7 +35,7 @@ namespace game { *
load doom2
* * @todo The 'game' namespace can be removed once the client/server apps don't - * declare their own de::Game classes any more. + * declare their own Game classes any more. */ class DENG2_PUBLIC Game {