From c6fd2986d4261cf742d3bc21e8c12be59ab89f95 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 14 Nov 2011 21:41:30 +0200 Subject: GameDef compiles --- src/gamedef.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/gamedef.h') diff --git a/src/gamedef.h b/src/gamedef.h index 86fd1e80f..79f5d188e 100644 --- a/src/gamedef.h +++ b/src/gamedef.h @@ -21,9 +21,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #define GAMEDEF_HEADER class IToolDefManager; -class INodeDefManager; //TODO +class INodeDefManager; //class IItemDefManager; //TODO // Mineral too? +class ITextureSource; /* An interface for fetching game-global definitions like tool and @@ -33,9 +34,20 @@ class INodeDefManager; //TODO class IGameDef { public: + // These are thread-safe IF they are not edited while running threads. + // Thus, first they are set up and then they are only read. virtual IToolDefManager* getToolDefManager()=0; virtual INodeDefManager* getNodeDefManager()=0; //virtual IItemDefManager* getItemDefManager()=0; + + // This is always thread-safe, but referencing the irrlicht texture + // pointers in other threads than main thread will make things explode. + virtual ITextureSource* getTextureSource()=0; + + // Shorthands + IToolDefManager* tdef(){return getToolDefManager();} + INodeDefManager* ndef(){return getNodeDefManager();} + ITextureSource* tsrc(){return getTextureSource();} }; #endif -- cgit v1.2.3