diff options
author | Martin Kiewitz | 2010-05-15 08:57:13 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-05-15 08:57:13 +0000 |
commit | 59a255226f95d395cb73119ae2e04a3494d404a5 (patch) | |
tree | 77d5beec3ab725b41c8398c133ca93215085a743 | |
parent | 83a25d2e37ad1cc0870e195bc468a67dba4c353a (diff) | |
download | scummvm-rg350-59a255226f95d395cb73119ae2e04a3494d404a5.tar.gz scummvm-rg350-59a255226f95d395cb73119ae2e04a3494d404a5.tar.bz2 scummvm-rg350-59a255226f95d395cb73119ae2e04a3494d404a5.zip |
SCI: SCI_SCREEN_MASK_* now GFX_SCREEN_MASK_*, using enum - added new enum GFX_SCREEN_UPSCALED_*
svn-id: r49039
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/animate.cpp | 14 | ||||
-rw-r--r-- | engines/sci/graphics/compare.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 12 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 28 | ||||
-rw-r--r-- | engines/sci/graphics/paint32.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/picture.cpp | 34 | ||||
-rw-r--r-- | engines/sci/graphics/ports.cpp | 22 | ||||
-rw-r--r-- | engines/sci/graphics/robot.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 48 | ||||
-rw-r--r-- | engines/sci/graphics/screen.h | 18 | ||||
-rw-r--r-- | engines/sci/graphics/view.cpp | 4 |
12 files changed, 99 insertions, 91 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index b7e5728fb0..452f708864 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -463,7 +463,7 @@ reg_t kOnControl(EngineState *s, int argc, reg_t *argv) { int argBase = 0; if ((argc == 2) || (argc == 4)) { - screenMask = SCI_SCREEN_MASK_CONTROL; + screenMask = GFX_SCREEN_MASK_CONTROL; } else { screenMask = argv[0].toUint16(); argBase = 1; diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 6d9ff9afb5..71c7b7dd7f 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -316,7 +316,7 @@ void GfxAnimate::update() { if ((signal & kSignalIgnoreActor) == 0) { rect = listEntry->celRect; rect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1); - _paint16->fillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15); + _paint16->fillRect(rect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15); } listEntry->signal = signal; } @@ -336,9 +336,9 @@ void GfxAnimate::update() { } else { signal &= 0xFFFF ^ kSignalRemoveView; if (signal & kSignalIgnoreActor) - bitsHandle = _paint16->bitsSave(listEntry->celRect, SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY); + bitsHandle = _paint16->bitsSave(listEntry->celRect, GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY); else - bitsHandle = _paint16->bitsSave(listEntry->celRect, SCI_SCREEN_MASK_ALL); + bitsHandle = _paint16->bitsSave(listEntry->celRect, GFX_SCREEN_MASK_ALL); PUT_SEL32(_s->_segMan, curObject, SELECTOR(underBits), bitsHandle); } listEntry->signal = signal; @@ -361,7 +361,7 @@ void GfxAnimate::update() { if ((signal & kSignalIgnoreActor) == 0) { rect = listEntry->celRect; rect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1); - _paint16->fillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15); + _paint16->fillRect(rect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15); } } listIterator++; @@ -386,7 +386,7 @@ void GfxAnimate::drawCels() { if (!(signal & (kSignalNoUpdate | kSignalHidden | kSignalAlwaysUpdate))) { // Save background - bitsHandle = _paint16->bitsSave(listEntry->celRect, SCI_SCREEN_MASK_ALL); + bitsHandle = _paint16->bitsSave(listEntry->celRect, GFX_SCREEN_MASK_ALL); PUT_SEL32(_s->_segMan, curObject, SELECTOR(underBits), bitsHandle); // draw corresponding cel @@ -504,7 +504,7 @@ void GfxAnimate::reAnimate(Common::Rect rect) { lastCastEntry = _lastCastData; lastCastCount = _lastCastCount; while (lastCastCount > 0) { - lastCastEntry->castHandle = _paint16->bitsSave(lastCastEntry->celRect, SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY); + lastCastEntry->castHandle = _paint16->bitsSave(lastCastEntry->celRect, GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY); _paint16->drawCel(lastCastEntry->viewId, lastCastEntry->loopNo, lastCastEntry->celNo, lastCastEntry->celRect, lastCastEntry->priority, lastCastEntry->paletteNo, lastCastEntry->scaleX, lastCastEntry->scaleY); lastCastEntry++; lastCastCount--; } @@ -546,7 +546,7 @@ void GfxAnimate::addToPicDrawCels() { _paint16->drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo); if ((listEntry->signal & kSignalIgnoreActor) == 0) { listEntry->celRect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(listEntry->priority) - 1, listEntry->celRect.top, listEntry->celRect.bottom - 1); - _paint16->fillRect(listEntry->celRect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15); + _paint16->fillRect(listEntry->celRect, GFX_SCREEN_MASK_CONTROL, 0, 0, 15); } listIterator++; diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index d046c74d60..36dd2d4aed 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -53,7 +53,7 @@ uint16 GfxCompare::isOnControl(uint16 screenMask, const Common::Rect &rect) { if (rect.isEmpty()) return 0; - if (screenMask & SCI_SCREEN_MASK_PRIORITY) { + if (screenMask & GFX_SCREEN_MASK_PRIORITY) { for (y = rect.top; y < rect.bottom; y++) { for (x = rect.left; x < rect.right; x++) { result |= 1 << _screen->getPriority(x, y); @@ -161,7 +161,7 @@ bool GfxCompare::kernelCanBeHere(reg_t curObject, reg_t listReference) { signal = GET_SEL32V(_segMan, curObject, SELECTOR(signal)); controlMask = GET_SEL32V(_segMan, curObject, SELECTOR(illegalBits)); - result = (isOnControl(SCI_SCREEN_MASK_CONTROL, adjustedRect) & controlMask) ? false : true; + result = (isOnControl(GFX_SCREEN_MASK_CONTROL, adjustedRect) & controlMask) ? false : true; if ((result) && (signal & (kSignalIgnoreActor | kSignalRemoveView)) == 0) { List *list = _segMan->lookupList(listReference); if (!list) diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 0241721aa1..bb9551d126 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -563,12 +563,12 @@ void GfxMenu::drawMenu(uint16 oldMenuId, uint16 newMenuId) { } // Save background - _menuSaveHandle = _paint16->bitsSave(_menuRect, SCI_SCREEN_MASK_VISUAL); + _menuSaveHandle = _paint16->bitsSave(_menuRect, GFX_SCREEN_MASK_VISUAL); // Do the drawing - _paint16->fillRect(_menuRect, SCI_SCREEN_MASK_VISUAL, 0); + _paint16->fillRect(_menuRect, GFX_SCREEN_MASK_VISUAL, 0); _menuRect.left++; _menuRect.right--; _menuRect.bottom--; - _paint16->fillRect(_menuRect, SCI_SCREEN_MASK_VISUAL, _screen->getColorWhite()); + _paint16->fillRect(_menuRect, GFX_SCREEN_MASK_VISUAL, _screen->getColorWhite()); _menuRect.left += 8; topPos = _menuRect.top + 1; @@ -588,7 +588,7 @@ void GfxMenu::drawMenu(uint16 oldMenuId, uint16 newMenuId) { pixelPos.y = topPos + (_ports->_curPort->fontHeight >> 1) - 1; pixelPos.x = _menuRect.left - 7; while (pixelPos.x < (_menuRect.right - 1)) { - _screen->putPixel(pixelPos.x, pixelPos.y, SCI_SCREEN_MASK_VISUAL, 0, 0, 0); + _screen->putPixel(pixelPos.x, pixelPos.y, GFX_SCREEN_MASK_VISUAL, 0, 0, 0); pixelPos.x += 2; } } @@ -689,7 +689,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithKeyboard() { calculateMenuAndItemWidth(); _oldPort = _ports->setPort(_ports->_menuPort); - _barSaveHandle = _paint16->bitsSave(_ports->_menuRect, SCI_SCREEN_MASK_VISUAL); + _barSaveHandle = _paint16->bitsSave(_ports->_menuRect, GFX_SCREEN_MASK_VISUAL); _ports->penColor(0); _ports->backColor(_screen->getColorWhite()); @@ -810,7 +810,7 @@ GuiMenuItemEntry *GfxMenu::interactiveWithMouse() { calculateMenuAndItemWidth(); _oldPort = _ports->setPort(_ports->_menuPort); - _barSaveHandle = _paint16->bitsSave(_ports->_menuRect, SCI_SCREEN_MASK_VISUAL); + _barSaveHandle = _paint16->bitsSave(_ports->_menuRect, GFX_SCREEN_MASK_VISUAL); _ports->penColor(0); _ports->backColor(_screen->getColorWhite()); diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index fb63026be9..b829071f74 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -173,13 +173,13 @@ void GfxPaint16::drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 c } void GfxPaint16::clearScreen(byte color) { - fillRect(_ports->_curPort->rect, SCI_SCREEN_MASK_ALL, color, 0, 0); + fillRect(_ports->_curPort->rect, GFX_SCREEN_MASK_ALL, color, 0, 0); } void GfxPaint16::invertRect(const Common::Rect &rect) { int16 oldpenmode = _ports->_curPort->penMode; _ports->_curPort->penMode = 2; - fillRect(rect, SCI_SCREEN_MASK_VISUAL, _ports->_curPort->penClr, _ports->_curPort->backClr); + fillRect(rect, GFX_SCREEN_MASK_VISUAL, _ports->_curPort->penClr, _ports->_curPort->backClr); _ports->_curPort->penMode = oldpenmode; } @@ -197,17 +197,17 @@ void GfxPaint16::invertRectViaXOR(const Common::Rect &rect) { for (y = r.top; y < r.bottom; y++) { for (x = r.left; x < r.right; x++) { curVisual = _screen->getVisual(x, y); - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, curVisual ^ 0x0f, 0, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, curVisual ^ 0x0f, 0, 0); } } } void GfxPaint16::eraseRect(const Common::Rect &rect) { - fillRect(rect, SCI_SCREEN_MASK_VISUAL, _ports->_curPort->backClr); + fillRect(rect, GFX_SCREEN_MASK_VISUAL, _ports->_curPort->backClr); } void GfxPaint16::paintRect(const Common::Rect &rect) { - fillRect(rect, SCI_SCREEN_MASK_VISUAL, _ports->_curPort->penClr); + fillRect(rect, GFX_SCREEN_MASK_VISUAL, _ports->_curPort->penClr); } void GfxPaint16::fillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen, byte clrBack, byte bControl) { @@ -222,22 +222,22 @@ void GfxPaint16::fillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen byte curVisual; // Doing visual first - if (drawFlags & SCI_SCREEN_MASK_VISUAL) { + if (drawFlags & GFX_SCREEN_MASK_VISUAL) { if (oldPenMode == 2) { // invert mode for (y = r.top; y < r.bottom; y++) { for (x = r.left; x < r.right; x++) { curVisual = _screen->getVisual(x, y); if (curVisual == clrPen) { - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrBack, 0, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, clrBack, 0, 0); } else if (curVisual == clrBack) { - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrPen, 0, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, clrPen, 0, 0); } } } } else { // just fill rect with ClrPen for (y = r.top; y < r.bottom; y++) { for (x = r.left; x < r.right; x++) { - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, clrPen, 0, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, clrPen, 0, 0); } } } @@ -245,7 +245,7 @@ void GfxPaint16::fillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen if (drawFlags < 2) return; - drawFlags &= SCI_SCREEN_MASK_PRIORITY|SCI_SCREEN_MASK_CONTROL; + drawFlags &= GFX_SCREEN_MASK_PRIORITY|GFX_SCREEN_MASK_CONTROL; if (oldPenMode != 2) { for (y = r.top; y < r.bottom; y++) { @@ -306,7 +306,7 @@ reg_t GfxPaint16::bitsSave(const Common::Rect &rect, byte screenMask) { if (workerRect.isEmpty()) // nothing to save return NULL_REG; - if (screenMask == SCI_SCREEN_MASK_DISPLAY) { + if (screenMask == GFX_SCREEN_MASK_DISPLAY) { // Adjust rect to upscaled hires, but dont adjust according to port workerRect.top *= 2; workerRect.bottom *= 2; workerRect.bottom++; workerRect.left *= 2; workerRect.right *= 2; workerRect.right++; @@ -407,7 +407,7 @@ reg_t GfxPaint16::kernelGraphSaveBox(Common::Rect rect, uint16 screenMask) { } reg_t GfxPaint16::kernelGraphSaveUpscaledHiresBox(Common::Rect rect) { - return bitsSave(rect, SCI_SCREEN_MASK_DISPLAY); + return bitsSave(rect, GFX_SCREEN_MASK_DISPLAY); } void GfxPaint16::kernelGraphRestoreBox(reg_t handle) { @@ -525,9 +525,9 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { } if (doSaveUnder) - result = bitsSave(rect, SCI_SCREEN_MASK_VISUAL); + result = bitsSave(rect, GFX_SCREEN_MASK_VISUAL); if (colorBack != -1) - fillRect(rect, SCI_SCREEN_MASK_VISUAL, colorBack, 0, 0); + fillRect(rect, GFX_SCREEN_MASK_VISUAL, colorBack, 0, 0); _text16->Box(text, 0, rect, alignment, -1); if (_screen->_picNotValid == 0 && bRedraw) bitsShow(rect); diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index c0811298bb..711efc9816 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -52,7 +52,7 @@ void GfxPaint32::fillRect(Common::Rect rect, byte color) { int16 y, x; for (y = rect.top; y < rect.bottom; y++) { for (x = rect.left; x < rect.right; x++) { - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, color, 0, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, color, 0, 0); } } } diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index a464a7b92f..c7c2503eae 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -86,7 +86,7 @@ void GfxPicture::reset() { int16 x, y; for (y = _ports->getPort()->top; y < _screen->getHeight(); y++) { for (x = 0; x < _screen->getWidth(); x++) { - _screen->putPixel(x, y, SCI_SCREEN_MASK_ALL, 255, 0, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_ALL, 255, 0, 0); } } } @@ -304,7 +304,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos while (y < lastY) { curByte = *ptr++; if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY, curByte, priority, 0); x++; @@ -321,7 +321,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos while (y < lastY) { curByte = *ptr++; if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY, curByte, priority, 0); if (x == leftX) { if (width > rightX - leftX) // Skip extra pixels at the end of the row @@ -716,35 +716,35 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by byte searchControl = _screen->getControl(p.x, p.y); // This logic was taken directly from sierra sci, floodfill will get aborted on various occations - if (screenMask & SCI_SCREEN_MASK_VISUAL) { + if (screenMask & GFX_SCREEN_MASK_VISUAL) { if ((color == _screen->getColorWhite()) || (searchColor != _screen->getColorWhite())) return; - } else if (screenMask & SCI_SCREEN_MASK_PRIORITY) { + } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { if ((priority == 0) || (searchPriority != 0)) return; - } else if (screenMask & SCI_SCREEN_MASK_CONTROL) { + } else if (screenMask & GFX_SCREEN_MASK_CONTROL) { if ((control == 0) || (searchControl != 0)) return; } // Now remove screens, that already got the right color/priority/control - if ((screenMask & SCI_SCREEN_MASK_VISUAL) && (searchColor == color)) - screenMask ^= SCI_SCREEN_MASK_VISUAL; - if ((screenMask & SCI_SCREEN_MASK_PRIORITY) && (searchPriority == priority)) - screenMask ^= SCI_SCREEN_MASK_PRIORITY; - if ((screenMask & SCI_SCREEN_MASK_CONTROL) && (searchControl == control)) - screenMask ^= SCI_SCREEN_MASK_CONTROL; + if ((screenMask & GFX_SCREEN_MASK_VISUAL) && (searchColor == color)) + screenMask ^= GFX_SCREEN_MASK_VISUAL; + if ((screenMask & GFX_SCREEN_MASK_PRIORITY) && (searchPriority == priority)) + screenMask ^= GFX_SCREEN_MASK_PRIORITY; + if ((screenMask & GFX_SCREEN_MASK_CONTROL) && (searchControl == control)) + screenMask ^= GFX_SCREEN_MASK_CONTROL; // Exit, if no screens left if (!screenMask) return; - if (screenMask & SCI_SCREEN_MASK_VISUAL) { - matchMask = SCI_SCREEN_MASK_VISUAL; - } else if (screenMask & SCI_SCREEN_MASK_PRIORITY) { - matchMask = SCI_SCREEN_MASK_PRIORITY; + if (screenMask & GFX_SCREEN_MASK_VISUAL) { + matchMask = GFX_SCREEN_MASK_VISUAL; + } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { + matchMask = GFX_SCREEN_MASK_PRIORITY; } else { - matchMask = SCI_SCREEN_MASK_CONTROL; + matchMask = GFX_SCREEN_MASK_CONTROL; } // hard borders for filling diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index c849044104..fe59f0aa1f 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -247,7 +247,7 @@ Window *GfxPorts::newWindow(const Common::Rect &dims, const Common::Rect *restor pwnd->hSaved1 = pwnd->hSaved2 = NULL_REG; pwnd->bDrawn = false; if ((style & SCI_WINDOWMGR_STYLE_TRANSPARENT) == 0) - pwnd->saveScreenMask = (priority == -1 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY); + pwnd->saveScreenMask = (priority == -1 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY); if (title && (style & SCI_WINDOWMGR_STYLE_TITLE)) { pwnd->title = title; @@ -301,11 +301,11 @@ void GfxPorts::drawWindow(Window *pWnd) { Port *oldport = setPort(_wmgrPort); penColor(0); if ((wndStyle & SCI_WINDOWMGR_STYLE_TRANSPARENT) == 0) { - pWnd->hSaved1 = _paint16->bitsSave(pWnd->restoreRect, SCI_SCREEN_MASK_VISUAL); - if (pWnd->saveScreenMask & SCI_SCREEN_MASK_PRIORITY) { - pWnd->hSaved2 = _paint16->bitsSave(pWnd->restoreRect, SCI_SCREEN_MASK_PRIORITY); + pWnd->hSaved1 = _paint16->bitsSave(pWnd->restoreRect, GFX_SCREEN_MASK_VISUAL); + if (pWnd->saveScreenMask & GFX_SCREEN_MASK_PRIORITY) { + pWnd->hSaved2 = _paint16->bitsSave(pWnd->restoreRect, GFX_SCREEN_MASK_PRIORITY); if ((wndStyle & SCI_WINDOWMGR_STYLE_USER) == 0) - _paint16->fillRect(pWnd->restoreRect, SCI_SCREEN_MASK_PRIORITY, 0, 15); + _paint16->fillRect(pWnd->restoreRect, GFX_SCREEN_MASK_PRIORITY, 0, 15); } } @@ -327,9 +327,9 @@ void GfxPorts::drawWindow(Window *pWnd) { } r.grow(-1); if (getSciVersion() <= SCI_VERSION_0_LATE) - _paint16->fillRect(r, SCI_SCREEN_MASK_VISUAL, 8); // grey titlebar for SCI0 + _paint16->fillRect(r, GFX_SCREEN_MASK_VISUAL, 8); // grey titlebar for SCI0 else - _paint16->fillRect(r, SCI_SCREEN_MASK_VISUAL, 0); // black titlebar for SCI01+ + _paint16->fillRect(r, GFX_SCREEN_MASK_VISUAL, 0); // black titlebar for SCI01+ if (!pWnd->title.empty()) { int16 oldcolor = getPort()->penClr; penColor(_screen->getColorWhite()); @@ -346,7 +346,7 @@ void GfxPorts::drawWindow(Window *pWnd) { } if (!(wndStyle & SCI_WINDOWMGR_STYLE_TRANSPARENT)) - _paint16->fillRect(r, SCI_SCREEN_MASK_VISUAL, pWnd->backClr); + _paint16->fillRect(r, GFX_SCREEN_MASK_VISUAL, pWnd->backClr); _paint16->bitsShow(pWnd->restoreRect); } @@ -371,11 +371,11 @@ void GfxPorts::updateWindow(Window *wnd) { reg_t handle; if (wnd->saveScreenMask && wnd->bDrawn) { - handle = _paint16->bitsSave(wnd->restoreRect, SCI_SCREEN_MASK_VISUAL); + handle = _paint16->bitsSave(wnd->restoreRect, GFX_SCREEN_MASK_VISUAL); _paint16->bitsRestore(wnd->hSaved1); wnd->hSaved1 = handle; - if (wnd->saveScreenMask & SCI_SCREEN_MASK_PRIORITY) { - handle = _paint16->bitsSave(wnd->restoreRect, SCI_SCREEN_MASK_PRIORITY); + if (wnd->saveScreenMask & GFX_SCREEN_MASK_PRIORITY) { + handle = _paint16->bitsSave(wnd->restoreRect, GFX_SCREEN_MASK_PRIORITY); _paint16->bitsRestore(wnd->hSaved2); wnd->hSaved2 = handle; } diff --git a/engines/sci/graphics/robot.cpp b/engines/sci/graphics/robot.cpp index a2243975f4..2f711eb58a 100644 --- a/engines/sci/graphics/robot.cpp +++ b/engines/sci/graphics/robot.cpp @@ -168,7 +168,7 @@ void Robot::draw() { //for (frame = 0; frame < 30; frame++) { for (y = 0; y < _height; y++) { for (x = 0; x < _width; x++) { - _screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL, *bitmapData, 0, 0); + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, *bitmapData, 0, 0); bitmapData++; } } diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index e6c710b252..7a67936ebf 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -135,18 +135,18 @@ void GfxScreen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y) { byte GfxScreen::getDrawingMask(byte color, byte prio, byte control) { byte flag = 0; if (color != 255) - flag |= SCI_SCREEN_MASK_VISUAL; + flag |= GFX_SCREEN_MASK_VISUAL; if (prio != 255) - flag |= SCI_SCREEN_MASK_PRIORITY; + flag |= GFX_SCREEN_MASK_PRIORITY; if (control != 255) - flag |= SCI_SCREEN_MASK_CONTROL; + flag |= GFX_SCREEN_MASK_CONTROL; return flag; } void GfxScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) { int offset = y * _width + x; - if (drawMask & SCI_SCREEN_MASK_VISUAL) { + if (drawMask & GFX_SCREEN_MASK_VISUAL) { _visualScreen[offset] = color; if (!_upscaledHires) { _displayScreen[offset] = color; @@ -158,9 +158,9 @@ void GfxScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, _displayScreen[displayOffset + _displayWidth + 1] = color; } } - if (drawMask & SCI_SCREEN_MASK_PRIORITY) + if (drawMask & GFX_SCREEN_MASK_PRIORITY) _priorityScreen[offset] = priority; - if (drawMask & SCI_SCREEN_MASK_CONTROL) + if (drawMask & GFX_SCREEN_MASK_CONTROL) _controlScreen[offset] = control; } @@ -258,19 +258,19 @@ byte GfxScreen::isFillMatch(int16 x, int16 y, byte screenMask, byte t_color, byt int offset = y * _width + x; byte match = 0; - if (screenMask & SCI_SCREEN_MASK_VISUAL && *(_visualScreen + offset) == t_color) - match |= SCI_SCREEN_MASK_VISUAL; - if (screenMask & SCI_SCREEN_MASK_PRIORITY && *(_priorityScreen + offset) == t_pri) - match |= SCI_SCREEN_MASK_PRIORITY; - if (screenMask & SCI_SCREEN_MASK_CONTROL && *(_controlScreen + offset) == t_con) - match |= SCI_SCREEN_MASK_CONTROL; + if (screenMask & GFX_SCREEN_MASK_VISUAL && *(_visualScreen + offset) == t_color) + match |= GFX_SCREEN_MASK_VISUAL; + if (screenMask & GFX_SCREEN_MASK_PRIORITY && *(_priorityScreen + offset) == t_pri) + match |= GFX_SCREEN_MASK_PRIORITY; + if (screenMask & GFX_SCREEN_MASK_CONTROL && *(_controlScreen + offset) == t_con) + match |= GFX_SCREEN_MASK_CONTROL; return match; } int GfxScreen::bitsGetDataSize(Common::Rect rect, byte mask) { int byteCount = sizeof(rect) + sizeof(mask); int pixels = rect.width() * rect.height(); - if (mask & SCI_SCREEN_MASK_VISUAL) { + if (mask & GFX_SCREEN_MASK_VISUAL) { byteCount += pixels; // _visualScreen if (!_upscaledHires) { byteCount += pixels; // _displayScreen @@ -278,13 +278,13 @@ int GfxScreen::bitsGetDataSize(Common::Rect rect, byte mask) { byteCount += pixels * 4; // _displayScreen (upscaled hires) } } - if (mask & SCI_SCREEN_MASK_PRIORITY) { + if (mask & GFX_SCREEN_MASK_PRIORITY) { byteCount += pixels; // _priorityScreen } - if (mask & SCI_SCREEN_MASK_CONTROL) { + if (mask & GFX_SCREEN_MASK_CONTROL) { byteCount += pixels; // _controlScreen } - if (mask & SCI_SCREEN_MASK_DISPLAY) { + if (mask & GFX_SCREEN_MASK_DISPLAY) { if (!_upscaledHires) error("bitsGetDataSize() called w/o being in upscaled hires mode"); byteCount += pixels; // _displayScreen (coordinates actually are given to us for hires displayScreen) @@ -297,17 +297,17 @@ void GfxScreen::bitsSave(Common::Rect rect, byte mask, byte *memoryPtr) { memcpy(memoryPtr, (void *)&rect, sizeof(rect)); memoryPtr += sizeof(rect); memcpy(memoryPtr, (void *)&mask, sizeof(mask)); memoryPtr += sizeof(mask); - if (mask & SCI_SCREEN_MASK_VISUAL) { + if (mask & GFX_SCREEN_MASK_VISUAL) { bitsSaveScreen(rect, _visualScreen, _width, memoryPtr); bitsSaveDisplayScreen(rect, memoryPtr); } - if (mask & SCI_SCREEN_MASK_PRIORITY) { + if (mask & GFX_SCREEN_MASK_PRIORITY) { bitsSaveScreen(rect, _priorityScreen, _width, memoryPtr); } - if (mask & SCI_SCREEN_MASK_CONTROL) { + if (mask & GFX_SCREEN_MASK_CONTROL) { bitsSaveScreen(rect, _controlScreen, _width, memoryPtr); } - if (mask & SCI_SCREEN_MASK_DISPLAY) { + if (mask & GFX_SCREEN_MASK_DISPLAY) { if (!_upscaledHires) error("bitsSave() called w/o being in upscaled hires mode"); bitsSaveScreen(rect, _displayScreen, _displayWidth, memoryPtr); @@ -356,17 +356,17 @@ void GfxScreen::bitsRestore(byte *memoryPtr) { memcpy((void *)&rect, memoryPtr, sizeof(rect)); memoryPtr += sizeof(rect); memcpy((void *)&mask, memoryPtr, sizeof(mask)); memoryPtr += sizeof(mask); - if (mask & SCI_SCREEN_MASK_VISUAL) { + if (mask & GFX_SCREEN_MASK_VISUAL) { bitsRestoreScreen(rect, memoryPtr, _visualScreen, _width); bitsRestoreDisplayScreen(rect, memoryPtr); } - if (mask & SCI_SCREEN_MASK_PRIORITY) { + if (mask & GFX_SCREEN_MASK_PRIORITY) { bitsRestoreScreen(rect, memoryPtr, _priorityScreen, _width); } - if (mask & SCI_SCREEN_MASK_CONTROL) { + if (mask & GFX_SCREEN_MASK_CONTROL) { bitsRestoreScreen(rect, memoryPtr, _controlScreen, _width); } - if (mask & SCI_SCREEN_MASK_DISPLAY) { + if (mask & GFX_SCREEN_MASK_DISPLAY) { if (!_upscaledHires) error("bitsRestore() called w/o being in upscaled hires mode"); bitsRestoreScreen(rect, memoryPtr, _displayScreen, _displayWidth); diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 3316b53c69..f73b23a55d 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -35,11 +35,19 @@ namespace Sci { #define SCI_SCREEN_MAXHEIGHT 400 -#define SCI_SCREEN_MASK_VISUAL 1 -#define SCI_SCREEN_MASK_PRIORITY 2 -#define SCI_SCREEN_MASK_CONTROL 4 -#define SCI_SCREEN_MASK_DISPLAY 8 // not official sierra sci -#define SCI_SCREEN_MASK_ALL SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY|SCI_SCREEN_MASK_CONTROL +enum GfxScreenUpscaledMode { + GFX_SCREEN_UPSCALED_DISABLED = 0, + GFX_SCREEN_UPSCALED_640x400 = 1, + GFX_SCREEN_UPSCALED_640x480 = 2 +}; + +enum GfxScreenMasks { + GFX_SCREEN_MASK_VISUAL = 1, + GFX_SCREEN_MASK_PRIORITY = 2, + GFX_SCREEN_MASK_CONTROL = 4, + GFX_SCREEN_MASK_DISPLAY = 8, // not official sierra sci, only used internally + GFX_SCREEN_MASK_ALL = GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY|GFX_SCREEN_MASK_CONTROL +}; #define SCI_SCREEN_UNDITHERMEMORIAL_SIZE 256 diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 4e4d183ca1..aa1ad10c75 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -507,7 +507,7 @@ void GfxView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRe int16 width, height; byte clearKey = celInfo->clearKey; byte color; - byte drawMask = priority == 255 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY; + byte drawMask = priority == 255 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY; int x, y; if (_embeddedPal) { @@ -554,7 +554,7 @@ void GfxView::drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect int16 celHeight = celInfo->height, celWidth = celInfo->width; byte clearKey = celInfo->clearKey; byte color; - byte drawMask = priority == 255 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL|SCI_SCREEN_MASK_PRIORITY; + byte drawMask = priority == 255 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY; int x, y; uint16 scalingX[320]; uint16 scalingY[200]; |