RECORDER: Give name to recoder priority. Added middle button storing.

This commit is contained in:
Eugene Sandulenko 2011-08-08 19:59:08 +01:00
parent a4029a8e94
commit 1d50a31830
2 changed files with 11 additions and 2 deletions

View File

@ -74,6 +74,8 @@ void readRecord(SeekableReadStream *inFile, uint32 &diff, Event &event, uint32 &
case EVENT_RBUTTONUP:
case EVENT_WHEELUP:
case EVENT_WHEELDOWN:
case EVENT_MBUTTONDOWN:
case EVENT_MBUTTONUP:
event.mouse.x = inFile->readSint16LE();
event.mouse.y = inFile->readSint16LE();
break;
@ -103,6 +105,8 @@ void writeRecord(WriteStream *outFile, uint32 diff, const Event &event, uint32 m
case EVENT_RBUTTONUP:
case EVENT_WHEELUP:
case EVENT_WHEELDOWN:
case EVENT_MBUTTONDOWN:
case EVENT_MBUTTONUP:
outFile->writeSint16LE(event.mouse.x);
outFile->writeSint16LE(event.mouse.y);
break;
@ -219,7 +223,7 @@ void EventRecorder::init() {
}
g_system->getEventManager()->getEventDispatcher()->registerSource(this, false);
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 1, false, true);
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, EventManager::kEventRecorderPriority, false, true);
}
void EventRecorder::deinit() {

View File

@ -383,7 +383,12 @@ public:
* Priority of the event manager, for now it's lowest since it eats
* *all* events, we might to change that in the future though.
*/
kEventManPriority = 0
kEventManPriority = 0,
/**
* Priority of the event recorder. It has to go after event manager
* in order to record events generated by it
*/
kEventRecorderPriority = 1
};
/**