aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorD G Turner2012-10-20 23:19:47 +0100
committerD G Turner2012-10-20 23:19:47 +0100
commitb25ed0a02f22aa1bcee826c6843870b299b0c1ed (patch)
treea6d8e5978557ce55e27d83bb1587e9f2cb2b2f7a /engines
parentb32771acafe41ddaa1f05daab90aef84b5dc8c56 (diff)
downloadscummvm-rg350-b25ed0a02f22aa1bcee826c6843870b299b0c1ed.tar.gz
scummvm-rg350-b25ed0a02f22aa1bcee826c6843870b299b0c1ed.tar.bz2
scummvm-rg350-b25ed0a02f22aa1bcee826c6843870b299b0c1ed.zip
COMPOSER: Change screen surface variable naming for clarity.
This makes it easier to read the code where sprite surfaces are blitted to the screen.
Diffstat (limited to 'engines')
-rw-r--r--engines/composer/composer.cpp4
-rw-r--r--engines/composer/composer.h2
-rw-r--r--engines/composer/graphics.cpp14
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index f2fef3cd68..5db778dfda 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -102,7 +102,7 @@ Common::Error ComposerEngine::run() {
if (_bookIni.hasKey("Height", "Common"))
height = atoi(getStringFromConfig("Common", "Height").c_str());
initGraphics(width, height, true);
- _surface.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+ _screen.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_needsUpdate = true;
Graphics::Cursor *cursor = Graphics::makeDefaultWinCursor();
@@ -214,7 +214,7 @@ Common::Error ComposerEngine::run() {
_system->delayMillis(20);
}
- _surface.free();
+ _screen.free();
return Common::kNoError;
}
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 0f53258289..33a5356b3a 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -170,7 +170,7 @@ private:
bool _needsUpdate;
Common::Array<Common::Rect> _dirtyRects;
- Graphics::Surface _surface;
+ Graphics::Surface _screen;
Common::List<Sprite> _sprites;
uint _directoriesToStrip;
diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp
index 1314e903ae..2b68fac233 100644
--- a/engines/composer/graphics.cpp
+++ b/engines/composer/graphics.cpp
@@ -507,7 +507,7 @@ const Sprite *ComposerEngine::getSpriteAtPos(const Common::Point &pos) {
void ComposerEngine::dirtySprite(const Sprite &sprite) {
Common::Rect rect(sprite._pos.x, sprite._pos.y, sprite._pos.x + sprite._surface.w, sprite._pos.y + sprite._surface.h);
- rect.clip(_surface.w, _surface.h);
+ rect.clip(_screen.w, _screen.h);
if (rect.isEmpty())
return;
@@ -541,8 +541,8 @@ void ComposerEngine::redraw() {
for (uint i = 0; i < _dirtyRects.size(); i++) {
const Common::Rect &rect = _dirtyRects[i];
- byte *pixels = (byte *)_surface.pixels + (rect.top * _surface.pitch) + rect.left;
- _system->copyRectToScreen(pixels, _surface.pitch, rect.left, rect.top, rect.width(), rect.height());
+ byte *pixels = (byte *)_screen.pixels + (rect.top * _screen.pitch) + rect.left;
+ _system->copyRectToScreen(pixels, _screen.pitch, rect.left, rect.top, rect.width(), rect.height());
}
_system->updateScreen();
@@ -814,16 +814,16 @@ void ComposerEngine::drawSprite(const Sprite &sprite) {
int y = sprite._pos.y;
// incoming data is BMP-style (bottom-up), so flip it
- byte *pixels = (byte *)_surface.pixels;
+ byte *pixels = (byte *)_screen.pixels;
for (int j = 0; j < sprite._surface.h; j++) {
if (j + y < 0)
continue;
- if (j + y >= _surface.h)
+ if (j + y >= _screen.h)
break;
byte *in = (byte *)sprite._surface.pixels + (sprite._surface.h - j - 1) * sprite._surface.w;
- byte *out = pixels + ((j + y) * _surface.w) + x;
+ byte *out = pixels + ((j + y) * _screen.w) + x;
for (int i = 0; i < sprite._surface.w; i++)
- if ((x + i >= 0) && (x + i < _surface.w) && in[i])
+ if ((x + i >= 0) && (x + i < _screen.w) && in[i])
out[i] = in[i];
}
}