aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2007-07-09 09:21:25 +0000
committerMax Horn2007-07-09 09:21:25 +0000
commit9782c35eaf4d34a13fae63151ba226d0ed1fd60d (patch)
tree43bf7476417fa64f2c03666b62f2274e0fae2fd4 /engines/scumm
parent705c1e8403dc0b96ddfc488c93e2631a146cbb85 (diff)
downloadscummvm-rg350-9782c35eaf4d34a13fae63151ba226d0ed1fd60d.tar.gz
scummvm-rg350-9782c35eaf4d34a13fae63151ba226d0ed1fd60d.tar.bz2
scummvm-rg350-9782c35eaf4d34a13fae63151ba226d0ed1fd60d.zip
SCUMM: use the _compositeBuf, with 'natural' line pitch (implying linear memory access for potentially better performance)
svn-id: r27988
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/gfx.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 9306c8eac7..540c347ed7 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -572,33 +572,32 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// screen contents. Secondly, a rendering mode might be active, which
// means a filter has to be applied.
- // Compute pointers to the composite buffer and the text surface
+ // Compute pointer to the text surface
assert(_compositeBuf);
- byte *dst = _compositeBuf + x + y * _screenWidth;
const byte *text = (byte *)_textSurface.getBasePtr(x, y);
#ifdef __DS__
- DS::asmDrawStripToScreen(height, width, text, src, dst, vs->pitch, _screenWidth, _textSurface.pitch);
+ DS::asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch);
#else
// Compose the text over the game graphics
+ byte *dst = _compositeBuf;
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
if (text[w] == CHARSET_MASK_TRANSPARENCY)
- dst[w] = src[w];
+ *dst++ = src[w];
else
- dst[w] = text[w];
+ *dst++ = text[w];
}
src += vs->pitch;
- dst += _screenWidth;
text += _textSurface.pitch;
}
#endif
- src = dst = _compositeBuf + x + y * _screenWidth;
- int pitch = _screenWidth;
+ src = _compositeBuf;
+ int pitch = width;
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
- ditherHerc(dst, _herculesBuf, _screenWidth, &x, &y, &width, &height);
+ ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height);
src = _herculesBuf + x + y * Common::kHercW;
pitch = Common::kHercW;
@@ -607,7 +606,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
x += (Common::kHercW - _screenWidth * 2) / 2; // (720 - 320*2)/2 = 40
} else {
if (_renderMode == Common::kRenderCGA)
- ditherCGA(dst, _screenWidth, x, y, width, height);
+ ditherCGA(_compositeBuf, width, x, y, width, height);
// HACK: This is dirty hack which renders narrow NES rooms centered
// NES can address negative number strips and that poses problem for