aboutsummaryrefslogtreecommitdiff
path: root/engines/composer
diff options
context:
space:
mode:
authorAlyssa Milburn2011-07-19 21:48:01 +0200
committerAlyssa Milburn2011-07-19 21:48:01 +0200
commitf40f8a1793d48a82db3d8f84690946b375f5a9d6 (patch)
treeabba43da9d56717ae3df78eccf8fda9aa691eec6 /engines/composer
parent6646be1da11e417e17e2f530a96399392916498f (diff)
downloadscummvm-rg350-f40f8a1793d48a82db3d8f84690946b375f5a9d6.tar.gz
scummvm-rg350-f40f8a1793d48a82db3d8f84690946b375f5a9d6.tar.bz2
scummvm-rg350-f40f8a1793d48a82db3d8f84690946b375f5a9d6.zip
COMPOSER: Use enum values for events, rather than numeric cosntants.
Diffstat (limited to 'engines/composer')
-rw-r--r--engines/composer/composer.cpp6
-rw-r--r--engines/composer/composer.h10
-rw-r--r--engines/composer/graphics.cpp4
3 files changed, 15 insertions, 5 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index e1ab6c9472..9407821661 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -237,8 +237,8 @@ void ComposerEngine::onMouseMove(const Common::Point &pos) {
}
void ComposerEngine::onKeyDown(uint16 keyCode) {
- runEvent(5, keyCode, 0, 0);
- runEvent(6, keyCode, 0, 0);
+ runEvent(kEventKeyDown, keyCode, 0, 0);
+ runEvent(kEventChar, keyCode, 0, 0);
}
void ComposerEngine::setCursor(uint16 id, const Common::Point &offset) {
@@ -346,7 +346,7 @@ void ComposerEngine::loadLibrary(uint id) {
_mouseEnabled = true;
onMouseMove(_lastMousePos);
- runEvent(3, id, 0, 0);
+ runEvent(kEventLoad, id, 0, 0);
}
void ComposerEngine::unloadLibrary(uint id) {
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 55e3331faa..c1cf8326cb 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -87,6 +87,16 @@ public:
Common::Array<uint16> _spriteIds;
};
+enum {
+ kEventAnimStarted = 1,
+ kEventAnimDone = 2,
+ kEventLoad = 3,
+ kEventUnload = 4,
+ kEventKeyDown = 5,
+ kEventChar = 6,
+ kEventKeyUp = 7
+};
+
struct Library {
uint _id;
Archive *_archive;
diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp
index 1b7c3bdfc9..bbe2e9fa3e 100644
--- a/engines/composer/graphics.cpp
+++ b/engines/composer/graphics.cpp
@@ -134,7 +134,7 @@ void ComposerEngine::playAnimation(uint16 animId, int16 x, int16 y, int16 eventP
Animation *anim = new Animation(stream, animId, Common::Point(x, y), eventParam);
_anims.push_back(anim);
- runEvent(1, animId, eventParam, 0);
+ runEvent(kEventAnimStarted, animId, eventParam, 0);
if (newPipe)
newPipe->_anim = anim;
}
@@ -224,7 +224,7 @@ void ComposerEngine::processAnimFrame() {
if (anim->_state <= 1) {
bool normalEnd = (anim->_state == 1);
if (normalEnd) {
- runEvent(2, anim->_id, anim->_eventParam, 0);
+ runEvent(kEventAnimDone, anim->_id, anim->_eventParam, 0);
}
stopAnimation(anim, true, normalEnd);
delete anim;