*******************************************************************************/
-#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 <boost/shared_ptr.hpp>
-#include "texture.hh"
-#include "math.hh"
+#include <Moof/Math.hh>
+#include <Moof/Texture.hh>
-namespace dc {
+namespace Mf {
/**
* 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
* @return True if index is valid, false otherwise.
*/
- bool getTileCoords(unsigned index, scalar coords[8]);
+ bool getTileCoords(Index index, Scalar coords[8]);
/**
* @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<tilemap_impl> impl;
+ class TilemapImpl;
+ boost::shared_ptr<TilemapImpl> impl_;
};
-} // namespace dc
+} // namespace Mf
-#endif // _TILEMAP_HH_
+#endif // _MOOF_TILEMAP_HH_
/** vim: set ts=4 sw=4 tw=80: *************************************************/