aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/charset.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-06-21 03:14:20 +0000
committerTravis Howell2007-06-21 03:14:20 +0000
commit89b2cf75e22fd76b48e9e27d70ba617d5b2468b6 (patch)
tree2acc580f2cac44a4524003665387a9f0b5484185 /engines/agos/charset.cpp
parent3f5eb0f976e3e6cf0d8e4306ffd3767759eb707f (diff)
downloadscummvm-rg350-89b2cf75e22fd76b48e9e27d70ba617d5b2468b6.tar.gz
scummvm-rg350-89b2cf75e22fd76b48e9e27d70ba617d5b2468b6.tar.bz2
scummvm-rg350-89b2cf75e22fd76b48e9e27d70ba617d5b2468b6.zip
Use frameBuffer directly, in order to drop extra buffer (frontBuffer) and cleanup code.
svn-id: r27577
Diffstat (limited to 'engines/agos/charset.cpp')
-rw-r--r--engines/agos/charset.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp
index 298805ba2d..5b5e85f002 100644
--- a/engines/agos/charset.cpp
+++ b/engines/agos/charset.cpp
@@ -25,9 +25,13 @@
#include "common/stdafx.h"
+#include "common/system.h"
+
#include "agos/agos.h"
#include "agos/intern.h"
+#include "graphics/surface.h"
+
namespace AGOS {
void AGOSEngine_Feeble::doOutput(const byte *src, uint len) {
@@ -712,13 +716,15 @@ void AGOSEngine::windowScroll(WindowBlock *window) {
_lockWord |= 0x8000;
if (window->height != 1) {
+ Graphics::Surface *screen = _system->lockScreen();
+
byte *src, *dst;
uint16 w, h;
w = window->width * 8;
h = (window->height -1) * 8;
- dst = getFrontBuf() + window->y * _screenWidth + window->x * 8;
+ dst = (byte *)screen->pixels + window->y * _screenWidth + window->x * 8;
src = dst + 8 * _screenWidth;
do {
@@ -726,6 +732,8 @@ void AGOSEngine::windowScroll(WindowBlock *window) {
src += _screenWidth;
dst += _screenWidth;
} while (--h);
+
+ _system->unlockScreen();
}
colorBlock(window, window->x * 8, (window->height - 1) * 8 + window->y, window->width * 8, 8);
@@ -2169,14 +2177,16 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
_lockWord |= 0x8000;
- dst = getFrontBuf() + y * _dxSurfacePitch + x + window->textColumnOffset;
+ Graphics::Surface *screen = _system->lockScreen();
if (getGameType() == GType_FF || getGameType() == GType_PP) {
+ dst = getBackGround() + y * _dxSurfacePitch + x + window->textColumnOffset;
h = 13;
w = feebleFontSize[chr - 0x20];
src = feeble_windowFont + (chr - 0x20) * 13;
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
+ dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
h = 8;
w = 6;
@@ -2212,6 +2222,7 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
error("windowDrawChar: Unknown language %d\n", _language);
}
} else {
+ dst = (byte *)screen->pixels + y * _dxSurfacePitch + x + window->textColumnOffset;
h = 8;
w = 6;
@@ -2259,6 +2270,8 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {
dst += _dxSurfacePitch;
} while (--h);
+ _system->unlockScreen();
+
_lockWord &= ~0x8000;
}