Procházet zdrojové kódy

Added a global Services() convenience function to wrap around CoreServices::getInstance()

Ivan Safrin před 11 roky
rodič
revize
41ea915a26

+ 4 - 0
Core/Contents/Include/PolyCoreServices.h

@@ -182,4 +182,8 @@ namespace Polycode {
 			FontManager *fontManager;
 			FontManager *fontManager;
 			Renderer *renderer;
 			Renderer *renderer;
 	};
 	};
+    
+
+    CoreServices *Services();
+    
 }
 }

+ 4 - 0
Core/Contents/Source/PolyCoreServices.cpp

@@ -42,6 +42,10 @@ std::map<long, CoreServices*> CoreServices::instanceMap;
 CoreMutex *CoreServices::renderMutex = 0;
 CoreMutex *CoreServices::renderMutex = 0;
 CoreServices* CoreServices::overrideInstance = NULL;
 CoreServices* CoreServices::overrideInstance = NULL;
 
 
+CoreServices *Polycode::Services() {
+    return CoreServices::getInstance();
+}
+
 CoreMutex *CoreServices::getRenderMutex() {
 CoreMutex *CoreServices::getRenderMutex() {
 	if(renderMutex == NULL) {
 	if(renderMutex == NULL) {
 		Logger::log("Creating render mutex...\n");
 		Logger::log("Creating render mutex...\n");