SCI: SCI_SCREEN_MASK_* now GFX_SCREEN_MASK_*, using enum - added new enum GFX_SCREEN_UPSCALED_*

svn-id: r49039
This commit is contained in:
Martin Kiewitz 2010-05-15 08:57:13 +00:00
parent 83a25d2e37
commit 59a255226f
12 changed files with 99 additions and 91 deletions

View File

@ -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;

View File

@ -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++;

View File

@ -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)

View File

@ -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());

View File

@ -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);

View File

@ -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);
}
}
}

View File

@ -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

View File

@ -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;
}

View File

@ -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++;
}
}

View File

@ -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);

View File

@ -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

View File

@ -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];