]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Tilemap.hh
extreme refactoring
[chaz/yoink] / src / Moof / Tilemap.hh
similarity index 82%
rename from src/tilemap.hh
rename to src/Moof/Tilemap.hh
index df8d9af842e1ed7224e65fea850067355b924b7c..d8708f1f15f20acf9ff2caa382de4b06403134b1 100644 (file)
 
 *******************************************************************************/
 
-#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 {
 
 
 /**
@@ -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<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: *************************************************/
 
This page took 0.020524 seconds and 4 git commands to generate.