aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/saga/events.cpp')
-rw-r--r--engines/saga/events.cpp41
1 files changed, 38 insertions, 3 deletions
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index b93c6017c7..80e6b58595 100644
--- a/engines/saga/events.cpp
+++ b/engines/saga/events.cpp
@@ -35,6 +35,7 @@
#include "saga/palanim.h"
#include "saga/render.h"
#include "saga/sndres.h"
+#include "saga/rscfile.h"
#include "saga/music.h"
#include "saga/actor.h"
@@ -344,6 +345,39 @@ int Events::handleOneShot(Event *event) {
_vm->_actor->showActors(true);
}
break;
+ case kPsychicProfileBgEvent:
+ {
+ ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE);
+
+ byte *resourceData;
+ size_t resourceDataLength;
+
+ _vm->_resource->loadResource(context, _vm->getResourceDescription()->psychicProfileResourceId, resourceData, resourceDataLength);
+
+ byte *buf;
+ size_t buflen;
+ int width;
+ int height;
+
+ _vm->decodeBGImage(resourceData, resourceDataLength, &buf, &buflen, &width, &height);
+
+ const PalEntry *palette = (const PalEntry *)_vm->getImagePal(resourceData, resourceDataLength);
+
+ Surface *bgSurface = _vm->_render->getBackGroundSurface();
+ const Rect profileRect(width, height);
+
+ bgSurface->blit(profileRect, buf);
+ _vm->_frameCount++;
+
+ _vm->_gfx->setPalette(palette);
+
+ free(buf);
+ free(resourceData);
+
+ // Draw the scene. It won't be drawn by Render::drawScene(), as the RF_PLACARD is set
+ _vm->_scene->draw();
+ }
+ break;
case kAnimEvent:
switch (event->op) {
case kEventPlay:
@@ -460,12 +494,13 @@ int Events::handleOneShot(Event *event) {
_vm->_gfx->showCursor(false);
break;
case kEventSetNormalCursor:
- // in ITE there is just one cursor
- if (_vm->getGameType() == GType_IHNM)
+ // in ITE and IHNM demo there is just one cursor
+ if (_vm->getGameType() == GType_IHNM && _vm->getGameId() != GID_IHNM_DEMO)
_vm->_gfx->setCursor(kCursorNormal);
break;
case kEventSetBusyCursor:
- if (_vm->getGameType() == GType_IHNM)
+ // in ITE and IHNM demo there is just one cursor
+ if (_vm->getGameType() == GType_IHNM && _vm->getGameId() != GID_IHNM_DEMO)
_vm->_gfx->setCursor(kCursorBusy);
break;
default: