diff options
author | Kari Salminen | 2008-01-23 00:06:10 +0000 |
---|---|---|
committer | Kari Salminen | 2008-01-23 00:06:10 +0000 |
commit | b8a455db9b0f5cf0c058346be9dfcd85754b8e4d (patch) | |
tree | 8770e391268815d50cdf38111e418e70ea9d4f67 | |
parent | c577c0ea81cdbd9e887e503fbaac1e77c7c65605 (diff) | |
download | scummvm-rg350-b8a455db9b0f5cf0c058346be9dfcd85754b8e4d.tar.gz scummvm-rg350-b8a455db9b0f5cf0c058346be9dfcd85754b8e4d.tar.bz2 scummvm-rg350-b8a455db9b0f5cf0c058346be9dfcd85754b8e4d.zip |
Define and use enumerations for AGI Mouse protocol 1.0's button states.
svn-id: r30620
-rw-r--r-- | engines/agi/agi.cpp | 6 | ||||
-rw-r--r-- | engines/agi/agi.h | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 570bc29732..59beb087f2 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -83,14 +83,14 @@ void AgiEngine::processEvents() { break; case Common::EVENT_LBUTTONDOWN: key = BUTTON_LEFT; - g_mouse.button = 1; + g_mouse.button = kAgiMouseButtonLeft; keyEnqueue(key); g_mouse.x = event.mouse.x; g_mouse.y = event.mouse.y; break; case Common::EVENT_RBUTTONDOWN: key = BUTTON_RIGHT; - g_mouse.button = 2; + g_mouse.button = kAgiMouseButtonRight; keyEnqueue(key); g_mouse.x = event.mouse.x; g_mouse.y = event.mouse.y; @@ -109,7 +109,7 @@ void AgiEngine::processEvents() { break; case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: - g_mouse.button = 0; + g_mouse.button = kAgiMouseButtonUp; g_mouse.x = event.mouse.x; g_mouse.y = event.mouse.y; break; diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 42d6b016f0..b6358bd405 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -220,6 +220,14 @@ struct Mouse { unsigned int y; }; +// Used by AGI Mouse protocol 1.0 for v27 (i.e. button pressed -variable). +enum AgiMouseButton { + kAgiMouseButtonUp, // Mouse button is up (not pressed) + kAgiMouseButtonLeft, // Left mouse button + kAgiMouseButtonRight, // Right mouse button + kAgiMouseButtonMiddle // Middle mouse button +}; + #define report printf enum GameId { |