[Scummvm-cvs-logs] SF.net SVN: scummvm: [23988] scummvm/branches/branch-0-9-0/engines

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Mon Sep 25 23:08:18 CEST 2006


Revision: 23988
          http://svn.sourceforge.net/scummvm/?rev=23988&view=rev
Author:   agent-q
Date:     2006-09-25 14:08:03 -0700 (Mon, 25 Sep 2006)

Log Message:
-----------
Adding setFocusRect() calls to engines

Modified Paths:
--------------
    scummvm/branches/branch-0-9-0/engines/queen/display.cpp
    scummvm/branches/branch-0-9-0/engines/queen/display.h
    scummvm/branches/branch-0-9-0/engines/queen/talk.cpp
    scummvm/branches/branch-0-9-0/engines/scumm/actor.cpp
    scummvm/branches/branch-0-9-0/engines/scumm/dialogs.cpp
    scummvm/branches/branch-0-9-0/engines/scumm/gfx.cpp
    scummvm/branches/branch-0-9-0/engines/scumm/thumbnail.cpp
    scummvm/branches/branch-0-9-0/engines/simon/simon.cpp
    scummvm/branches/branch-0-9-0/engines/sky/logic.cpp
    scummvm/branches/branch-0-9-0/engines/sky/screen.cpp
    scummvm/branches/branch-0-9-0/engines/sky/screen.h

Modified: scummvm/branches/branch-0-9-0/engines/queen/display.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/queen/display.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/queen/display.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -851,6 +851,10 @@
 	}
 }
 
+void Display::setFocusRect(const Common::Rect& rect) {
+	_system->setFocusRectangle(rect);
+}
+
 int Display::textCenterX(const char *text) const {
 	return (GAME_SCREEN_WIDTH - textWidth(text)) / 2;
 }

Modified: scummvm/branches/branch-0-9-0/engines/queen/display.h
===================================================================
--- scummvm/branches/branch-0-9-0/engines/queen/display.h	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/queen/display.h	2006-09-25 21:08:03 UTC (rev 23988)
@@ -149,6 +149,9 @@
 	//! change the text color for the specified texts list entry
 	void textColor(uint16 y, uint8 color) { _texts[y].color = color; }
 
+	//! Set the focus rectangle to the speaking character
+	void setFocusRect(const Common::Rect& rect);
+
 	int textCenterX(const char *text) const;
 	uint16 textWidth(const char *text) const;
 	uint16 textWidth(const char *text, uint16 len) const;

Modified: scummvm/branches/branch-0-9-0/engines/queen/talk.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/queen/talk.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/queen/talk.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -865,6 +865,15 @@
 		textY = bob->y;
 	}
 
+	// Set the focus rectangle
+	// FIXME: This may not be correct!
+	BobFrame *pbf = _vm->bankMan()->fetchFrame(bob->frameNum);
+
+	int height = (pbf->height * bob->scale) / 100;
+	
+	Common::Rect focus(textX - 96, textY - height - 64, textX + 96, textY + height + 64);
+	_vm->display()->setFocusRect(focus);
+	
 	//int SF = _vm->grid()->findScale(textX, textY);
 
 	const SpeechParameters *parameters = NULL;

Modified: scummvm/branches/branch-0-9-0/engines/scumm/actor.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/actor.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/scumm/actor.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -22,6 +22,7 @@
  */
 
 #include "common/stdafx.h"
+#include "common/system.h"	// for setFocusRectangle/clearFocusRectangle
 #include "scumm/scumm.h"
 #include "scumm/actor.h"
 #include "scumm/akos.h"
