Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 24, 2013
1 parent 26f07ed commit 9598da0
Show file tree
Hide file tree
Showing 24 changed files with 113 additions and 131 deletions.
3 changes: 1 addition & 2 deletions doomsday/client/include/resource/material.h
Expand Up @@ -485,8 +485,7 @@ class Material : public de::MapElement
friend struct Material::Instance;

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

/// A list of variant instances.
Expand Down
7 changes: 3 additions & 4 deletions doomsday/client/include/resource/materialarchive.h
@@ -1,7 +1,7 @@
/** @file materialarchive.h Collection of identifier-material pairs.
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -108,8 +108,7 @@ class MaterialArchive
void read(reader_s &reader, int forcedVersion = -1);

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

} // namespace de
Expand Down
5 changes: 2 additions & 3 deletions doomsday/client/include/resource/materialmanifest.h
@@ -1,6 +1,6 @@
/** @file materialmanifest.h Description of a logical material resource.
*
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -133,8 +133,7 @@ class MaterialManifest : public PathTree::Node
static Materials &materials();

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

Q_DECLARE_OPERATORS_FOR_FLAGS(MaterialManifest::Flags)
Expand Down
6 changes: 2 additions & 4 deletions doomsday/client/include/resource/materials.h
Expand Up @@ -114,8 +114,7 @@ class Materials
All const &all() const;

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

/**
Expand Down Expand Up @@ -371,8 +370,7 @@ class Materials
#endif // __CLIENT__

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

Q_DECLARE_OPERATORS_FOR_FLAGS(Materials::UriValidationFlags)
Expand Down
5 changes: 2 additions & 3 deletions doomsday/client/include/resource/materialscheme.h
@@ -1,6 +1,6 @@
/** @file materialscheme.h Material collection subspace.
*
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -99,8 +99,7 @@ class MaterialScheme
Index const &index() const;

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

} // namespace de
Expand Down
5 changes: 2 additions & 3 deletions doomsday/client/include/resource/materialsnapshot.h
@@ -1,6 +1,6 @@
/** @file materialsnapshot.h Logical material state snapshot.
*
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -145,8 +145,7 @@ class MaterialSnapshot
void update();

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

} // namespace de
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/resource/materialvariantspec.h
@@ -1,6 +1,6 @@
/** @file materialvariantspec.h Specialization specification for a variant material.
*
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down
7 changes: 3 additions & 4 deletions doomsday/client/include/resource/texture.h
@@ -1,7 +1,7 @@
/** @file texture.h Logical Texture.
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -202,8 +202,7 @@ class Texture
friend struct Texture::Instance;

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

/// A list of variants.
Expand Down
5 changes: 2 additions & 3 deletions doomsday/client/include/resource/texturemanifest.h
@@ -1,6 +1,6 @@
/** @file texturemanifest.h Description of a logical texture resource.
*
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -174,8 +174,7 @@ class TextureManifest : public PathTree::Node
static Textures &textures();

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

} // namespace de
Expand Down
7 changes: 3 additions & 4 deletions doomsday/client/include/resource/textures.h
@@ -1,7 +1,7 @@
/** @file textures.h Texture Resource Collection.
*
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2010-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2010-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -263,8 +263,7 @@ class Textures
void* parameters = 0) const;

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

Q_DECLARE_OPERATORS_FOR_FLAGS(Textures::UriValidationFlags)
Expand Down
5 changes: 2 additions & 3 deletions doomsday/client/include/resource/texturescheme.h
@@ -1,6 +1,6 @@
/** @file texturescheme.h Texture collection subspace.
*
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -125,8 +125,7 @@ class TextureScheme
void markUniqueIdLutDirty();

private:
struct Instance;
Instance *d;
DENG2_PRIVATE(d)
};

} // namespace de
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/resource/texturevariantspec.h
@@ -1,6 +1,6 @@
/** @file texturevariantspec.h Texture Variant Specification.
*
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/def_main.cpp
Expand Up @@ -819,7 +819,7 @@ static void readAllDefinitions(void)
int p;

// Start with engine's own top-level definition file, it is always read first.
de::Uri searchPath = de::Uri("doomsday.ded", RC_DEFINITION);
de::Uri searchPath("doomsday.ded", RC_DEFINITION);
AutoStr* foundPath = AutoStr_NewStd();
if(F_FindPath(RC_DEFINITION, reinterpret_cast<uri_s*>(&searchPath), foundPath))
{
Expand Down
10 changes: 6 additions & 4 deletions doomsday/client/src/resource/material.cpp
@@ -1,6 +1,6 @@
/** @file material.cpp Logical Material.
*
* @authors Copyright © 2009-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2009-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand All @@ -27,7 +27,7 @@
#include <de/math.h>
#include <QtAlgorithms>

#include "Material"
#include "resource/material.h"

using namespace de;

Expand Down Expand Up @@ -271,7 +271,7 @@ DENG2_PIMPL(Material)
/// @c false= the material is no longer valid.
bool valid;

Instance(Public &a, MaterialManifest &_manifest) : Base(a),
Instance(Public *i, MaterialManifest &_manifest) : Base(i),
manifest(_manifest),
envClass(AEC_UNKNOWN),
flags(0),
Expand Down Expand Up @@ -317,7 +317,7 @@ DENG2_PIMPL(Material)
};

Material::Material(MaterialManifest &_manifest, ded_material_t const *def)
: de::MapElement(DMU_MATERIAL), d(new Instance(*this, _manifest))
: de::MapElement(DMU_MATERIAL), d(new Instance(this, _manifest))
{
DENG_ASSERT(def);
if(def->flags & MATF_NO_DRAW) d->flags |= NoDraw;
Expand Down Expand Up @@ -376,6 +376,8 @@ void Material::ticker(timespan_t time)
{
variant->ticker(time);
}
#else
DENG2_UNUSED(time);
#endif
}

Expand Down
17 changes: 8 additions & 9 deletions doomsday/client/src/resource/materialarchive.cpp
@@ -1,7 +1,7 @@
/** @file materialarchive.cpp Material Archive.
*
* @authors Copyright 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand All @@ -18,14 +18,13 @@
* 02110-1301 USA</small>
*/

