aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/charset-fontdata.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-07-06 06:21:59 +0000
committerTravis Howell2009-07-06 06:21:59 +0000
commitdc0f6dce7698ce383ad7ca82f8ae1dcba984a044 (patch)
tree91bd92cb5835a456efa42361d5b9fd5a8bf619db /engines/agos/charset-fontdata.cpp
parent08df8dc2721808c7019f49d9051e2eebfe8dad9c (diff)
downloadscummvm-rg350-dc0f6dce7698ce383ad7ca82f8ae1dcba984a044.tar.gz
scummvm-rg350-dc0f6dce7698ce383ad7ca82f8ae1dcba984a044.tar.bz2
scummvm-rg350-dc0f6dce7698ce383ad7ca82f8ae1dcba984a044.zip
Use graphics surfaces for screen buffers, and always use correct pitch when writing to the frameBuffer.
svn-id: r42163
Diffstat (limited to 'engines/agos/charset-fontdata.cpp')
-rw-r--r--engines/agos/charset-fontdata.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp
index d23e772306..1cbc4f95dc 100644
--- a/engines/agos/charset-fontdata.cpp
+++ b/engines/agos/charset-fontdata.cpp
@@ -2090,7 +2090,7 @@ static const byte english_pnFont[] = {
void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
const byte *src;
byte color, *dst;
- uint h, w, i;
+ uint dstPitch, h, w, i;
if (_noOracleScroll)
return;
@@ -2100,7 +2100,8 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
Graphics::Surface *screen = _system->lockScreen();
if (getGameType() == GType_FF || getGameType() == GType_PP) {
- dst = getBackGround() + y * _dxSurfacePitch + x + window->textColumnOffset;
+ dst = getBackGround();
+ dstPitch = _backGroundBuf->pitch;
h = 13;
w = getFeebleFontSize(chr);
@@ -2109,7 +2110,8 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
else
src = feeble_windowFont + (chr - 32) * 13;
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
- dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
+ dst = (byte *)screen->pixels;
+ dstPitch = screen->pitch;
h = 8;
w = 6;
@@ -2145,7 +2147,8 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
error("windowDrawChar: Unknown language %d", _language);
}
} else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
- dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
+ dst = (byte *)screen->pixels;
+ dstPitch = screen->pitch;
h = 8;
w = 6;
@@ -2169,18 +2172,21 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
error("windowDrawChar: Unknown language %d", _language);
}
} else if (getGameType() == GType_ELVIRA1) {
- dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
+ dst = (byte *)screen->pixels;
+ dstPitch = screen->pitch;
h = 8;
w = 6;
src = english_elvira1Font + (chr - 32) * 8;
} else {
- dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
+ dst = (byte *)screen->pixels;
+ dstPitch = screen->pitch;
h = 8;
w = 8;
src = english_pnFont + (chr - 32) * 8;
}
+ dst += y * dstPitch + x + window->textColumnOffset;
color = window->textColor;
if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
@@ -2201,7 +2207,7 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
b <<= 1;
} while (++i != w);
- dst += _dxSurfacePitch;
+ dst += dstPitch;
} while (--h);
_system->unlockScreen();