aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2006-01-02 23:36:33 +0000
committerMax Horn2006-01-02 23:36:33 +0000
commit01eb5d503ad05b3d7370278c6e02ec851e112713 (patch)
tree01a334e0fd202a8e580bc8241220f2c044e5b3bb /scumm
parentbd965cd48388afdd8a85adf93d186db3da325822 (diff)
downloadscummvm-rg350-01eb5d503ad05b3d7370278c6e02ec851e112713.tar.gz
scummvm-rg350-01eb5d503ad05b3d7370278c6e02ec851e112713.tar.bz2
scummvm-rg350-01eb5d503ad05b3d7370278c6e02ec851e112713.zip
V7/V8 games do not use the text masking anymore at all, so we can optimize drawStripToScreen for them (this should improve CoMI speed a bit)
svn-id: r19891
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 908162926b..cd198d24e2 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -535,19 +535,26 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// Compute screen etc. buffer pointers
const byte *src = vs->getPixels(x, top);
byte *dst = _compositeBuf + x + y * _screenWidth;
- const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch;
- // Compose the text over the game graphics
- for (int h = 0; h < height; ++h) {
- for (int w = 0; w < width; ++w) {
- if (text[w] == CHARSET_MASK_TRANSPARENCY)
- dst[w] = src[w];
- else
- dst[w] = text[w];
+ if (_version < 7) {
+ // Handle the text mask in older games; newer (V7/V8) games do not use it anymore.
+ const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch;
+
+ // Compose the text over the game graphics
+ for (int h = 0; h < height; ++h) {
+ for (int w = 0; w < width; ++w) {
+ if (text[w] == CHARSET_MASK_TRANSPARENCY)
+ dst[w] = src[w];
+ else
+ dst[w] = text[w];
+ }
+ src += vs->pitch;
+ dst += _screenWidth;
+ text += _charset->_textSurface.pitch;
}
- src += vs->pitch;
- dst += _screenWidth;
- text += _charset->_textSurface.pitch;
+ } else {
+ // Just do a simple blit in V7/V8 games.
+ blit(dst, _screenWidth, src, vs->pitch, width, height);
}
if (_renderMode == Common::kRenderCGA)