]> git.lizzy.rs Git - minetest.git/blobdiff - src/client/tile.h
Rewrite rendering engine (#6253)
[minetest.git] / src / client / tile.h
index cd3c3880e67eb854c1bdfe8bce036ba0be716a65..e69dbe0c7bb3d6d7352dd74f28f907a53662ee13 100644 (file)
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef TILE_HEADER
-#define TILE_HEADER
+#pragma once
 
 #include "irrlichttypes.h"
 #include "irr_v3d.h"
@@ -210,7 +209,8 @@ struct TileLayer
                        texture_id == other.texture_id &&
                        material_type == other.material_type &&
                        material_flags == other.material_flags &&
-                       color == other.color;
+                       color == other.color &&
+                       scale == other.scale;
        }
 
        /*!
@@ -238,6 +238,8 @@ struct TileLayer
                case TILE_MATERIAL_LIQUID_TRANSPARENT:
                        material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
                        break;
+               default:
+                       break;
                }
                material.BackfaceCulling = (material_flags & MATERIAL_FLAG_BACKFACE_CULLING) != 0;
                if (!(material_flags & MATERIAL_FLAG_TILEABLE_HORIZONTAL)) {
@@ -297,6 +299,8 @@ struct TileLayer
         * a color then the color of the node owning this tile.
         */
        video::SColor color;
+
+       u8 scale;
 };
 
 /*!
@@ -305,8 +309,8 @@ struct TileLayer
 struct TileSpec
 {
        TileSpec() {
-               for (int layer = 0; layer < MAX_TILE_LAYERS; layer++)
-                       layers[layer] = TileLayer();
+               for (auto &layer : layers)
+                       layer = TileLayer();
        }
 
        /*!
@@ -324,10 +328,12 @@ struct TileSpec
                        && emissive_light == other.emissive_light;
        }
 
+       //! If true, the tile rotation is ignored.
+       bool world_aligned = false;
+       //! Tile rotation.
        u8 rotation = 0;
        //! This much light does the tile emit.
        u8 emissive_light = 0;
        //! The first is base texture, the second is overlay.
        TileLayer layers[MAX_TILE_LAYERS];
 };
-#endif