Browse files

Game application and Utils classes have their own macros for getting …

…instance (const/mutable)
  • Loading branch information...
1 parent 310ed03 commit 0c8062eab4e5cc76ddae5d6619d5d91228395d28 @Ockonal Ockonal committed Aug 28, 2010
Showing with 7 additions and 0 deletions.
  1. +3 −0 include/Core/GameApplication.hpp
  2. +4 −0 include/Core/Utils.hpp
View
3 include/Core/GameApplication.hpp
@@ -16,6 +16,9 @@
#include <SFML/Window.hpp>
+#define gameApplication (GameApplication::get_mutable_instance())
+#define gameApplicationConst (GameApplication::get_const_instance())
+
class GameApplication : public singleton<GameApplication>
{
protected:
View
4 include/Core/Utils.hpp
@@ -17,9 +17,13 @@ using namespace boost;
using namespace boost::serialization;
using namespace boost::posix_time;
+// Make formatted string. Usage: FORMAT("some %1% string %2%", firstArg % secondArg);
#define FORMAT(parentString, params) (boost::format(parentString) % params).str()
#define NEW_EVENT(Signature, Name) typedef SlotObject< signals2::signal<Signature> > Name;
+#define utils (Utils::get_mutable_instance())
+#define utilsConst (Utils::get_const_instance())
+
class Utils : public singleton<Utils>
{
protected:

0 comments on commit 0c8062e

Please sign in to comment.