aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/agos.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/agos.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/agos.cpp')
-rw-r--r--engines/agos/agos.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index cdbeeecd8e..4a8170b2a4 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -33,6 +33,8 @@
#include "agos/agos.h"
#include "agos/vga.h"
+#include "graphics/surface.h"
+
#include "sound/mididrv.h"
#include "sound/mods/protracker.h"
#include "sound/audiocd.h"
@@ -182,8 +184,6 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_subroutineList = 0;
- _dxSurfacePitch = 0;
-
_recursionDepth = 0;
_lastVgaTick = 0;
@@ -490,12 +490,13 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_backGroundBuf = 0;
_backBuf = 0;
_scaleBuf = 0;
+ _window4BackScn = 0;
+ _window6BackScn = 0;
+ printf("Cleared all\n");
_window3Flag = 0;
_window4Flag = 0;
_window6Flag = 0;
- _window4BackScn = 0;
- _window6BackScn = 0;
_moveXMin = 0;
_moveYMin = 0;
@@ -580,26 +581,34 @@ Common::Error AGOSEngine::init() {
syncSoundSettings();
// allocate buffers
- _backGroundBuf = (byte *)calloc(_screenWidth * _screenHeight, 1);
+ _backGroundBuf = new Graphics::Surface();
+ _backGroundBuf->create(_screenWidth, _screenHeight, 1);
if (getGameType() == GType_FF || getGameType() == GType_PP) {
- _backBuf = (byte *)calloc(_screenWidth * _screenHeight, 1);
- _scaleBuf = (byte *)calloc(_screenWidth * _screenHeight, 1);
+ _backBuf = new Graphics::Surface();
+ _backBuf->create(_screenWidth, _screenHeight, 1);
+ _scaleBuf = new Graphics::Surface();
+ _scaleBuf->create(_screenWidth, _screenHeight, 1);
}
if (getGameType() == GType_SIMON2) {
- _window4BackScn = (byte *)calloc(_screenWidth * _screenHeight, 1);
+ _window4BackScn = new Graphics::Surface();
+ _window4BackScn->create(_screenWidth, _screenHeight, 1);
} else if (getGameType() == GType_SIMON1) {
- _window4BackScn = (byte *)calloc(_screenWidth * 134, 1);
+ _window4BackScn = new Graphics::Surface();
+ _window4BackScn->create(_screenWidth, 134, 1);
} else if (getGameType() == GType_WW || getGameType() == GType_ELVIRA2) {
- _window4BackScn = (byte *)calloc(224 * 127, 1);
+ _window4BackScn = new Graphics::Surface();
+ _window4BackScn->create(224, 127, 1);
} else if (getGameType() == GType_ELVIRA1) {
+ _window4BackScn = new Graphics::Surface();
if (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_DEMO)) {
- _window4BackScn = (byte *)calloc(224 * 196, 1);
+ _window4BackScn->create(224, 196, 1);
} else {
- _window4BackScn = (byte *)calloc(224 * 144, 1);
+ _window4BackScn->create(224, 144, 1);
}
- _window6BackScn = (byte *)calloc(48 * 80, 1);
+ _window6BackScn = new Graphics::Surface();
+ _window6BackScn->create(48, 80, 1);
}
setupGame();