Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jan 7, 2013
1 parent beab095 commit 3a6768e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
34 changes: 19 additions & 15 deletions doomsday/engine/include/resource/materials.h
Expand Up @@ -266,6 +266,19 @@ class Materials
void cache(material_t &material, MaterialVariantSpec const &spec,
bool smooth, bool cacheGroups = true);

/**
* Prepare variant @a material for render (e.g., upload textures if necessary).
*
* @see chooseVariant()
*
* @param material MaterialVariant to be prepared.
* @param forceSnapshotUpdate @c true= Force an update of the variant's state snapshot.
*
* @return Snapshot for the chosen and prepared variant of Material.
*/
MaterialSnapshot const &prepare(MaterialVariant &material,
bool forceSnapshotUpdate = false);

/**
* Choose/create a variant of @a material which fulfills @a spec and then
* immediately prepare it for render (e.g., upload textures if necessary).
Expand All @@ -282,21 +295,12 @@ class Materials
*
* @return Snapshot for the chosen and prepared variant of Material.
*/
MaterialSnapshot const &prepare(material_t &material, MaterialVariantSpec const &spec,
bool smooth, bool forceSnapshotUpdate = false);

/**
* Prepare variant @a material for render (e.g., upload textures if necessary).
*
* @see chooseVariant()
*
* @param material MaterialVariant to be prepared.
* @param forceSnapshotUpdate @c true= Force an update of the variant's state snapshot.
*
* @return Snapshot for the chosen and prepared variant of Material.
*/
MaterialSnapshot const &prepare(MaterialVariant &material,
bool forceSnapshotUpdate = false);
inline MaterialSnapshot const &prepare(material_t &material,
MaterialVariantSpec const &spec, bool smooth = true, bool forceSnapshotUpdate = false)
{
return prepare(*Material_ChooseVariant(&material, spec, smooth, true /*can-create*/),
forceSnapshotUpdate);
}

/// @todo Refactor away -ds
MaterialBind *toMaterialBind(materialid_t materialId);
Expand Down
6 changes: 0 additions & 6 deletions doomsday/engine/src/resource/materials.cpp
Expand Up @@ -712,12 +712,6 @@ MaterialSnapshot const &Materials::prepare(MaterialVariant &variant,
return *snapshot;
}

MaterialSnapshot const &Materials::prepare(material_t &mat,
MaterialVariantSpec const &spec, bool smooth, bool updateSnapshot)
{
return prepare(*Material_ChooseVariant(&mat, spec, smooth, true), updateSnapshot);
}

ded_decor_t const *Materials::decorationDef(material_t &mat)
{
if(!Material_Prepared(&mat))
Expand Down

0 comments on commit 3a6768e

Please sign in to comment.