Skip to content

Commit

Permalink
Cleanup|libdoomsday: Renamed res::System to Resources
Browse files Browse the repository at this point in the history
Continuing the de-System-ification of the classes. Subsystems should
be named according to their domain: World, Resources, etc. Also, the
primary class of a domain should not be in the domain's namespace,
but in the top-level/global namespace.

(FileSystem and WindowSystem have "system" in the name because those
are the commonly used terms for the domains.)
  • Loading branch information
skyjake committed Jan 10, 2016
1 parent 12b6bf0 commit bd084ed
Show file tree
Hide file tree
Showing 21 changed files with 83 additions and 92 deletions.
6 changes: 3 additions & 3 deletions doomsday/apps/client/include/resource/resourcesystem.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 RESOURCESYSTEM_H
Expand All @@ -32,7 +32,7 @@
#include <doomsday/filesys/zip.h>
#include <doomsday/uri.h>
#include <doomsday/resource/mapmanifest.h>
#include <doomsday/resource/system.h>
#include <doomsday/resource/resources.h>

#include "resource/animgroup.h"
#include "resource/colorpalette.h"
Expand Down Expand Up @@ -84,7 +84,7 @@
*
* @ingroup resource
*/
class ResourceSystem : public res::System
class ResourceSystem : public Resources
{
public:
/// An unknown resource scheme was referenced. @ingroup errors
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/dd_main.cpp
Expand Up @@ -587,7 +587,7 @@ ::audio::System &App_AudioSystem()

ResourceSystem &App_ResourceSystem()
{
return static_cast<ResourceSystem &>(res::System::get());
return static_cast<ResourceSystem &>(Resources::get());
}

ClientServerWorld &App_World()
Expand Down
28 changes: 14 additions & 14 deletions doomsday/apps/client/src/def_main.cpp
Expand Up @@ -106,7 +106,7 @@ void Def_Init()

// Make the definitions visible in the global namespace.
App::app().scriptSystem().addNativeModule("Defs", defs.names);

// Constants for definitions.
DENG2_ADD_NUMBER_CONSTANT(defs.names, SN_SPAWN);
DENG2_ADD_NUMBER_CONSTANT(defs.names, SN_SEE);
Expand Down Expand Up @@ -822,7 +822,7 @@ static void redecorateMaterial(Material &material, Record const &def)
}
}
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error
}

Expand Down Expand Up @@ -1015,7 +1015,7 @@ static void configureMaterial(Material &mat, Record const &definition)
dstage0.variance = stage0.variance;
}
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}
}
Expand Down Expand Up @@ -1053,7 +1053,7 @@ static void configureMaterial(Material &mat, Record const &definition)
maskTexture = &resSys().textureScheme("Masks")
.findByResourceUri(*shineDef->stage.maskTexture);
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}

