diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index 43de3ff0d..6baf496a4 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -11,14 +11,13 @@ MessageBoxManager::MessageBoxManager (WindowManager *windowManager) void MessageBoxManager::onFrame (float frameDuration) { - std::vector::const_iterator it; + std::vector::iterator it; for(it = mTimers.begin(); it != mTimers.end(); it++) { - (*it)->current += frameDuration; - if((*it)->current >= (*it)->max) + it->current += frameDuration; + if(it->current >= it->max) { // FIXME: delete the messagebox and erase it from the vector - std::cout << "delete MessageBox" << std::endl; } } } @@ -67,10 +66,10 @@ void MessageBoxManager::createInteractiveMessageBox (const std::string& message, void MessageBoxManager::removeMessageBox (float time, MessageBox *msgbox) { - MessageBoxManagerTimer *timer; - timer->current = 0; - timer->max = time; - timer->messageBox = msgbox; + MessageBoxManagerTimer timer; + timer.current = 0; + timer.max = time; + timer.messageBox = msgbox; mTimers.insert(mTimers.end(), timer); } diff --git a/apps/openmw/mwgui/messagebox.hpp b/apps/openmw/mwgui/messagebox.hpp index 166a87011..94a4407be 100644 --- a/apps/openmw/mwgui/messagebox.hpp +++ b/apps/openmw/mwgui/messagebox.hpp @@ -3,7 +3,6 @@ #include #include -#include #include "window_base.hpp" #include "window_manager.hpp" @@ -36,7 +35,7 @@ namespace MWGui private: std::vector mMessageBoxes; - std::vector mTimers; + std::vector mTimers; float mMessageBoxSpeed; };