[Scummvm-cvs-logs] SF.net SVN: scummvm: [30223] scummvm/branches/branch-0-11-0/engines/ parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Fri Jan 4 22:32:55 CET 2008


Revision: 30223
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30223&view=rev
Author:   peres001
Date:     2008-01-04 13:32:55 -0800 (Fri, 04 Jan 2008)

Log Message:
-----------
(backport) Fix for bug# 1729307. Fonts are now displayed with shadows when needed on Amiga and the correct font for intro screen has also been selected everywhere it's needed.

Modified Paths:
--------------
    scummvm/branches/branch-0-11-0/engines/parallaction/callables_ns.cpp
    scummvm/branches/branch-0-11-0/engines/parallaction/font.cpp
    scummvm/branches/branch-0-11-0/engines/parallaction/graphics.cpp
    scummvm/branches/branch-0-11-0/engines/parallaction/graphics.h
    scummvm/branches/branch-0-11-0/engines/parallaction/gui_ns.cpp
    scummvm/branches/branch-0-11-0/engines/parallaction/parallaction.h
    scummvm/branches/branch-0-11-0/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/branches/branch-0-11-0/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/engines/parallaction/callables_ns.cpp	2008-01-04 21:26:53 UTC (rev 30222)
+++ scummvm/branches/branch-0-11-0/engines/parallaction/callables_ns.cpp	2008-01-04 21:32:55 UTC (rev 30223)
@@ -397,8 +397,10 @@
 	cleanInventory();
 	_gfx->setPalette(_gfx->_palette);
 
+    _gfx->setFont(_menuFont);
+    _gfx->setFontShadow(true);
+
 	if (allPartsComplete()) {
-		_gfx->setFont(_menuFont);
 		_gfx->displayCenteredString(70, v4C[_language]);
 		_gfx->displayCenteredString(100, v3C[_language]);
 		_gfx->displayCenteredString(130, v2C[_language]);
@@ -409,7 +411,6 @@
 
 		scheduleLocationSwitch("estgrotta.drki");
 	} else {
-		_gfx->setFont(_menuFont);
 		_gfx->displayCenteredString(70, v8C[_language]);
 		_gfx->displayCenteredString(100, v7C[_language]);
 		_gfx->displayCenteredString(130, v6C[_language]);
@@ -438,6 +439,7 @@
 	parseLocation("common");
 
 	_gfx->setFont(_menuFont);
+    _gfx->setFontShadow(true);
 
 	_gfx->displayCenteredString(38, _slideText[0]);
 	_gfx->displayCenteredString(58, _slideText[1]);
@@ -483,6 +485,7 @@
 void Parallaction_ns::_c_endIntro(void *parm) {
 
 	_gfx->setFont(_menuFont);
+	_gfx->setFontShadow(true);
 
 	debugC(1, kDebugExec, "endIntro()");
 

Modified: scummvm/branches/branch-0-11-0/engines/parallaction/font.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/engines/parallaction/font.cpp	2008-01-04 21:26:53 UTC (rev 30222)
+++ scummvm/branches/branch-0-11-0/engines/parallaction/font.cpp	2008-01-04 21:32:55 UTC (rev 30223)
@@ -578,11 +578,13 @@
 		_dialogueFont = _disk->loadFont("comic");
 		_labelFont = _disk->loadFont("topaz");
 		_menuFont = _disk->loadFont("slide");
+		_introFont = _disk->loadFont("slide");
 	} else {
 		_dialogueFont = _disk->loadFont("comic");
 		Common::MemoryReadStream stream(_amigaTopazFont, 2600, false);
 		_labelFont = new AmigaFont(stream);
 		_menuFont = _disk->loadFont("slide");
+		_introFont = _disk->loadFont("intro");
 	}
 
 }

Modified: scummvm/branches/branch-0-11-0/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/engines/parallaction/graphics.cpp	2008-01-04 21:26:53 UTC (rev 30222)
+++ scummvm/branches/branch-0-11-0/engines/parallaction/graphics.cpp	2008-01-04 21:32:55 UTC (rev 30223)
@@ -688,6 +688,13 @@
 
 void Gfx::displayString(uint16 x, uint16 y, const char *text, byte color) {
 	byte *dst = (byte*)_buffers[kBitFront]->getBasePtr(x, y);
+	if (_fontShadow) {
+        dst = (byte*)_buffers[kBitFront]->getBasePtr(x-2, y+2);
+        _font->setColor(0);
+        _font->drawString(dst, _vm->_screenWidth, text);
+	}
+
+	dst = (byte*)_buffers[kBitFront]->getBasePtr(x, y);
 	_font->setColor(color);
 	_font->drawString(dst, _vm->_screenWidth, text);
 }
