Beispiel #1
0
  StatManager::~StatManager()
  {
    ILOGM("StatManager::dtor()");

    // Clear pointers we don't need anymore
    mApp = NULL;
  }
Beispiel #2
0
  void StatManager::DoInit(void)
  {
    ILOGM("StatManager::DoInit()");

    // Reset our counters
    mFrames = 0;
    mUpdates = 0;

    // Reset our clocks
#if (SFML_VERSION_MAJOR < 2)
    mFrameClock.Reset();
    mUpdateClock.Reset();

    // Position and color for the FPS/UPS string
    mFPS = new(std::nothrow) sf::String("", mDefaultFont, 30.0F);
    mFPS->SetColor(sf::Color(0,255,0,128));
    mFPS->SetPosition(0,0);
    
    mUPS = new(std::nothrow) sf::String("", mDefaultFont, 30.0F);
    mUPS->SetColor(sf::Color(0,255,0,128));
    mUPS->SetPosition(0,30);
#else
    mFrameClock.restart();
    mUpdateClock.restart();

    // Position and color for the FPS/UPS string
    mFPS = new(std::nothrow) sf::Text("", mDefaultFont, 30);
    mFPS->setColor(sf::Color(0,255,0,128));
    mFPS->setPosition(0,0);

    mUPS = new(std::nothrow) sf::Text("", mDefaultFont, 30);
    mUPS->setColor(sf::Color(0,255,0,128));
    mUPS->setPosition(0,30);
#endif
  }
Beispiel #3
0
  StateManager::~StateManager()
  {
    ILOGM("StateManager::dtor()");

    // Drop all active states
    while(!mStack.empty())
    {
      // Retrieve the currently active state
      IState* anState = mStack.back();
 
      // Pop the currently active state off the stack
      mStack.pop_back();

      // Pause the currently active state
      anState->pause();

      // De-initialize the state
      anState->deInit();

      // Handle the cleanup before we pop it off the stack
      anState->cleanup();

      // Just delete the state now
      delete anState;

      // Don't keep pointers around we don't need
      anState = NULL;
    }

    // Delete all our dropped states
    while(!mDead.empty())
    {
      // Retrieve the currently active state
      IState* anState = mDead.back();

      // Pop the currently active state off the stack
      mDead.pop_back();

      // Pause the currently active state
      anState->pause();

      // De-initialize the state
      anState->deInit();

      // Handle the cleanup before we pop it off the stack
      anState->cleanup();

      // Just delete the state now
      delete anState;

      // Don't keep pointers around we don't need
      anState = NULL;
    }

    // Clear pointers we don't need anymore
    mApp = NULL;
  }
Beispiel #4
0
  void StatManager::deInit(void)
  {
    ILOGM("StatManager::DeInit()");

    // Delete our FPS string
    delete mFPS;
    mFPS = NULL;

    // Delete our UPS string
    delete mUPS;
    mUPS = NULL;
  }
Beispiel #5
0
  StatManager::StatManager() :
    mApp(NULL),
    mShow(false),
    mFrames(0),
    mFrameClock(),
    mDefaultFont(),
    mFPS(NULL),
    mUpdates(0),
    mUpdateClock(),
    mUPS(NULL)
  {
    ILOGM("StatManager::ctor()");
		mDefaultFont.loadFromFile("resources/arial.ttf");
  }
Beispiel #6
0
  StatManager::StatManager() :
    mApp(NULL),
    mShow(false),
    pad_(),
    mFrames(0),
    mUpdates(0),
    mFrameClock(),
    mDefaultFont(),
    mFPS(NULL),
    mUpdateClock(),
    mUPS(NULL)
  {
    ILOGM("StatManager::ctor()");
#if SFML_VERSION_MAJOR < 2
		mDefaultFont.LoadFromFile("resources/arial.ttf");
#else
		mDefaultFont.loadFromFile("resources/arial.ttf");
#endif
  }
Beispiel #7
0
	AssetManager::~AssetManager()
	{
		ILOGM("AssetManager::dtor()");

		// Iterator to use while deleting all assets
		assetHandlerMap::iterator iter;

		// Loop through each asset handler and remove each one
		iter = mHandlers.begin();
		while(iter != mHandlers.end())
		{
			IAssetHandler* anAssetHandler = iter->second;

			// Remove this Asset Handler from our map
			mHandlers.erase(iter++);

			// Delete the Asset Handler
			delete anAssetHandler;
		}
	}
Beispiel #8
0
  void StatManager::doInit(void)
  {
    ILOGM("StatManager::DoInit()");

    // Reset our counters
    mFrames = 0;
    mUpdates = 0;

    // Reset our clocks

    mFrameClock.restart();
    mUpdateClock.restart();

    // Position and color for the FPS/UPS string
    mFPS = new(std::nothrow) sf::Text("", mDefaultFont, 30);
    mFPS->setFillColor(sf::Color(0,255,0,128));
    mFPS->setPosition(0,0);

    mUPS = new(std::nothrow) sf::Text("", mDefaultFont, 30);
    mUPS->setFillColor(sf::Color(0,255,0,128));
    mUPS->setPosition(0,30);

  }
Beispiel #9
0
 StateManager::StateManager() :
   mApp(NULL)
 {
   ILOGM("StateManager::ctor()");
 }
Beispiel #10
0
	AssetManager::AssetManager()
	{
		ILOGM("AssetManager::ctor()");
	}