@@ -845,6 +846,20 @@
 }
 
 void ScummEngine::setTalkingActor(int value) {
+
+	if (value == 255) {
+		_system->clearFocusRectangle();
+	} else {
+		// Work out the screen co-ordinates of the actor
+		int x = _actors[value]._pos.x - (camera._cur.x - (_screenWidth >> 1));
+		int y = _actors[value]._top - (camera._cur.y - (_screenHeight >> 1));
+		
+		// Set the focus area to the calculated position
+		// TODO: Make the size adjust depending on what it's focusing on.
+		Common::Rect rect(x - 96, y - 64, x + 96, y + 64);
+		_system->setFocusRectangle(rect);
+	}
+
 	if (_game.id == GID_MANIAC && _game.version <= 1 && !(_game.platform == Common::kPlatformNES))
 		_V1TalkingActor = value;
 	else

Modified: scummvm/branches/branch-0-9-0/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/dialogs.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/scumm/dialogs.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -43,6 +43,10 @@
 #include "sound/mididrv.h"
 #include "sound/mixer.h"
 
+#ifdef __DS__
+#include "scummhelp.h"
+#endif
+
 #ifndef DISABLE_HELP
 #include "scumm/help.h"
 #endif
@@ -710,7 +714,12 @@
 
 	String titleStr, *keyStr, *dscStr;
 
+#ifndef __DS__
 	ScummHelp::updateStrings(_game.id, _game.version, _game.platform, _page, titleStr, keyStr, dscStr);
+#else
+	// DS version has a different help screen
+	DS::updateStrings(_game.id, _game.version, _game.platform, _page, titleStr, keyStr, dscStr);
+#endif
 
 	_title->setLabel(titleStr);
 	for (int i = 0; i < HELP_NUM_LINES; i++) {

Modified: scummvm/branches/branch-0-9-0/engines/scumm/gfx.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/gfx.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/scumm/gfx.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -32,6 +32,9 @@
 #include "scumm/resource.h"
 #include "scumm/usage_bits.h"
 #include "scumm/he/wiz_he.h"
+#ifdef __DS__
+#include "blitters.h"
+#endif
 
 namespace Scumm {
 
@@ -543,7 +546,11 @@
 	if (_game.version < 7) {
 		// Handle the text mask in older games; newer (V7/V8) games do not use it anymore.
 		const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch;
-	
+
+#ifdef __DS__
+		DS::asmDrawStripToScreen(height, width, text, src, dst, vs->pitch, _screenWidth, _charset->_textSurface.pitch);
+#else	
+
 		// Compose the text over the game graphics
 		for (int h = 0; h < height; ++h) {
 			for (int w = 0; w < width; ++w) {
@@ -556,6 +563,8 @@
 			dst += _screenWidth;
 			text += _charset->_textSurface.pitch;
 		}
+#endif
+
 	} else {
 		// Just do a simple blit in V7/V8 games.
 		blit(dst, _screenWidth, src, vs->pitch, width, height);
@@ -973,7 +982,8 @@
 }
 
 static void copy8Col(byte *dst, int dstPitch, const byte *src, int height) {
-	do {
+#ifndef __DS__
+do {
 #if defined(SCUMM_NEED_ALIGNMENT)
 		memcpy(dst, src, 8);
 #else
@@ -983,6 +993,9 @@
 		dst += dstPitch;
 		src += dstPitch;
 	} while (--height);
+#else	
+	DS::asmCopy8Col(dst, dstPitch, src, height);
+#endif
 }
 
 static void clear8Col(byte *dst, int dstPitch, int height) {

Modified: scummvm/branches/branch-0-9-0/engines/scumm/thumbnail.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/thumbnail.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/scumm/thumbnail.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -104,7 +104,7 @@
 void ScummEngine::saveThumbnail(Common::OutSaveFile *file) {
 	Graphics::Surface thumb;
 
-#ifndef PALMOS_68K
+#if !defined(PALMOS_68K) && !defined(__DS__)
 	if (!createThumbnailFromScreen(&thumb))
 #endif
 		thumb.create(kThumbnailWidth, kThumbnailHeight2, sizeof(uint16));

Modified: scummvm/branches/branch-0-9-0/engines/simon/simon.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/simon/simon.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/simon/simon.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -491,10 +491,12 @@
 		_textIndexBase = 1500 / 4;
 		_numTextBoxes = 20;
 		_numVideoOpcodes = 75;
-#ifndef PALMOS_68K
+#if	defined(PALMOS_68K)
+		_vgaMemSize = gVars->memory[kMemSimon2Games];
+#elif defined(__DS__)
+		_vgaMemSize = 1300000;
+#else
 		_vgaMemSize = 2000000;
-#else
-		_vgaMemSize = gVars->memory[kMemSimon2Games];
 #endif
 		_tableMemSize = 100000;
 		// Check whether to use MT-32 MIDI tracks in Simon the Sorcerer 2

Modified: scummvm/branches/branch-0-9-0/engines/sky/logic.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/sky/logic.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/sky/logic.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -2511,7 +2511,16 @@
 	bool speechFileFound = false;
 	if (SkyEngine::isCDVersion())
 		speechFileFound = _skySound->startSpeech((uint16)textNum);
+	
+	// Calculate the point where the character is
+	int x = (((uint32) (target->xcood)) * GAME_SCREEN_WIDTH) >> 9;
+	int y = ((((uint32) (target->ycood)) * GAME_SCREEN_HEIGHT) >> 9);
 
+	// Set the focus region to that area
+	// TODO: Make the box size change based on the object that has the focus
+	Common::Rect rect(x - 96, y - 64, x + 96, y + 64);
+	_skyScreen->setFocusRectangle(rect);
+
 	if ((SkyEngine::_systemVars.systemFlags & SF_ALLOW_TEXT) || !speechFileFound) {
 		// form the text sprite, if player wants subtitles or
 		// if we couldn't find the speech file

Modified: scummvm/branches/branch-0-9-0/engines/sky/screen.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/sky/screen.cpp	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/sky/screen.cpp	2006-09-25 21:08:03 UTC (rev 23988)
@@ -105,6 +105,10 @@
 	_system->updateScreen();
 }
 
+void Screen::setFocusRectangle(const Common::Rect& rect) {
+	_system->setFocusRectangle(rect);
+}
+
 //set a new palette, pal is a pointer to dos vga rgb components 0..63
 void Screen::setPalette(uint8 *pal) {
 

Modified: scummvm/branches/branch-0-9-0/engines/sky/screen.h
===================================================================
--- scummvm/branches/branch-0-9-0/engines/sky/screen.h	2006-09-25 21:03:24 UTC (rev 23987)
+++ scummvm/branches/branch-0-9-0/engines/sky/screen.h	2006-09-25 21:08:03 UTC (rev 23988)
@@ -88,6 +88,7 @@
 
 	void paintBox(uint16 x, uint16 y);
 	void showGrid(uint8 *gridBuf);
+	void setFocusRectangle(const Common::Rect& rect);
 
 private:
 	OSystem *_system;


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