diff options
author | Martin Kiewitz | 2009-10-06 16:14:40 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-06 16:14:40 +0000 |
commit | 14dfa5d7b01fba21c3da100830febbcdd1532d8c (patch) | |
tree | aaea4035a41e5b979178fa3220aaf5d780a365e9 /engines/sci/gui/gui_view.cpp | |
parent | 855af31757d20ace18f8b96c09d44571aacc049b (diff) | |
download | scummvm-rg350-14dfa5d7b01fba21c3da100830febbcdd1532d8c.tar.gz scummvm-rg350-14dfa5d7b01fba21c3da100830febbcdd1532d8c.tar.bz2 scummvm-rg350-14dfa5d7b01fba21c3da100830febbcdd1532d8c.zip |
SCI/newgui: palette functions from SciGuiGfx now in SciGuiPalette
svn-id: r44698
Diffstat (limited to 'engines/sci/gui/gui_view.cpp')
-rw-r--r-- | engines/sci/gui/gui_view.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/sci/gui/gui_view.cpp b/engines/sci/gui/gui_view.cpp index c5bcd6cc9e..379e8bf612 100644 --- a/engines/sci/gui/gui_view.cpp +++ b/engines/sci/gui/gui_view.cpp @@ -28,12 +28,13 @@ #include "sci/tools.h" #include "sci/gui/gui_gfx.h" #include "sci/gui/gui_screen.h" +#include "sci/gui/gui_palette.h" #include "sci/gui/gui_view.h" namespace Sci { -SciGuiView::SciGuiView(ResourceManager *resMan, SciGuiScreen *screen, GuiResourceId resourceId) - : _resMan(resMan), _screen(screen), _resourceId(resourceId) { +SciGuiView::SciGuiView(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, GuiResourceId resourceId) + : _resMan(resMan), _screen(screen), _palette(palette), _resourceId(resourceId) { assert(resourceId != -1); initData(resourceId); } @@ -82,7 +83,7 @@ void SciGuiView::initData(GuiResourceId resourceId) { if (IsEGA) { // simple mapping for 16 colors _EGAMapping = _resourceData + palOffset; } else { - CreatePaletteFromData(&_resourceData[palOffset], &_palette); + _palette->createFromData(&_resourceData[palOffset], &_viewPalette); _embeddedPal = true; } } @@ -141,7 +142,7 @@ void SciGuiView::initData(GuiResourceId resourceId) { celSize = _resourceData[13]; if (palOffset) { - CreatePaletteFromData(&_resourceData[palOffset], &_palette); + _palette->createFromData(&_resourceData[palOffset], &_viewPalette); _embeddedPal = true; } @@ -344,7 +345,7 @@ byte *SciGuiView::getBitmap(GuiViewLoopNo loopNo, GuiViewCelNo celNo) { } void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 paletteNo) { - GuiPalette *palette = _embeddedPal ? &_palette : &_screen->_sysPalette; + GuiPalette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette; sciViewCelInfo *celInfo = getCelInfo(loopNo, celNo); byte *bitmap = getBitmap(loopNo, celNo); int16 celHeight = celInfo->height, celWidth = celInfo->width; @@ -354,6 +355,11 @@ void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect cli byte drawMask = priority == 255 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY; int x, y; + if (_embeddedPal) { + // Merge view palette in... + _palette->set(&_viewPalette, 1); + } + width = MIN(clipRect.width(), celWidth); height = MIN(clipRect.height(), celHeight); |