Allow full circle rotation with 2degs step for plantlike drawtype.
[oweals/minetest.git] / src / tile.h
index 29c6b69f2e293bb20f7c1f160f772d2d4c498886..f3250669e2b45d751f52513858a49359ce05ddd1 100644 (file)
@@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <IrrlichtDevice.h>
 #include "threads.h"
 #include <string>
+#include <map>
 
 class IGameDef;
 
@@ -106,6 +107,7 @@ public:
        virtual bool isKnownSourceImage(const std::string &name)=0;
        virtual video::ITexture* generateTextureFromMesh(
                        const TextureFromMeshParams &params)=0;
+       virtual video::ITexture* getNormalTexture(const std::string &name)=0;
 };
 
 class IWritableTextureSource : public ITextureSource
@@ -127,6 +129,7 @@ public:
        virtual void processQueue()=0;
        virtual void insertSourceImage(const std::string &name, video::IImage *img)=0;
        virtual void rebuildImagesAndTextures()=0;
+       virtual video::ITexture* getNormalTexture(const std::string &name)=0;
 };
 
 IWritableTextureSource* createTextureSource(IrrlichtDevice *device);
@@ -175,11 +178,25 @@ enum MaterialType{
        This fully defines the looks of a tile.
        The SMaterial of a tile is constructed according to this.
 */
+struct FrameSpec
+{
+       FrameSpec():
+               texture_id(0),
+               texture(NULL),
+               normal_texture(NULL)
+       {
+       }
+       u32 texture_id;
+       video::ITexture *texture;
+       video::ITexture *normal_texture;
+};
+
 struct TileSpec
 {
        TileSpec():
                texture_id(0),
                texture(NULL),
+               normal_texture(NULL),
                alpha(255),
                material_type(TILE_MATERIAL_BASIC),
                material_flags(
@@ -243,6 +260,8 @@ struct TileSpec
        
        u32 texture_id;
        video::ITexture *texture;
+       video::ITexture *normal_texture;
+       
        // Vertex alpha (when MATERIAL_ALPHA_VERTEX is used)
        u8 alpha;
        // Material parameters
@@ -252,6 +271,8 @@ struct TileSpec
        // Animation parameters
        u8 animation_frame_count;
        u16 animation_frame_length_ms;
+       std::map<u32, FrameSpec> frames;
+
        u8 rotation;
 };