]> git.lizzy.rs Git - minetest.git/blobdiff - src/tile.h
Rename --do-unittests to --run-unittests as @Zeno- and @sfan5 requested
[minetest.git] / src / tile.h
index f3250669e2b45d751f52513858a49359ce05ddd1..ea7a9135afb554133c159ddd6a2eba559408f32e 100644 (file)
@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <IrrlichtDevice.h>
 #include "threads.h"
 #include <string>
-#include <map>
+#include <vector>
 
 class IGameDef;
 
@@ -98,7 +98,6 @@ class ITextureSource : public ISimpleTextureSource
        ITextureSource(){}
        virtual ~ITextureSource(){}
        virtual u32 getTextureId(const std::string &name)=0;
-       virtual u32 getTextureIdDirect(const std::string &name)=0;
        virtual std::string getTextureName(u32 id)=0;
        virtual video::ITexture* getTexture(u32 id)=0;
        virtual video::ITexture* getTexture(
@@ -116,7 +115,6 @@ class IWritableTextureSource : public ITextureSource
        IWritableTextureSource(){}
        virtual ~IWritableTextureSource(){}
        virtual u32 getTextureId(const std::string &name)=0;
-       virtual u32 getTextureIdDirect(const std::string &name)=0;
        virtual std::string getTextureName(u32 id)=0;
        virtual video::ITexture* getTexture(u32 id)=0;
        virtual video::ITexture* getTexture(
@@ -173,6 +171,7 @@ enum MaterialType{
 // Animation made up by splitting the texture to vertical frames, as
 // defined by extra parameters
 #define MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES 0x08
+#define MATERIAL_FLAG_HIGHLIGHTED 0x10
 
 /*
        This fully defines the looks of a tile.
@@ -230,7 +229,7 @@ struct TileSpec
        // Sets everything else except the texture in the material
        void applyMaterialOptions(video::SMaterial &material) const
        {
-               switch(material_type){
+               switch (material_type) {
                case TILE_MATERIAL_BASIC:
                        material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
                        break;
@@ -248,14 +247,16 @@ struct TileSpec
                        break;
                case TILE_MATERIAL_WAVING_PLANTS:
                        material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
-               break;
+                       break;
                }
-               material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING) ? true : false;
+               material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING)
+                       ? true : false;
        }
 
        void applyMaterialOptionsWithShaders(video::SMaterial &material) const
        {
-               material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING) ? true : false;
+               material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING)
+                       ? true : false;
        }
        
        u32 texture_id;
@@ -271,7 +272,7 @@ struct TileSpec
        // Animation parameters
        u8 animation_frame_count;
        u16 animation_frame_length_ms;
-       std::map<u32, FrameSpec> frames;
+       std::vector<FrameSpec> frames;
 
        u8 rotation;
 };