X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTilemap.hh;fp=src%2Ftilemap.hh;h=d8708f1f15f20acf9ff2caa382de4b06403134b1;hp=df8d9af842e1ed7224e65fea850067355b924b7c;hb=c2321281bf12a7efaedde930422c7ddbc92080d4;hpb=87bc17e55b0c1dc73ecc66df856d3f08fd7a7724 diff --git a/src/tilemap.hh b/src/Moof/Tilemap.hh similarity index 82% rename from src/tilemap.hh rename to src/Moof/Tilemap.hh index df8d9af..d8708f1 100644 --- a/src/tilemap.hh +++ b/src/Moof/Tilemap.hh @@ -26,21 +26,21 @@ *******************************************************************************/ -#ifndef _TILEMAP_HH_ -#define _TILEMAP_HH_ +#ifndef _MOOF_TILEMAP_HH_ +#define _MOOF_TILEMAP_HH_ /** - * @file tilemap.hh + * @file Tilemap.hh * Small subclass to give some basic tile-mapping functionality to textures. */ #include -#include "texture.hh" -#include "math.hh" +#include +#include -namespace dc { +namespace Mf { /** @@ -50,23 +50,25 @@ namespace dc { * simplicity, this class assumes square tiles. */ -class tilemap : public texture +class Tilemap : public Texture { public: /** * Possible orientations for texture coordinates. */ + typedef unsigned Index; + typedef enum { - normal = 0, ///< Normal orientation. - flip = 1, ///< Flip over a horizontal axis. - reverse = 2, ///< Flip over a vertical axis. - flip_and_reverse = 3 ///< Flip over both. - } orientation; + NORMAL = 0, ///< Normal orientation. + FLIP = 1, ///< Flip over a horizontal axis. + REVERSE = 2, ///< Flip over a vertical axis. + FLIP_AND_REVERSE = 3 ///< Flip over both. + } Orientation; - tilemap(const std::string& name); + Tilemap(const std::string& name); /** * Calculate texture coordinates for a tile at a certain index. Tiles are @@ -80,7 +82,7 @@ public: * @return True if index is valid, false otherwise. */ - bool getTileCoords(unsigned index, scalar coords[8]); + bool getTileCoords(Index index, Scalar coords[8]); /** @@ -91,20 +93,20 @@ public: * @return True if index is valid, false otherwise. */ - bool getTileCoords(unsigned index, scalar coords[8], orientation what); + bool getTileCoords(Index index, Scalar coords[8], Orientation what); static std::string getPathToResource(const std::string& name); private: - class tilemap_impl; - boost::shared_ptr impl; + class TilemapImpl; + boost::shared_ptr impl_; }; -} // namespace dc +} // namespace Mf -#endif // _TILEMAP_HH_ +#endif // _MOOF_TILEMAP_HH_ /** vim: set ts=4 sw=4 tw=80: *************************************************/