aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-13 22:45:15 -0400
committerPaul Gilbert2014-08-13 22:45:15 -0400
commitd6404a10adc4a1b6973894291ffbc6d87ac96071 (patch)
treecb69fc3310a2d9634aec6197d6a9a95ae0412370
parent28bfe7374930cd78f722451b8754822a11dd500d (diff)
downloadscummvm-rg350-d6404a10adc4a1b6973894291ffbc6d87ac96071.tar.gz
scummvm-rg350-d6404a10adc4a1b6973894291ffbc6d87ac96071.tar.bz2
scummvm-rg350-d6404a10adc4a1b6973894291ffbc6d87ac96071.zip
ACCESS: Fix compiler warnings and deallocation crash on exit
-rw-r--r--engines/access/access.cpp12
-rw-r--r--engines/access/access.h9
-rw-r--r--engines/access/amazon/amazon_game.cpp1
-rw-r--r--engines/access/asurface.cpp4
-rw-r--r--engines/access/asurface.h4
-rw-r--r--engines/access/screen.h2
6 files changed, 12 insertions, 20 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index 3a773a94c1..2ffc479748 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -114,9 +114,6 @@ AccessEngine::~AccessEngine() {
delete _scripts;
delete _sound;
- _buffer1.free();
- _buffer2.free();
-
freeCells();
delete[] _man1;
delete[] _inactive;
@@ -198,16 +195,9 @@ void AccessEngine::loadCells(Common::Array<RoomInfo::CellIdent> &cells) {
}
}
-void AccessEngine::clearCellTable() {
- for (int i = 0; i < 100; ++i) {
- delete _objectsTable[i];
- _objectsTable[i] = nullptr;
- }
-}
-
void AccessEngine::freeCells() {
for (int i = 0; i < 100; ++i) {
- delete[] _objectsTable[i];
+ delete _objectsTable[i];
_objectsTable[i] = nullptr;
}
}
diff --git a/engines/access/access.h b/engines/access/access.h
index 08b5ae3935..d919ae83f9 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -30,7 +30,7 @@
#include "common/util.h"
#include "engines/engine.h"
#include "graphics/surface.h"
-#include "access\/animation.h"
+#include "access/animation.h"
#include "access/data.h"
#include "access/debugger.h"
#include "access/events.h"
@@ -213,12 +213,7 @@ public:
void loadCells(Common::Array<RoomInfo::CellIdent> &cells);
/**
- * Clear the cell table
- */
- void clearCellTable();
-
- /**
- * Free the cell data
+ * Free the sprites list
*/
void freeCells();
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index fe158125b5..d0a5b6eecc 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -161,7 +161,6 @@ void AmazonEngine::doTent() {
void AmazonEngine::setupGame() {
_chapter = 1;
- clearCellTable();
// Setup timers
const int TIMER_DEFAULTS[] = { 3, 10, 8, 1, 1, 1, 1, 2 };
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp
index ba75607637..619c4499e9 100644
--- a/engines/access/asurface.cpp
+++ b/engines/access/asurface.cpp
@@ -104,6 +104,10 @@ void ASurface::init() {
_scrollX = _scrollY = 0;
}
+ASurface::~ASurface() {
+ free();
+}
+
void ASurface::clearBuffer() {
byte *pSrc = (byte *)getPixels();
Common::fill(pSrc, pSrc + w * h, 0);
diff --git a/engines/access/asurface.h b/engines/access/asurface.h
index 776b9506e9..4f172ae309 100644
--- a/engines/access/asurface.h
+++ b/engines/access/asurface.h
@@ -46,8 +46,10 @@ public:
static void init();
public:
- virtual void ASurface::plotFrame(SpriteFrame *frame, const Common::Point &pt);
+ virtual void plotFrame(SpriteFrame *frame, const Common::Point &pt);
public:
+ virtual ~ASurface();
+
void clearBuffer();
void copyBuffer(Graphics::Surface *src) { copyFrom(*src); }
diff --git a/engines/access/screen.h b/engines/access/screen.h
index d759ae119e..ba1c22931c 100644
--- a/engines/access/screen.h
+++ b/engines/access/screen.h
@@ -83,6 +83,8 @@ public:
public:
Screen(AccessEngine *vm);
+ virtual ~Screen() {}
+
void setDisplayScan();
void setPanel(int num);