aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/events.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2007-07-30 13:19:46 +0000
committerFilippos Karapetis2007-07-30 13:19:46 +0000
commitba44fcbf6b5a209fd7d705ffcf678568bb049640 (patch)
tree6462d5ca9fd031aca1cf2ddcd02dbed9dae8292f /engines/saga/events.cpp
parent653cf4c971e740e9ce9955447aa8d18491544b18 (diff)
downloadscummvm-rg350-ba44fcbf6b5a209fd7d705ffcf678568bb049640.tar.gz
scummvm-rg350-ba44fcbf6b5a209fd7d705ffcf678568bb049640.tar.bz2
scummvm-rg350-ba44fcbf6b5a209fd7d705ffcf678568bb049640.zip
Some corrections for the psychic profile screen in IHNM. The psychic profile background drawing has been turned into an event, so actors and animations will no longer be incorrectly shown. Also, the incorrect text color has been fixed. The text position is still wrong, though, and it's currently not possible to exit the psychic profile screen
svn-id: r28324
Diffstat (limited to 'engines/saga/events.cpp')
-rw-r--r--engines/saga/events.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index 73a603bf5c..5bdcf671d3 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 rect(width, height);
+
+ bgSurface->blit(rect, 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: