]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/tile.h
(hopefully) fixed stoi/stof compile problems on vc2010
[dragonfireclient.git] / src / tile.h
index b846b467b775c73d5c551b0aa7bb777a1e42abec..f06285960612dacefc469f432dc190e801fe0155 100644 (file)
@@ -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
                )
        {