HOPKINS: Add clearAll() to EventsManager

This commit is contained in:
Strangerke 2013-03-24 15:31:59 +01:00
parent 4ff6e13e02
commit 1952a47787
3 changed files with 8 additions and 4 deletions

View File

@ -51,7 +51,7 @@ EventsManager::EventsManager(HopkinsEngine *vm) {
_gameKey = KEY_NONE;
_mouseCursorId = 0;
_oldIconId = 0;
_objectBuf = NULL;
_objectBuf = g_PTRNUL;
Common::fill(&_keyState[0], &_keyState[256], false);
_priorCounterTime = 0;
@ -63,6 +63,11 @@ EventsManager::~EventsManager() {
_vm->_globals->freeMemory(_mouseCursor);
}
void EventsManager::clearAll() {
_objectBuf = _vm->_globals->freeMemory(_objectBuf);
_objectBuf = _vm->_globals->allocMemory(2500);
}
void EventsManager::initMouseData() {
if (_vm->getPlatform() == Common::kPlatformLinux)
_mouseLinuxFl = true;

View File

@ -71,6 +71,7 @@ public:
EventsManager(HopkinsEngine *vm);
~EventsManager();
void clearAll();
void initMouseData();
void delay(int totalMilli);
@ -85,7 +86,6 @@ public:
void mouseOn();
void mouseOff();
void setMouseOn();
void refreshScreenAndEvents();
};

View File

@ -238,7 +238,6 @@ void Globals::clearAll() {
initVBob();
_objectDataBuf = g_PTRNUL;
_curObjectFileNum = 0;
_vm->_eventsManager->_objectBuf = g_PTRNUL;
_vm->_dialogsManager->clearAll();
_answerBuffer = g_PTRNUL;
SPRITE_ECRAN = g_PTRNUL;
@ -253,7 +252,7 @@ void Globals::clearAll() {
_boxWidth = 240;
_vm->_eventsManager->_objectBuf = allocMemory(2500);
_vm->_eventsManager->clearAll();
_objectDataBuf = g_PTRNUL;
}