#ifndef TILE_HEADER
#define TILE_HEADER
-#include "common_irrlicht.h"
+#include "irrlichttypes.h"
+#include "irr_v2d.h"
+#include "irr_v3d.h"
+#include <ITexture.h>
+#include <IrrlichtDevice.h>
#include "threads.h"
-#include "utility.h"
#include <string>
class IGameDef;
v2f size; // Size in atlas
u16 tiled; // X-wise tiling count. If 0, width of atlas is width of image.
+ AtlasPointer():
+ id(0),
+ atlas(NULL),
+ pos(0,0),
+ size(1,1),
+ tiled(1)
+ {}
+
AtlasPointer(
u16 id_,
video::ITexture *atlas_=NULL,
// Should the crack be drawn on transparent pixels (unset) or not (set)?
// Ignored if MATERIAL_FLAG_CRACK is not set.
#define MATERIAL_FLAG_CRACK_OVERLAY 0x04
+// Animation made up by splitting the texture to vertical frames, as
+// defined by extra parameters
+#define MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES 0x08
/*
This fully defines the looks of a tile.
material_flags(
//0 // <- DEBUG, Use the one below
MATERIAL_FLAG_BACKFACE_CULLING
- )
+ ),
+ animation_frame_count(1),
+ animation_frame_length_ms(0)
{
}
// Sets everything else except the texture in the material
void applyMaterialOptions(video::SMaterial &material) const
{
- if(alpha != 255 && material_type != MATERIAL_ALPHA_VERTEX)
- dstream<<"WARNING: TileSpec: alpha != 255 "
- "but not MATERIAL_ALPHA_VERTEX"
- <<std::endl;
-
if(material_type == MATERIAL_ALPHA_NONE)
material.MaterialType = video::EMT_SOLID;
else if(material_type == MATERIAL_ALPHA_VERTEX)
}
AtlasPointer texture;
- // Vertex alpha
+ // Vertex alpha (when MATERIAL_ALPHA_VERTEX is used)
u8 alpha;
- // Material type
+ // Material parameters
u8 material_type;
- // Material flags
u8 material_flags;
+ // Animation parameters
+ u8 animation_frame_count;
+ u16 animation_frame_length_ms;
};
#endif