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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Oct 5 00:15:20 CEST 2009


Revision: 44639
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44639&view=rev
Author:   m_kiewitz
Date:     2009-10-04 22:15:19 +0000 (Sun, 04 Oct 2009)

Log Message:
-----------
SCI/newgui: EGA view loading / mapping table

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_view.cpp
    scummvm/trunk/engines/sci/gui/gui_view.h

Modified: scummvm/trunk/engines/sci/gui/gui_view.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-04 22:11:46 UTC (rev 44638)
+++ scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-04 22:15:19 UTC (rev 44639)
@@ -41,6 +41,8 @@
 SciGUIview::~SciGUIview() {
 }
 
+static const byte EGAMappingDefault[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+
 void SciGUIview::initData(GUIResourceId resourceId) {
 	Resource *viewResource = _s->resMan->findResource(ResourceId(kResourceTypeView, resourceId), false);
 	if (!viewResource) {
@@ -61,9 +63,9 @@
 	bool IsEGA = false;
 
 	_embeddedPal = false;
+	_EGAMapping = (byte *)&EGAMappingDefault;
 	_loopCount = 0;
 
-
 	switch (_s->resMan->getViewType()) {
 	case kViewEga: // View-format SCI0
 		IsEGA = true;
@@ -76,12 +78,12 @@
 		palOffset = READ_LE_UINT16(_resourceData + 6);
 
 		if (palOffset && palOffset != 0x100) {
-			if (IsEGA) {
-				// translation map for 16 colors
+			if (IsEGA) { // simple mapping for 16 colors
+				_EGAMapping = _resourceData + palOffset;
 			} else {
 				_gfx->CreatePaletteFromData(&_resourceData[palOffset], &_palette);
+				_embeddedPal = true;
 			}
-			_embeddedPal = true;
 		}
 
 		_loop = new sciViewLoopInfo[_loopCount];
@@ -165,6 +167,7 @@
 				cell->displaceX = READ_LE_UINT16(cellData + 4);
 				cell->displaceY = READ_LE_UINT16(cellData + 6);
 				cell->clearKey = cellData[8];
+				cell->offsetEGA = 0;
 				cell->offsetRLE = READ_LE_UINT16(cellData + 24);
 				cell->offsetLiteral = READ_LE_UINT16(cellData + 28);
 				cell->rawBitmap = 0;

Modified: scummvm/trunk/engines/sci/gui/gui_view.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.h	2009-10-04 22:11:46 UTC (rev 44638)
+++ scummvm/trunk/engines/sci/gui/gui_view.h	2009-10-04 22:15:19 UTC (rev 44639)
@@ -77,6 +77,7 @@
 	sciViewLoopInfo *_loop;
 	bool _embeddedPal;
 	GUIPalette _palette;
+	byte *_EGAMapping; // simple translation map for all 16 colors
 };
 
 } // End of namespace Sci


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