]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapblock_mesh.h
Decoration: Change divlen to sidelen
[dragonfireclient.git] / src / mapblock_mesh.h
index 0877677bc9c568bcb147035e6cb14307974ffbe8..c75984021e32f62331e5f1afd114839ba635fa39 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef MAPBLOCK_MESH_HEADER
 #define MAPBLOCK_MESH_HEADER
 
-#include "common_irrlicht.h"
+#include "irrlichttypes_extrabloated.h"
 #include "tile.h"
 #include "voxel.h"
 #include <map>
@@ -122,6 +122,12 @@ class MapBlockMesh
        // Maps mesh buffer (i.e. material) indices to base texture names
        std::map<u32, std::string> m_crack_materials;
 
+       // Animation info: texture animationi
+       // Maps meshbuffers to TileSpecs
+       std::map<u32, TileSpec> m_animation_tiles;
+       std::map<u32, int> m_animation_frames; // last animation frame
+       std::map<u32, int> m_animation_frame_offsets;
+       
        // Animation info: day/night transitions
        // Last daynight_ratio value passed to animate()
        u32 m_last_daynight_ratio;
@@ -137,13 +143,13 @@ class MapBlockMesh
 struct PreMeshBuffer
 {
        TileSpec tile;
-       core::array<u16> indices;
-       core::array<video::S3DVertex> vertices;
+       std::vector<u16> indices;
+       std::vector<video::S3DVertex> vertices;
 };
 
 struct MeshCollector
 {
-       core::array<PreMeshBuffer> prebuffers;
+       std::vector<PreMeshBuffer> prebuffers;
 
        void append(const TileSpec &material,
                        const video::S3DVertex *vertices, u32 numVertices,
@@ -154,9 +160,10 @@ struct MeshCollector
 //   alpha in the A channel of the returned SColor
 //   day light (0-255) in the R channel of the returned SColor
 //   night light (0-255) in the G channel of the returned SColor
-inline video::SColor MapBlock_LightColor(u8 alpha, u16 light)
+//   light source (0-255) in the B channel of the returned SColor
+inline video::SColor MapBlock_LightColor(u8 alpha, u16 light, u8 light_source=0)
 {
-       return video::SColor(alpha, (light & 0xff), (light >> 8), 0);
+       return video::SColor(alpha, (light & 0xff), (light >> 8), light_source);
 }
 
 // Compute light at node