Expand All @@ -1073,7 +1073,7 @@ static void configureMaterial(Material &mat, Record const &definition)
sstage0.variance = stage0.variance;
}
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}
}
Expand Down Expand Up @@ -1115,7 +1115,7 @@ static void interpretMaterialDef(Record const &definition)
manifest->setFlags(MaterialManifest::Custom);
}
}
catch(res::System::MissingResourceManifestError const &er)
catch(Resources::MissingResourceManifestError const &er)
{
// Log but otherwise ignore this error.
LOG_RES_WARNING("Ignoring unknown texture \"%s\" in Material \"%s\" (layer 0 stage 0): %s")
Expand Down Expand Up @@ -1244,7 +1244,7 @@ void Def_Read()
for(dint i = 0; i < runtimeDefs.mobjInfo.size(); ++i)
{
Record *dmo = &defs.things[i];

// Make sure duplicate defs overwrite the earliest.
mobjinfo_t *mo = &runtimeDefs.mobjInfo[defs.getMobjNum(dmo->gets("id"))];

Expand All @@ -1264,18 +1264,18 @@ void Def_Read()

auto const &states = dmo->geta("states");
auto const &sounds = dmo->geta("sounds");

for(dint k = 0; k < STATENAMES_COUNT; ++k)
{
mo->states[k] = Def_StateForMobj(states[k].asText());
}

mo->seeSound = defs.getSoundNum(sounds[SDN_SEE].asText());
mo->attackSound = defs.getSoundNum(sounds[SDN_ATTACK].asText());
mo->painSound = defs.getSoundNum(sounds[SDN_PAIN].asText());
mo->deathSound = defs.getSoundNum(sounds[SDN_DEATH].asText());
mo->activeSound = defs.getSoundNum(sounds[SDN_ACTIVE].asText());

for(dint k = 0; k < NUM_MOBJ_MISC; ++k)
{
mo->misc[k] = dmo->geta("misc")[k].asInt();
Expand Down Expand Up @@ -1576,7 +1576,7 @@ static void initMaterialGroup(ded_group_t &def)
}
#endif
}
catch(res::System::MissingResourceManifestError const &er)
catch(Resources::MissingResourceManifestError const &er)
{
// Log but otherwise ignore this error.
LOG_RES_WARNING("Unknown material \"%s\" in group def %i: %s")
Expand Down Expand Up @@ -1730,7 +1730,7 @@ void Def_CopyLineType(linetype_t *l, ded_linetype_t *def)
{
l->actMaterial = resSys().materialManifest(*def->actMaterial).id();
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}

Expand All @@ -1740,7 +1740,7 @@ void Def_CopyLineType(linetype_t *l, ded_linetype_t *def)
{
l->deactMaterial = resSys().materialManifest(*def->deactMaterial).id();
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}

Expand Down Expand Up @@ -1779,7 +1779,7 @@ void Def_CopyLineType(linetype_t *l, ded_linetype_t *def)
{
l->iparm[k] = resSys().materialManifest(de::Uri(def->iparmStr[k], RC_NULL)).id();
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/render/r_main.cpp
Expand Up @@ -187,7 +187,7 @@ void Rend_Draw2DPlayerSprites()
rendpspriteparams_t parm; setupPSpriteParams(parm, vs);
Rend_DrawPSprite(parm);
}
catch(res::System::MissingResourceManifestError const &er)
catch(Resources::MissingResourceManifestError const &er)
{
// Log but otherwise ignore this error.
state_t const &state = *vs.psp->statePtr;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/render/r_things.cpp
Expand Up @@ -556,7 +556,7 @@ void R_ProjectSprite(mobj_t &mob)
LOG_GL_WARNING("Projecting flare source for sprite '%i' frame '%i': %s")
<< mob.sprite << mob.frame << er.asText();
}
catch(res::System::MissingResourceManifestError const &er)
catch(Resources::MissingResourceManifestError const &er)
{
// Log but otherwise ignore this error.
LOG_GL_WARNING("Projecting flare source for sprite '%i' frame '%i': %s")
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/render/rend_font.cpp
Expand Up @@ -1038,7 +1038,7 @@ static void parseParamaterBlock(char** strPtr, drawtextstate_t* state, int* numB
state->fontNum = App_ResourceSystem().fontManifest(de::Uri(buf, RC_NULL)).uniqueId();
continue;
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{}
}

Expand Down Expand Up @@ -1556,7 +1556,7 @@ DENG_EXTERN_C fontid_t Fonts_ResolveUri(uri_s const *uri)
{
return App_ResourceSystem().fontManifest(*reinterpret_cast<de::Uri const *>(uri)).uniqueId();
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{}
return NOFONTID;
}
Expand Down
10 changes: 5 additions & 5 deletions doomsday/apps/client/src/resource/api_material.cpp
@@ -1,7 +1,7 @@
/** @file api_material.cpp Material API.
*
* @authors Copyright © 2014 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2015 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2014 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2015 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -45,7 +45,7 @@ DENG_EXTERN_C Material *DD_MaterialForTextureUri(uri_s const *textureUri)
// Log but otherwise ignore this error.
LOG_RES_WARNING(er.asText() + ", ignoring.");
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.

return nullptr; // Not found.
Expand All @@ -65,7 +65,7 @@ DENG_EXTERN_C materialid_t Materials_ResolveUri(struct uri_s const *uri)
{
return App_ResourceSystem().materialManifest(*reinterpret_cast<de::Uri const *>(uri)).id();
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
return NOMATERIALID;
}
Expand All @@ -79,7 +79,7 @@ DENG_EXTERN_C materialid_t Materials_ResolveUriCString(char const *uriCString)
{
return App_ResourceSystem().materialManifest(de::Uri(uriCString, RC_NULL)).id();
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}
return NOMATERIALID;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/resource/api_resource.cpp
Expand Up @@ -40,7 +40,7 @@ DENG_EXTERN_C int Textures_UniqueId2(uri_s const *_uri, dd_bool quiet)
{
return App_ResourceSystem().textureManifest(uri).uniqueId();
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{
// Log but otherwise ignore this error.
if(!quiet)
Expand Down Expand Up @@ -82,7 +82,7 @@ DENG_EXTERN_C void R_AddAnimGroupFrame(int groupId, uri_s const *textureUri_, in
LOG_DEBUG("Unknown anim group #%i, ignoring.") << groupId;
}
}
catch(res::System::MissingResourceManifestError const &er)
catch(Resources::MissingResourceManifestError const &er)
{
// Log but otherwise ignore this error.
LOG_RES_WARNING(er.asText() + ". Failed adding texture \"%s\" to group #%i, ignoring.")
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/resource/material.cpp
Expand Up @@ -240,7 +240,7 @@ DENG2_PIMPL(Material)
}
catch(TextureManifest::MissingTextureError &)
{}
catch(res::System::MissingResourceManifestError &)
catch(Resources::MissingResourceManifestError &)
{}
}
}
Expand Down Expand Up @@ -597,7 +597,7 @@ D_CMD(InspectMaterial)
}
return true;
}
catch(res::System::MissingResourceManifestError const &er)
catch(Resources::MissingResourceManifestError const &er)
{
LOG_SCR_WARNING("%s") << er.asText();
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/resource/materialanimator.cpp
Expand Up @@ -260,7 +260,7 @@ static Texture *findTextureForAnimationStage(MaterialTextureLayer::AnimationStag
}
catch(TextureManifest::MissingTextureError &)
{}
catch(res::System::MissingResourceManifestError &)
catch(Resources::MissingResourceManifestError &)
{}
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/resource/materialarchive.cpp
Expand Up @@ -99,7 +99,7 @@ static Material *findRecordMaterial(Records &records, SerialId id)
{
material = &App_ResourceSystem().material(Uri(records.stringRef(id), RC_NULL));
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.

records.setUserPointer(id, material);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/resource/resourcesystem.cpp
Expand Up @@ -3939,7 +3939,7 @@ static bool comparePathTreeNodePathsAscending(PathTreeNodeType const *a, PathTre
*/
static dint printMapsIndex2(Path const &like, de::Uri::ComposeAsTextFlags composeUriFlags)
{
res::System::MapManifests::FoundNodes found;
Resources::MapManifests::FoundNodes found;
App_ResourceSystem().allMapManifests().findAll(found, pathBeginsWithComparator, const_cast<Path *>(&like));
if(found.isEmpty()) return 0;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/resource/texture.cpp
Expand Up @@ -401,7 +401,7 @@ D_CMD(InspectTexture)
}
return true;
}
catch(res::System::MissingResourceManifestError const &er)
catch(Resources::MissingResourceManifestError const &er)
{
LOG_RES_WARNING("%s.") << er.asText();
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/infine/finaleinterpreter.cpp
Expand Up @@ -1376,7 +1376,7 @@ DEFFC(BGMaterial)
}
catch(MaterialManifest::MissingMaterialError const &)
{} // Ignore this error.
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.

changePageBackground(fi.page(FinaleInterpreter::Anims), material);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/ui_main.cpp
Expand Up @@ -141,7 +141,7 @@ static void loadFontIfNeeded(char const *uri, fontid_t *fid)
*fid = fontid_t(manifest.uniqueId());
}
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{}
}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/world/api_mapedit.cpp
Expand Up @@ -133,15 +133,15 @@ static Material *findMaterialInDict(String const &materialUriStr)
{
material = &App_ResourceSystem().material(materialUri);
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{
// Try any scheme.
try
{
materialUri.setScheme("");
material = &App_ResourceSystem().material(materialUri);
}
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{}
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/world/map.cpp
Expand Up @@ -1411,7 +1411,7 @@ DENG2_PIMPL(Map)
}
catch(MaterialManifest::MissingMaterialError const &)
{} // Ignore this error.
catch(res::System::MissingResourceManifestError const &)
catch(Resources::MissingResourceManifestError const &)
{} // Ignore this error.
}

Expand Down

0 comments on commit bd084ed

Please sign in to comment.