X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftile.h;h=f06285960612dacefc469f432dc190e801fe0155;hb=ea3c653a8b6352b1df234e6a9663499e9a42bf90;hp=b846b467b775c73d5c551b0aa7bb777a1e42abec;hpb=1704badc306fc8c7c6609aff9f809aee3ac00d3a;p=dragonfireclient.git diff --git a/src/tile.h b/src/tile.h index b846b467b..f06285960 100644 --- a/src/tile.h +++ b/src/tile.h @@ -103,10 +103,28 @@ struct SourceAtlasPointer } }; +/* + Implementation (to be used as a no-op on the server) +*/ +class ITextureSource +{ +public: + ITextureSource(){} + virtual ~ITextureSource(){} + virtual u32 getTextureId(const std::string &name){return 0;} + virtual u32 getTextureIdDirect(const std::string &name){return 0;} + virtual std::string getTextureName(u32 id){return "";} + virtual AtlasPointer getTexture(u32 id){return AtlasPointer(0);} + virtual AtlasPointer getTexture(const std::string &name) + {return AtlasPointer(0);} + virtual video::ITexture* getTextureRaw(const std::string &name) + {return NULL;} +}; + /* Creates and caches textures. */ -class TextureSource +class TextureSource : public ITextureSource { public: TextureSource(IrrlichtDevice *device); @@ -192,6 +210,13 @@ class TextureSource { return getTexture(getTextureId(name)); } + + // Gets a separate texture + video::ITexture* getTextureRaw(const std::string &name) + { + AtlasPointer ap = getTexture(name); + return ap.atlas; + } private: /* @@ -236,8 +261,6 @@ enum MaterialType{ /* This fully defines the looks of a tile. The SMaterial of a tile is constructed according to this. - - TODO: Change this to use an AtlasPointer */ struct TileSpec { @@ -248,6 +271,7 @@ struct TileSpec // Use this so that leaves don't need a separate material //material_type(MATERIAL_ALPHA_SIMPLE), material_flags( + //0 // <- DEBUG, Use the one below MATERIAL_FLAG_BACKFACE_CULLING ) {