From f0db6c4423db86203db83538704cc34152c59a09 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Tue, 15 Jul 2014 09:07:52 +0200 Subject: Speedup mapblock_mesh --- src/tile.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/tile.h') diff --git a/src/tile.h b/src/tile.h index 29c6b69f2..f3250669e 100644 --- a/src/tile.h +++ b/src/tile.h @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include "threads.h" #include +#include class IGameDef; @@ -106,6 +107,7 @@ public: virtual bool isKnownSourceImage(const std::string &name)=0; virtual video::ITexture* generateTextureFromMesh( const TextureFromMeshParams ¶ms)=0; + virtual video::ITexture* getNormalTexture(const std::string &name)=0; }; class IWritableTextureSource : public ITextureSource @@ -127,6 +129,7 @@ public: virtual void processQueue()=0; virtual void insertSourceImage(const std::string &name, video::IImage *img)=0; virtual void rebuildImagesAndTextures()=0; + virtual video::ITexture* getNormalTexture(const std::string &name)=0; }; IWritableTextureSource* createTextureSource(IrrlichtDevice *device); @@ -175,11 +178,25 @@ enum MaterialType{ This fully defines the looks of a tile. The SMaterial of a tile is constructed according to this. */ +struct FrameSpec +{ + FrameSpec(): + texture_id(0), + texture(NULL), + normal_texture(NULL) + { + } + u32 texture_id; + video::ITexture *texture; + video::ITexture *normal_texture; +}; + struct TileSpec { TileSpec(): texture_id(0), texture(NULL), + normal_texture(NULL), alpha(255), material_type(TILE_MATERIAL_BASIC), material_flags( @@ -243,6 +260,8 @@ struct TileSpec u32 texture_id; video::ITexture *texture; + video::ITexture *normal_texture; + // Vertex alpha (when MATERIAL_ALPHA_VERTEX is used) u8 alpha; // Material parameters @@ -252,6 +271,8 @@ struct TileSpec // Animation parameters u8 animation_frame_count; u16 animation_frame_length_ms; + std::map frames; + u8 rotation; }; -- cgit v1.2.3