From 636ef64c688d1a059bc3dedb2afc35c3acb2e713 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 18 Jun 2010 17:40:13 +0000 Subject: SCI: making vga views work in ega games :P svn-id: r50025 --- engines/sci/graphics/palette.cpp | 1 + engines/sci/graphics/view.cpp | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 0972943b79..8af6b597d6 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -203,6 +203,7 @@ void GfxPalette::setEGA() { _sysPalette.colors[curColor].g = (_sysPalette.colors[color1].g >> 1) + (_sysPalette.colors[color2].g >> 1); _sysPalette.colors[curColor].b = (_sysPalette.colors[color1].b >> 1) + (_sysPalette.colors[color2].b >> 1); } + _sysPalette.timestamp = 1; setOnScreen(); } diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 2ba14fbd8f..40c96dcfed 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -75,12 +75,27 @@ void GfxView::initData(GuiResourceId resourceId) { byte seekEntry; bool isEGA = false; bool isCompressed = true; + ViewType curViewType = _resMan->getViewType(); _loopCount = 0; _embeddedPal = false; _EGAmapping = NULL; - switch (_resMan->getViewType()) { + // If we find a SCI1/SCI1.1 view (not amiga), we switch to that type for EGA + if (curViewType == kViewEga) { + if (_resourceData[1] == 0x80) { + switch (READ_LE_UINT16(_resourceData + 4)) { + case 0: // SCI1 + curViewType = kViewVga; + break; + case 1: // SCI1.1 + curViewType = kViewVga11; + break; + } + } + } + + switch (curViewType) { case kViewEga: // View-format SCI0 (and Amiga 16 colors) isEGA = true; case kViewAmiga: // View-format Amiga (32 colors) -- cgit v1.2.3