Skip to content

Commit

Permalink
Refactor|libdoomsday|Client|Server: Renamed WorldSystem to World
Browse files Browse the repository at this point in the history
The app-level class is currently called ClientServerWorld because it
is still a ifdef'd hybrid.
  • Loading branch information
skyjake committed Dec 29, 2015
1 parent c788374 commit 9ae0d10
Show file tree
Hide file tree
Showing 64 changed files with 298 additions and 331 deletions.
6 changes: 3 additions & 3 deletions doomsday/apps/client/include/clientapp.h
Expand Up @@ -14,7 +14,7 @@
* 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</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef CLIENTAPP_H
Expand All @@ -33,7 +33,7 @@
#include "resource/resourcesystem.h"
#include "updater.h"
#include "busyrunner.h"
#include "world/worldsystem.h"
#include "world/clientserverworld.h"

/**
* The client application.
Expand Down Expand Up @@ -77,7 +77,7 @@ class ClientApp : public de::BaseGuiApp, public DoomsdayApp
static ::audio::System &audioSystem();
static RenderSystem &renderSystem();
static ResourceSystem &resourceSystem();
static WorldSystem &worldSystem();
static ClientServerWorld &world();

static bool hasInputSystem();
static bool hasRenderSystem();
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/dd_main.h
Expand Up @@ -31,7 +31,7 @@

#include "audio/system.h"
#include "resource/resourcesystem.h"
#include "world/worldsystem.h"
#include "world/clientserverworld.h"
#include "ui/infine/infinesystem.h"

namespace de {
Expand Down Expand Up @@ -70,7 +70,7 @@ InFineSystem &App_InFineSystem();
ResourceSystem &App_ResourceSystem();

/// Returns the application's global WorldSystem.
WorldSystem &App_WorldSystem();
ClientServerWorld &App_World();

#undef Con_Open

Expand Down
Expand Up @@ -25,7 +25,7 @@
#include <de/Error>
#include <de/Observers>
#include <de/Vector>
#include <doomsday/world/system.h>
#include <doomsday/world/world.h>
#include <doomsday/uri.h>

#ifdef __CLIENT__
Expand All @@ -46,7 +46,7 @@ namespace de { class Map; }
*
* @ingroup world
*/
class WorldSystem : public world::System
class ClientServerWorld : public World
{
public:
/// No map is currently loaded. @ingroup errors
Expand All @@ -64,7 +64,7 @@ class WorldSystem : public world::System
/**
* Construct a new world system (no map is loaded by default).
*/
WorldSystem();
ClientServerWorld();

/**
* To be called to reset the world back to the initial state. Any currently
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/world/hand.h
Expand Up @@ -21,7 +21,7 @@
#define DENG_WORLD_HAND_H

#include "Grabbable"
#include "world/worldsystem.h"
#include "world/clientserverworld.h"

#include <de/Observers>
#include <de/Vector>
Expand All @@ -46,7 +46,7 @@ namespace internal {
*
* @ingroup world
*/
class Hand : DENG2_OBSERVES(WorldSystem, FrameEnd)
class Hand : DENG2_OBSERVES(ClientServerWorld, FrameEnd)
{
DENG2_NO_COPY (Hand)
DENG2_NO_ASSIGN(Hand)
Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/include/world/map.h
Expand Up @@ -42,7 +42,7 @@
# include "client/clplanemover.h"
# include "client/clpolymover.h"

# include "world/worldsystem.h"
# include "world/clientserverworld.h"
# include "Generator"

# include "BiasSource"
Expand Down Expand Up @@ -80,7 +80,7 @@ class Thinkers;
*/
class Map : public world::Map
#ifdef __CLIENT__
, DENG2_OBSERVES(WorldSystem, FrameBegin)
, DENG2_OBSERVES(ClientServerWorld, FrameBegin)
#endif
{
DENG2_NO_COPY (Map)
Expand Down Expand Up @@ -585,7 +585,7 @@ class Map : public world::Map
* Returns @c true if the given @a point is outside all map subspaces.
*/
bool isPointInVoid(de::Vector3d const &pos) const;

/**
* Returns the total number of subspaces in the map.
*/
Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/src/client/cl_main.cpp
Expand Up @@ -101,7 +101,7 @@ void Cl_CleanUp()
App_AudioSystem().aboutToUnloadMap();

// Reset the local world state.
App_WorldSystem().reset();
App_World().reset();

// Discard the translation tables for the server we've just left.
Cl_ResetTransTables();
Expand Down Expand Up @@ -470,9 +470,9 @@ void Cl_Ticker(timespan_t ticLength)
#endif
}

if(App_WorldSystem().hasMap())
if(App_World().hasMap())
{
App_WorldSystem().map().expireClMobjs();
App_World().map().expireClMobjs();
}
}

Expand Down
8 changes: 4 additions & 4 deletions doomsday/apps/client/src/client/cl_mobj.cpp
Expand Up @@ -331,7 +331,7 @@ static dd_bool ClMobj_IsStuckInsideLocalPlayer(mobj_t *mo)
void ClMobj_ReadDelta()
{
/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();

thid_t const id = Reader_ReadUInt16(msgReader); // Read the ID.
int const df = Reader_ReadUInt16(msgReader); // Flags.
Expand Down Expand Up @@ -581,7 +581,7 @@ void ClMobj_ReadNullDelta()
LOG_AS("ClMobj_ReadNullDelta");

/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();

// The delta only contains an ID.
thid_t id = Reader_ReadUInt16(msgReader);
Expand Down Expand Up @@ -619,10 +619,10 @@ void ClMobj_ReadNullDelta()
#undef ClMobj_Find
mobj_t *ClMobj_Find(thid_t id)
{
if(!App_WorldSystem().hasMap()) return nullptr;
if(!App_World().hasMap()) return nullptr;

/// @todo Do not assume the CURRENT map.
return App_WorldSystem().map().clMobjFor(id);
return App_World().map().clMobjFor(id);
}

// cl_player.c
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/client/cl_player.cpp
Expand Up @@ -283,7 +283,7 @@ void ClPlayer_ReadDelta()
LOG_AS("ClPlayer_ReadDelta2");

/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();

int df = 0;
ushort num;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/client/cl_sound.cpp
Expand Up @@ -38,7 +38,7 @@ void Cl_ReadSoundDelta(deltatype_t type)
LOG_AS("Cl_ReadSoundDelta");

/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();

dint sound = 0, soundFlags = 0;
mobj_t *cmo = 0;
Expand Down Expand Up @@ -224,7 +224,7 @@ void Cl_Sound()
LOG_AS("Cl_Sound");

/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();

byte const flags = Reader_ReadByte(::msgReader);

Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/src/client/cl_world.cpp
Expand Up @@ -154,7 +154,7 @@ int Cl_LocalMobjState(int serverMobjState)
void Cl_ReadSectorDelta(int /*deltaType*/)
{
/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();

#define PLN_FLOOR 0
#define PLN_CEILING 1
Expand Down Expand Up @@ -261,7 +261,7 @@ void Cl_ReadSectorDelta(int /*deltaType*/)
void Cl_ReadSideDelta(int /*deltaType*/)
{
/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();

int const index = Reader_ReadUInt16(msgReader);
int const df = Reader_ReadPackedUInt32(msgReader); // Flags.
Expand Down Expand Up @@ -351,7 +351,7 @@ void Cl_ReadSideDelta(int /*deltaType*/)
void Cl_ReadPolyDelta()
{
/// @todo Do not assume the CURRENT map.
Map &map = App_WorldSystem().map();
Map &map = App_World().map();
Polyobj &pob = map.polyobj(Reader_ReadPackedUInt16(msgReader));

int const df = Reader_ReadByte(msgReader); // Flags.
Expand Down
20 changes: 10 additions & 10 deletions doomsday/apps/client/src/clientapp.cpp
Expand Up @@ -134,7 +134,7 @@ DENG2_PIMPL(ClientApp)
ClientWindowSystem *winSys;
InFineSystem infineSys; // instantiated at construction time
ServerLink *svLink;
WorldSystem *worldSys;
ClientServerWorld *world;

/**
* Log entry sink that passes warning messages to the main window's alert
Expand Down Expand Up @@ -169,9 +169,9 @@ DENG2_PIMPL(ClientApp)
// We don't want to raise alerts about problems in id/Raven WADs,
// since these just have to be accepted by the user.
if((entry.metadata() & LogEntry::Map) &&
ClientApp::worldSystem().hasMap())
ClientApp::world().hasMap())
{
Map const &map = ClientApp::worldSystem().map();
Map const &map = ClientApp::world().map();
if(map.hasManifest() && !map.manifest().sourceFile()->hasCustom())
{
return *this;
Expand Down Expand Up @@ -207,7 +207,7 @@ DENG2_PIMPL(ClientApp)
, winSys (0)
//, infineSys (0)
, svLink (0)
, worldSys (0)
, world (0)
{
clientAppSingleton = thisPublic;

Expand Down Expand Up @@ -235,7 +235,7 @@ DENG2_PIMPL(ClientApp)
}

updater.reset();
delete worldSys;
delete world;
//delete infineSys;
delete winSys;
delete svLink;
Expand Down Expand Up @@ -478,8 +478,8 @@ void ClientApp::initialize()
//addSystem(*d->infineSys);

// Create the world system.
d->worldSys = new WorldSystem;
addSystem(*d->worldSys);
d->world = new ClientServerWorld;
addSystem(*d->world);

// Finally, run the bootstrap script.
scriptSystem().importModule("bootstrap");
Expand Down Expand Up @@ -631,11 +631,11 @@ ClientWindowSystem &ClientApp::windowSystem()
return *a.d->winSys;
}

WorldSystem &ClientApp::worldSystem()
ClientServerWorld &ClientApp::world()
{
ClientApp &a = ClientApp::app();
DENG2_ASSERT(a.d->worldSys != 0);
return *a.d->worldSys;
DENG2_ASSERT(a.d->world != 0);
return *a.d->world;
}

void ClientApp::openHomepageInBrowser()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/dd_loop.cpp
Expand Up @@ -286,7 +286,7 @@ static void advanceTime(timespan_t delta)
}

// World time always advances unless a local game is paused on client-side.
App_WorldSystem().advanceTime(delta);
App_World().advanceTime(delta);
}

void DD_ResetTimer()
Expand Down

0 comments on commit 9ae0d10

Please sign in to comment.