]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/tile.h
Replace c55.me links
[dragonfireclient.git] / src / tile.h
index 07e5bcb5693eb802f69a24dd1c1c6eaf2125a543..531a93172894a3639f33fdcf95a9874b677b8d1e 100644 (file)
@@ -34,6 +34,17 @@ class IGameDef;
        tile.{h,cpp}: Texture handling stuff.
 */
 
+/*
+       Find out the full path of an image by trying different filename
+       extensions.
+
+       If failed, return "".
+
+       TODO: Should probably be moved out from here, because things needing
+             this function do not need anything else from this header
+*/
+std::string getImagePath(std::string path);
+
 /*
        Gets the path to a texture by first checking if the texture exists
        in texture_path and if not, using the data path.
@@ -162,6 +173,7 @@ IWritableTextureSource* createTextureSource(IrrlichtDevice *device);
 
 enum MaterialType{
        TILE_MATERIAL_BASIC,
+       TILE_MATERIAL_ALPHA,
        TILE_MATERIAL_LIQUID_TRANSPARENT,
        TILE_MATERIAL_LIQUID_OPAQUE,
 };
@@ -205,7 +217,8 @@ struct TileSpec
                        texture == other.texture &&
                        alpha == other.alpha &&
                        material_type == other.material_type &&
-                       material_flags == other.material_flags
+                       material_flags == other.material_flags &&
+                       rotation == other.rotation
                );
        }
 
@@ -221,6 +234,9 @@ struct TileSpec
                case TILE_MATERIAL_BASIC:
                        material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
                        break;
+               case TILE_MATERIAL_ALPHA:
+                       material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
+                       break;
                case TILE_MATERIAL_LIQUID_TRANSPARENT:
                        material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
                        break;
@@ -232,12 +248,16 @@ struct TileSpec
        }
        void applyMaterialOptionsWithShaders(video::SMaterial &material,
                        const video::E_MATERIAL_TYPE &basic,
-                       const video::E_MATERIAL_TYPE &liquid) const
+                       const video::E_MATERIAL_TYPE &liquid,
+                       const video::E_MATERIAL_TYPE &alpha) const
        {
                switch(material_type){
                case TILE_MATERIAL_BASIC:
                        material.MaterialType = basic;
                        break;
+               case TILE_MATERIAL_ALPHA:
+                       material.MaterialType = alpha;
+                       break;
                case TILE_MATERIAL_LIQUID_TRANSPARENT:
                        material.MaterialType = liquid;
                        break;
@@ -264,6 +284,7 @@ struct TileSpec
        // Animation parameters
        u8 animation_frame_count;
        u16 animation_frame_length_ms;
+       u8 rotation;
 };
 
 #endif