aboutsummaryrefslogtreecommitdiff
path: root/engines/composer
diff options
context:
space:
mode:
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;