diff options
author | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
commit | ad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch) | |
tree | e568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /engines/scumm/gfx.cpp | |
parent | d7411acc2b1c7702280dbff1c3e1bafee528184b (diff) | |
parent | e25e85fbb047fef895ede97c3c2c73451631052c (diff) | |
download | scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2 scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/scumm/gfx.cpp')
-rw-r--r-- | engines/scumm/gfx.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 1b913e16b4..f22547f193 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -251,7 +251,7 @@ GdiV2::~GdiV2() { } #ifdef USE_RGB_COLOR -Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) { +GdiHE16bit::GdiHE16bit(ScummEngine *vm) : GdiHE(vm) { } #endif @@ -652,16 +652,13 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i assert(0 == (width & 3)); // Compose the text over the game graphics -#ifdef USE_ARM_GFX_ASM - asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch); -#else #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_game.platform == Common::kPlatformFMTowns) { towns_drawStripToScreen(vs, x, y, x, top, width, height); - return; + return; } else -#endif - if (_bytesPerPixelOutput == 2) { +#endif + if (_outputPixelFormat.bytesPerPixel == 2) { const byte *srcPtr = (const byte *)src; const byte *textPtr = (byte *)_textSurface.getBasePtr(x * m, y * m); byte *dstPtr = _compositeBuf; @@ -682,7 +679,11 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i srcPtr += vsPitch; textPtr += _textSurface.pitch - width * m; } - } else { + } +#ifdef USE_ARM_GFX_ASM + asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch); +#else + else { // We blit four pixels at a time, for improved performance. const uint32 *src32 = (const uint32 *)src; uint32 *dst32 = (uint32 *)_compositeBuf; @@ -721,11 +722,11 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height); - src = _herculesBuf + x + y * Common::kHercW; - pitch = Common::kHercW; + src = _herculesBuf + x + y * kHercWidth; + pitch = kHercWidth; // center image on the screen - x += (Common::kHercW - _screenWidth * 2) / 2; // (720 - 320*2)/2 = 40 + x += (kHercWidth - _screenWidth * 2) / 2; // (720 - 320*2)/2 = 40 } else if (_useCJKMode && m == 2) { pitch *= m; x *= m; @@ -818,10 +819,10 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid int dsty = yo*2 - yo/4; for (int y1 = 0; y1 < heighto;) { - assert(dsty < Common::kHercH); + assert(dsty < kHercHeight); srcptr = src + y1 * srcPitch; - dstptr = hercbuf + dsty * Common::kHercW + xo * 2; + dstptr = hercbuf + dsty * kHercWidth + xo * 2; const int idx1 = (dsty % 7) % 2; for (int x1 = 0; x1 < widtho; x1++) { @@ -1023,7 +1024,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) { if (rect.left > vs->w) return; - + // Convert 'rect' to local (virtual screen) coordinates rect.top -= vs->topline; rect.bottom -= vs->topline; @@ -1067,7 +1068,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) { fill(mask, _textSurface.pitch, backColor, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); } #endif - + if (_game.features & GF_16BIT_COLOR) fill(screenBuf, vs->pitch, _16BitPalette[backColor], width, height, vs->format.bytesPerPixel); else @@ -1127,7 +1128,7 @@ void ScummEngine::clearTextSurface() { fill((byte*)_textSurface.pixels, _textSurface.pitch, #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE _game.platform == Common::kPlatformFMTowns ? 0 : -#endif +#endif CHARSET_MASK_TRANSPARENCY, _textSurface.w, _textSurface.h, _textSurface.format.bytesPerPixel); } @@ -1344,12 +1345,12 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) { color = ((color & 0x0f) << 4) | (color & 0x0f); byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop + vs->topline) * _textSurfaceMultiplier); fill(mask, _textSurface.pitch, color, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); - + if (_game.id == GID_MONKEY2 || _game.id == GID_INDY4 || ((_game.id == GID_INDY3 || _game.id == GID_ZAK) && vs->number != kTextVirtScreen) || (_game.id == GID_LOOM && vs->number == kMainVirtScreen)) return; } #endif - + fill(backbuff, vs->pitch, color, width, height, vs->format.bytesPerPixel); } } @@ -3673,7 +3674,7 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons #undef READ_BIT_256 #ifdef USE_RGB_COLOR -void Gdi16Bit::writeRoomColor(byte *dst, byte color) const { +void GdiHE16bit::writeRoomColor(byte *dst, byte color) const { WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2)); } #endif @@ -4009,7 +4010,7 @@ void ScummEngine::scrollEffect(int dir) { y = 1 + step; while (y < vs->h) { moveScreen(0, -step, vs->h); -#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE +#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_townsScreen) { towns_drawStripToScreen(vs, 0, vs->topline + vs->h - step, 0, y - step, vs->w, step); } else @@ -4022,7 +4023,7 @@ void ScummEngine::scrollEffect(int dir) { vs->w * m, step * m); _system->updateScreen(); } - + waitForTimer(delay); y += step; } @@ -4045,7 +4046,7 @@ void ScummEngine::scrollEffect(int dir) { vs->w * m, step * m); _system->updateScreen(); } - + waitForTimer(delay); y += step; } @@ -4092,7 +4093,7 @@ void ScummEngine::scrollEffect(int dir) { 0, 0, step, vs->h); _system->updateScreen(); - } + } waitForTimer(delay); x += step; |