]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/tile.h
Pre-select current game in world creation dialog
[dragonfireclient.git] / src / tile.h
index c5c7f930346eef67859078355a41c8ae5e5b9c26..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,
 };
@@ -222,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;
@@ -233,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;