@@ -799,8 +806,12 @@
 void Gfx::setFont(Font *font) {
 	assert(font);
 	_font = font;
+	setFontShadow(false);
 }
 
+void Gfx::setFontShadow(bool enable) {
+    _fontShadow = enable && (_vm->getPlatform() == Common::kPlatformAmiga);
+}
 
 void Gfx::restoreBackground(const Common::Rect& r) {
 
@@ -907,6 +918,7 @@
     _hbCircleRadius = 0;
 
 	_font = NULL;
+	_fontShadow = false;
 
 	return;
 }

Modified: scummvm/branches/branch-0-11-0/engines/parallaction/graphics.h
===================================================================
--- scummvm/branches/branch-0-11-0/engines/parallaction/graphics.h	2008-01-04 21:26:53 UTC (rev 30222)
+++ scummvm/branches/branch-0-11-0/engines/parallaction/graphics.h	2008-01-04 21:32:55 UTC (rev 30223)
@@ -288,6 +288,7 @@
 	// misc
 	int16 queryMask(int16 v);
 	void setFont(Font* font);
+    void setFontShadow(bool enable);
 	void swapBuffers();
 	void updateScreen();
 	void setBackground(Graphics::Surface *surf);
@@ -314,6 +315,7 @@
 	Graphics::Surface	*_buffers[NUM_BUFFERS];
 	MaskBuffer			*_depthMask;
 	Font				*_font;
+	bool                _fontShadow;
 	bool				_halfbrite;
 
     Common::Point       _hbCirclePos;

Modified: scummvm/branches/branch-0-11-0/engines/parallaction/gui_ns.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/engines/parallaction/gui_ns.cpp	2008-01-04 21:26:53 UTC (rev 30222)
+++ scummvm/branches/branch-0-11-0/engines/parallaction/gui_ns.cpp	2008-01-04 21:32:55 UTC (rev 30223)
@@ -127,7 +127,8 @@
 
 	guiSplash();
 
-	_gfx->setFont(_menuFont);
+	_gfx->setFont(_introFont);
+	_gfx->setFontShadow(true);
 
 	_language = guiChooseLanguage();
 	_disk->setLanguage(_language);
@@ -191,6 +192,9 @@
 
 	const char **v14 = introMsg3;
 
+    _gfx->setFont(_menuFont);
+    _gfx->setFontShadow(true);
+
 	_disk->selectArchive("disk1");
 
 	setBackground("test", NULL, NULL);
@@ -373,7 +377,8 @@
 	setArrowCursor();
 	_soundMan->stopMusic();
 
-	_gfx->setFont(_menuFont);
+	_gfx->setFont(_introFont);
+	_gfx->setFontShadow(true);
 
 	_disk->selectArchive((getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0");
 

Modified: scummvm/branches/branch-0-11-0/engines/parallaction/parallaction.h
===================================================================
--- scummvm/branches/branch-0-11-0/engines/parallaction/parallaction.h	2008-01-04 21:26:53 UTC (rev 30222)
+++ scummvm/branches/branch-0-11-0/engines/parallaction/parallaction.h	2008-01-04 21:32:55 UTC (rev 30223)
@@ -493,6 +493,7 @@
 
 	Font		*_labelFont;
 	Font		*_menuFont;
+	Font		*_introFont;
 	Font		*_dialogueFont;
 
 	Common::RandomSource _rnd;

Modified: scummvm/branches/branch-0-11-0/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/branches/branch-0-11-0/engines/parallaction/parallaction_ns.cpp	2008-01-04 21:26:53 UTC (rev 30222)
+++ scummvm/branches/branch-0-11-0/engines/parallaction/parallaction_ns.cpp	2008-01-04 21:32:55 UTC (rev 30223)
@@ -160,6 +160,7 @@
 	delete _dialogueFont;
 	delete _labelFont;
 	delete _menuFont;
+    delete _introFont;
 
 }
 


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