#include <de/StringPool>
#include "uri.hh"

#include "de_base.h"
#include "de_console.h"

#include "uri.hh"
#include "Materials"
#include "MaterialArchive"
#include <de/StringPool>

#include "resource/materialarchive.h"

/// For identifying the archived format version. Written to disk.
#define MATERIALARCHIVE_VERSION 4
Expand Down Expand Up @@ -127,7 +126,7 @@ DENG2_PIMPL(MaterialArchive)
/// Used with older versions.
int numFlats;

Instance(Public &a, bool _useSegments) : Base(a),
Instance(Public *i, bool _useSegments) : Base(i),
version(MATERIALARCHIVE_VERSION),
useSegments(_useSegments),
numFlats(0)
Expand Down Expand Up @@ -201,7 +200,7 @@ DENG2_PIMPL(MaterialArchive)
};

MaterialArchive::MaterialArchive(int useSegments, bool recordSymbolicMaterials)
: d(new Instance(*this, useSegments))
: d(new Instance(this, useSegments))
{
if(recordSymbolicMaterials)
{
Expand Down
14 changes: 6 additions & 8 deletions doomsday/client/src/resource/materialmanifest.cpp
@@ -1,6 +1,6 @@
/** @file materialmanifest.cpp Description of a logical material resource.
*
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2011-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand All @@ -18,11 +18,11 @@
*/

#include "de_base.h"

#include "Materials"
#include "MaterialManifest"

namespace de {
#include "resource/materialmanifest.h"

using namespace de;

DENG2_PIMPL(MaterialManifest)
{
Expand All @@ -35,14 +35,14 @@ DENG2_PIMPL(MaterialManifest)
/// Classification flags.
MaterialManifest::Flags flags;

Instance(Public &a) : Base(a),
Instance(Public *i) : Base(i),
material(0),
id(0)
{}
};

MaterialManifest::MaterialManifest(PathTree::NodeArgs const &args)
: Node(args), d(new Instance(*this))
: Node(args), d(new Instance(this))
{}

MaterialManifest::~MaterialManifest()
Expand Down Expand Up @@ -121,5 +121,3 @@ void MaterialManifest::setMaterial(Material *newMaterial)
if(d->material == newMaterial) return;
d->material = newMaterial;
}

} // namespace de
10 changes: 5 additions & 5 deletions doomsday/client/src/resource/materials.cpp
@@ -1,7 +1,7 @@
/** @file materials.cpp Material Resource Collection.
*
* @authors Copyright 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -33,7 +33,7 @@
#include <de/math.h>
#include <QtAlgorithms>

#include "Materials"
#include "resource/materials.h"

/// Number of elements to block-allocate in the material index to material manifest map.
#define MANIFESTIDMAP_BLOCK_ALLOC (32)
Expand Down Expand Up @@ -161,7 +161,7 @@ DENG2_PIMPL(Materials)
uint manifestIdMapSize;
Materials::Manifest **manifestIdMap;

Instance(Public &a) : Base(a),
Instance(Public *i) : Base(i),
manifestCount(0),
manifestIdMapSize(0),
manifestIdMap(0)
Expand Down Expand Up @@ -275,7 +275,7 @@ void Materials::consoleRegister()
#endif
}

Materials::Materials() : d(new Instance(*this))
Materials::Materials() : d(new Instance(this))
{}

Materials::~Materials()
Expand Down

0 comments on commit 9598da0

Please sign in to comment.