[Scummvm-cvs-logs] SF.net SVN: scummvm:[44705] scummvm/trunk/engines/sci/gui

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Oct 6 19:13:57 CEST 2009


Revision: 44705
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44705&view=rev
Author:   thebluegr
Date:     2009-10-06 17:13:57 +0000 (Tue, 06 Oct 2009)

Log Message:
-----------
Moved the LSL1VGA workaround inside the font class

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_font.cpp
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp

Modified: scummvm/trunk/engines/sci/gui/gui_font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_font.cpp	2009-10-06 17:09:34 UTC (rev 44704)
+++ scummvm/trunk/engines/sci/gui/gui_font.cpp	2009-10-06 17:13:57 UTC (rev 44705)
@@ -35,6 +35,11 @@
 	: _resourceId(resourceId) {
 	assert(resourceId != -1);
 
+	// Workaround: lsl1sci mixes its own internal fonts with the global
+	// SCI ones, so we translate them here, by removing their extra bits
+	if (!resMan->testResource(ResourceId(kResourceTypeFont, resourceId)))
+		resourceId = resourceId & 0x7ff;
+
 	Resource *fontResource = resMan->findResource(ResourceId(kResourceTypeFont, resourceId), false);
 	if (!fontResource) {
 		error("font resource %d not found", resourceId);

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-06 17:09:34 UTC (rev 44704)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-06 17:13:57 UTC (rev 44705)
@@ -111,14 +111,10 @@
 }
 
 void SciGuiGfx::SetFont(GuiResourceId fontId) {
-	// Workaround: lsl1sci mixes its own internal fonts with the global
-	// SCI ones, so we translate them here, by removing their extra bits
-	GuiResourceId actualFontId = (_s->_gameName == "lsl1sci") ? fontId & 0x7ff : fontId;
-	
 	if ((_font == NULL) || (_font->getResourceId() != fontId))
-		_font = new SciGuiFont(_s->resMan, actualFontId);
+		_font = new SciGuiFont(_s->resMan, fontId);
 
-	_curPort->fontId = actualFontId;
+	_curPort->fontId = _font->getResourceId();
 	_curPort->fontHeight = _font->getHeight();
 }
 


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