From abceeee92f99b84ebb79968269835a4f509bfb90 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 14 Nov 2011 00:19:48 +0200 Subject: Create framework for getting rid of global definitions of node/tool/item/whatever types --- src/mapnode_contentfeatures.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/mapnode_contentfeatures.h') diff --git a/src/mapnode_contentfeatures.h b/src/mapnode_contentfeatures.h index 68342c1f8..0f7e35883 100644 --- a/src/mapnode_contentfeatures.h +++ b/src/mapnode_contentfeatures.h @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "tile.h" #endif #include "materials.h" // MaterialProperties +class ITextureSource; /* Content feature list @@ -40,7 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Must be called before accessing the table. */ -void init_contentfeatures(); +void init_contentfeatures(ITextureSource *tsrc); enum ContentParamType { @@ -232,21 +233,24 @@ struct ContentFeatures */ #ifdef SERVER - void setTexture(u16 i, std::string name, u8 alpha=255) + void setTexture(ITextureSource *tsrc, u16 i, std::string name, + u8 alpha=255) {} - void setAllTextures(std::string name, u8 alpha=255) + void setAllTextures(ITextureSource *tsrc, std::string name, u8 alpha=255) {} #else - void setTexture(u16 i, std::string name, u8 alpha=255); + void setTexture(ITextureSource *tsrc, + u16 i, std::string name, u8 alpha=255); - void setAllTextures(std::string name, u8 alpha=255) + void setAllTextures(ITextureSource *tsrc, + std::string name, u8 alpha=255) { for(u16 i=0; i<6; i++) { - setTexture(i, name, alpha); + setTexture(tsrc, i, name, alpha); } // Force inventory texture too - setInventoryTexture(name); + setInventoryTexture(name, tsrc); } #endif @@ -265,16 +269,17 @@ struct ContentFeatures #endif #ifdef SERVER - void setInventoryTexture(std::string imgname) + void setInventoryTexture(std::string imgname, + ITextureSource *tsrc) {} void setInventoryTextureCube(std::string top, - std::string left, std::string right) + std::string left, std::string right, ITextureSource *tsrc) {} #else - void setInventoryTexture(std::string imgname); + void setInventoryTexture(std::string imgname, ITextureSource *tsrc); void setInventoryTextureCube(std::string top, - std::string left, std::string right); + std::string left, std::string right, ITextureSource *tsrc); #endif }; -- cgit v1.2.3