Skip to content

Commit

Permalink
Refactor|ResourceSystem|Client|Server: ResourceSystem has ownership o…
Browse files Browse the repository at this point in the history
…f the Fonts collection
  • Loading branch information
danij-deng committed Nov 9, 2013
1 parent cd98111 commit f0f3d5d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions doomsday/client/client.pro
Expand Up @@ -128,6 +128,7 @@ DENG_CONVENIENCE_HEADERS += \
include/EntityDatabase \
include/Face \
include/FontLineWrapping \
include/Fonts \
include/Game \
include/Games \
include/GLTextComposer \
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/include/Fonts
@@ -0,0 +1 @@
#include "resource/fonts.h"
6 changes: 6 additions & 0 deletions doomsday/client/include/resource/resourcesystem.h
Expand Up @@ -23,6 +23,7 @@
#include <de/Error>
#include "resourceclass.h"
#include "Textures"
#include "Fonts"

/**
* Logical resources; materials, packages, textures, etc... @ingroup resource
Expand Down Expand Up @@ -76,6 +77,11 @@ class ResourceSystem : public de::System

patchid_t declarePatch(char const *encodedName);

/**
* Provides access to the Fonts collection.
*/
de::Fonts &fonts();

public: /// @todo Should be private:
void initCompositeTextures();
void initFlatTextures();
Expand Down
9 changes: 9 additions & 0 deletions doomsday/client/src/resource/resourcesystem.cpp
Expand Up @@ -74,6 +74,8 @@ DENG2_PIMPL(ResourceSystem)
QList<PatchName> patchNames;
Textures textures;

Fonts fonts;

Instance(Public *i) : Base(i)
{
LOG_AS("ResourceSystem");
Expand All @@ -99,6 +101,8 @@ DENG2_PIMPL(ResourceSystem)
textures.createScheme("ModelReflectionSkins");
textures.createScheme("Lightmaps");
textures.createScheme("Flaremaps");

/// @todo Initialize font resource schemes here.
}

~Instance()
Expand Down Expand Up @@ -958,3 +962,8 @@ patchid_t ResourceSystem::declarePatch(char const *encodedName)
}
return 0;
}

Fonts &ResourceSystem::fonts()
{
return d->fonts;
}

0 comments on commit f0f3d5d

Please sign in to comment.