[Scummvm-cvs-logs] SF.net SVN: scummvm: [28324] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jul 30 15:19:46 CEST 2007


Revision: 28324
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28324&view=rev
Author:   thebluegr
Date:     2007-07-30 06:19:46 -0700 (Mon, 30 Jul 2007)

Log Message:
-----------
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

Modified Paths:
--------------
    scummvm/trunk/engines/saga/events.cpp
    scummvm/trunk/engines/saga/events.h
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/events.cpp
===================================================================
--- scummvm/trunk/engines/saga/events.cpp	2007-07-30 11:55:11 UTC (rev 28323)
+++ scummvm/trunk/engines/saga/events.cpp	2007-07-30 13:19:46 UTC (rev 28324)
@@ -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 @@
 			_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:

Modified: scummvm/trunk/engines/saga/events.h
===================================================================
--- scummvm/trunk/engines/saga/events.h	2007-07-30 11:55:11 UTC (rev 28323)
+++ scummvm/trunk/engines/saga/events.h	2007-07-30 13:19:46 UTC (rev 28324)
@@ -60,7 +60,8 @@
 	kScriptEvent,
 	kCursorEvent,
 	kGraphicsEvent,
-	kCutawayEvent
+	kCutawayEvent,
+	kPsychicProfileBgEvent
 };
 
 enum EventOps {

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-07-30 11:55:11 UTC (rev 28323)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-07-30 13:19:46 UTC (rev 28324)
@@ -1484,8 +1484,7 @@
 	Event event;
 	Event *q_event;
 
-	// FIXME: This still needs work: the actors are shown while the psychic
-	// profile is shown and the text placement and color are incorrect
+	// FIXME: This still needs work: the text placement is incorrect
 
 	thread->wait(kWaitTypePlacard);
 
@@ -1525,47 +1524,27 @@
 	q_event = _vm->_events->chain(q_event, &event);
 
 	// Set the background and palette for the psychic profile
-	ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE);
+	event.type = kEvTOneshot;
+	event.code = kPsychicProfileBgEvent;
 
-	byte *resourceData;
-	size_t resourceDataLength;
+	q_event = _vm->_events->chain(q_event, &event);
 
-	_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);
-
 	// Put the text in the center of the viewport, assuming it will fit on
 	// one line. If we cannot make that assumption we'll need to extend
 	// the text drawing function so that it can center text around a point.
 	// It doesn't end up in exactly the same spot as the original did it,
 	// but it's close enough for now at least.
 
+	// FIXME: This assumption is wrong for the psychic profile, the text
+	// placement is incorrect
+
 	TextListEntry textEntry;
 
-	textEntry.knownColor = kKnownColorTransparent;
-	textEntry.effectKnownColor = kKnownColorBrightWhite;
+	textEntry.knownColor = kKnownColorBlack;
 	textEntry.point.x = _vm->getDisplayWidth() / 2;
 	textEntry.point.y = (_vm->_scene->getHeight() - _vm->_font->getHeight(kKnownFontMedium)) / 2;
 	textEntry.font = kKnownFontVerb;
-	textEntry.flags = (FontEffectFlags)(kFontOutline | kFontCentered);
+	textEntry.flags = (FontEffectFlags)(kFontCentered);
 	textEntry.text = thread->_strings->getString(stringId);
 
 	_placardTextEntry = _vm->_scene->_textList.addEntry(textEntry);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list