diff options
author | Martin Kiewitz | 2009-10-04 22:15:19 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-04 22:15:19 +0000 |
commit | 92d0a9e17f293159af57918fa7dffae7dbd1528b (patch) | |
tree | 2ad7026f1b3e3cd1034b3e5053be76dae8619318 | |
parent | eb56dfa965718163535df46ecbcfa7a94dbcff4b (diff) | |
download | scummvm-rg350-92d0a9e17f293159af57918fa7dffae7dbd1528b.tar.gz scummvm-rg350-92d0a9e17f293159af57918fa7dffae7dbd1528b.tar.bz2 scummvm-rg350-92d0a9e17f293159af57918fa7dffae7dbd1528b.zip |
SCI/newgui: EGA view loading / mapping table
svn-id: r44639
-rw-r--r-- | engines/sci/gui/gui_view.cpp | 11 | ||||
-rw-r--r-- | engines/sci/gui/gui_view.h | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/engines/sci/gui/gui_view.cpp b/engines/sci/gui/gui_view.cpp index eb38a2ccaf..09ec82ac5d 100644 --- a/engines/sci/gui/gui_view.cpp +++ b/engines/sci/gui/gui_view.cpp @@ -41,6 +41,8 @@ SciGUIview::SciGUIview(OSystem *system, EngineState *state, SciGUIgfx *gfx, SciG 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 @@ void SciGUIview::initData(GUIResourceId resourceId) { 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 @@ void SciGUIview::initData(GUIResourceId resourceId) { 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 @@ void SciGUIview::initData(GUIResourceId resourceId) { 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; diff --git a/engines/sci/gui/gui_view.h b/engines/sci/gui/gui_view.h index fa06156d39..9e151561f3 100644 --- a/engines/sci/gui/gui_view.h +++ b/engines/sci/gui/gui_view.h @@ -77,6 +77,7 @@ private: sciViewLoopInfo *_loop; bool _embeddedPal; GUIPalette _palette; + byte *_EGAMapping; // simple translation map for all 16 colors }; } // End of namespace Sci |