diff options
author | Martin Kiewitz | 2010-01-25 12:34:40 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-25 12:34:40 +0000 |
commit | 5fa07183567ec91f0e3e220f296f23822b698c4a (patch) | |
tree | ddd98098400544b8c7ba5294fc714daf47b2fc79 /engines/sci/graphics | |
parent | e7e0810c9c93c14cbf861cf2c3e531126cb411df (diff) | |
download | scummvm-rg350-5fa07183567ec91f0e3e220f296f23822b698c4a.tar.gz scummvm-rg350-5fa07183567ec91f0e3e220f296f23822b698c4a.tar.bz2 scummvm-rg350-5fa07183567ec91f0e3e220f296f23822b698c4a.zip |
SCI: created isAmiga32color(), using this method instead of comparing against viewType
svn-id: r47554
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/gui.cpp | 14 | ||||
-rw-r--r-- | engines/sci/graphics/palette.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/picture.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 5 | ||||
-rw-r--r-- | engines/sci/graphics/view.cpp | 2 |
5 files changed, 13 insertions, 14 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 2f8b278534..a923c381dc 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -176,7 +176,7 @@ int16 SciGui::priorityToCoordinate(int16 priority) { reg_t SciGui::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) { Window *wnd = NULL; - if (_s->resMan->getViewType() == kViewAmiga) { + if (_s->resMan->isAmiga32color()) { colorPen = _palette->mapAmigaColor(colorPen); colorBack = _palette->mapAmigaColor(colorBack); } @@ -237,14 +237,14 @@ void SciGui::display(const char *text, int argc, reg_t *argv) { break; case SCI_DISPLAY_SETPENCOLOR: colorPen = argv[0].toUint16(); - if (_s->resMan->getViewType() == kViewAmiga) + if (_s->resMan->isAmiga32color()) colorPen = _palette->mapAmigaColor(colorPen); _gfx->PenColor(colorPen); argc--; argv++; break; case SCI_DISPLAY_SETBACKGROUNDCOLOR: colorBack = argv[0].toUint16(); - if (_s->resMan->getViewType() == kViewAmiga) + if (_s->resMan->isAmiga32color()) colorBack = _palette->mapAmigaColor(colorBack); argc--; argv++; break; @@ -324,7 +324,7 @@ void SciGui::textColors(int argc, reg_t *argv) { void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) { Port *oldPort = _gfx->SetPort(_gfx->_menuPort); - if (_s->resMan->getViewType() == kViewAmiga) { + if (_s->resMan->isAmiga32color()) { colorPen = _palette->mapAmigaColor(colorPen); colorBack = _palette->mapAmigaColor(colorBack); } @@ -506,14 +506,14 @@ void SciGui::graphFillBoxBackground(Common::Rect rect) { } void SciGui::graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) { - if (_s->resMan->getViewType() == kViewAmiga) + if (_s->resMan->isAmiga32color()) color = _palette->mapAmigaColor(color); _gfx->FillRect(rect, colorMask, color, priority, control); } void SciGui::graphFrameBox(Common::Rect rect, int16 color) { int16 oldColor = _gfx->GetPort()->penClr; - if (_s->resMan->getViewType() == kViewAmiga) + if (_s->resMan->isAmiga32color()) color = _palette->mapAmigaColor(color); _gfx->PenColor(color); _gfx->FrameRect(rect); @@ -521,7 +521,7 @@ void SciGui::graphFrameBox(Common::Rect rect, int16 color) { } void SciGui::graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) { - if (_s->resMan->getViewType() == kViewAmiga) + if (_s->resMan->isAmiga32color()) color = _palette->mapAmigaColor(color); _gfx->OffsetLine(startPoint, endPoint); _screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control); diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 617fc5bbf8..807848ae68 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -58,7 +58,7 @@ SciPalette::SciPalette(ResourceManager *resMan, Screen *screen, bool autoSetPale if (autoSetPalette) { if (_resMan->getViewType() == kViewEga) setEGA(); - else if (_resMan->getViewType() == kViewAmiga) + else if (_resMan->isAmiga32color()) setAmiga(); else setFromResource(999, 2); @@ -311,7 +311,7 @@ void SciPalette::setOnScreen() { // if (pal != &_sysPalette) // memcpy(&_sysPalette,pal,sizeof(Palette)); // We dont change palette at all times for amiga - if (_resMan->getViewType() == kViewAmiga) + if (_resMan->isAmiga32color()) return; _screen->setPalette(&_sysPalette); } diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index b5b07c5e74..d252d34f5d 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -555,7 +555,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) { } break; case PIC_OPX_VGA_SET_PALETTE: - if (_resMan->getViewType() == kViewAmiga) { + if (_resMan->isAmiga32color()) { if ((data[curPos] == 0x00) && (data[curPos + 1] == 0x01) && ((data[curPos + 32] & 0xF0) != 0xF0)) { // Left-Over VGA palette, we simply ignore it curPos += 256 + 4 + 768; diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 07ee3c4639..6d9cd0cbd8 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -58,9 +58,8 @@ Screen::Screen(ResourceManager *resMan, int16 width, int16 height, bool upscaled _picNotValidSci11 = 0; _unditherState = true; - if (_resMan->isVGA() || (_resMan->getViewType() == kViewAmiga)) { - // It's not 100% accurate to set white to be 255 for amiga games - // The problem is: there are 16-color and 32-color amiga games, so we would need to jump around + if (_resMan->isVGA() || (_resMan->isAmiga32color())) { + // It's not 100% accurate to set white to be 255 for amiga 32-color games // 255 is defined as white in our sci at all times, so it doesnt matter _colorWhite = 255; if (getSciVersion() >= SCI_VERSION_1_1) diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index aab44df0d3..df355bae3c 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -307,7 +307,7 @@ void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount) rlePtr = _resourceData + celInfo->offsetRLE; if (!celInfo->offsetLiteral) { // no additional literal data - if (_resMan->getViewType() == kViewAmiga) { + if (_resMan->isAmiga32color()) { // decompression for amiga views while (pixelNo < pixelCount) { pixel = *rlePtr++; |