aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sherlock/events.cpp')
-rw-r--r--engines/sherlock/events.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 7e62dc075b..fdcf61e46f 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -72,6 +72,9 @@ bool EventsManager::isCursorVisible() {
return CursorMan.isVisible();
}
+/**
+ * Check for any pending events
+ */
void EventsManager::pollEvents() {
checkForNextFrameCounter();
@@ -112,6 +115,9 @@ void EventsManager::pollEvents() {
}
}
+/**
+ * Check whether it's time to display the next screen frame
+ */
bool EventsManager::checkForNextFrameCounter() {
// Check for next game frame
uint32 milli = g_system->getMillis();
@@ -134,6 +140,17 @@ bool EventsManager::checkForNextFrameCounter() {
return false;
}
+/**
+ * Clear any current keypress or mouse click
+ */
+void EventsManager::clearEvents() {
+ _pendingKeys.clear();
+ _mouseClicked = false;
+}
+
+/**
+ * Delay for a given number of frames/cycles
+ */
void EventsManager::delay(int cycles) {
uint32 totalMilli = cycles * 1000 / GAME_FRAME_RATE;
uint32 delayEnd = g_system->getMillis() + totalMilli;
@@ -145,6 +162,9 @@ void EventsManager::delay(int cycles) {
}
}
+/**
+ * Wait for the next frame
+ */
void EventsManager::waitForNextFrame() {
_mouseClicked = false;
_mouseButtons = 0;