[Scummvm-cvs-logs] SF.net SVN: scummvm: [25651] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Sat Feb 17 10:56:13 CET 2007
Revision: 25651
http://scummvm.svn.sourceforge.net/scummvm/?rev=25651&view=rev
Author: drmccoy
Date: 2007-02-17 01:56:09 -0800 (Sat, 17 Feb 2007)
Log Message:
-----------
- Added a warning when o1_checkData()/o2_checkData() can't find the file it's supposed to check
- Fixed the actor drawn over the background glitch in Bargon Attack
- Plugged some leaks
Modified Paths:
--------------
scummvm/trunk/engines/gob/gob.cpp
scummvm/trunk/engines/gob/inter_v1.cpp
scummvm/trunk/engines/gob/inter_v2.cpp
scummvm/trunk/engines/gob/map.cpp
scummvm/trunk/engines/gob/map.h
scummvm/trunk/engines/gob/map_v1.cpp
scummvm/trunk/engines/gob/map_v2.cpp
scummvm/trunk/engines/gob/mult.cpp
scummvm/trunk/engines/gob/mult.h
scummvm/trunk/engines/gob/mult_v1.cpp
scummvm/trunk/engines/gob/mult_v2.cpp
scummvm/trunk/engines/gob/scenery.cpp
scummvm/trunk/engines/gob/sound.cpp
Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/gob.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -625,6 +625,7 @@
}
else
error("GobEngine::init(): Unknown version of game engine");
+
_noMusic = MidiDriver::parseMusicDriver(ConfMan.get("music_driver")) == MD_NULL;
if (!_noMusic && !(_platform == Common::kPlatformAmiga) &&
!(_platform == Common::kPlatformAtariST) &&
@@ -633,6 +634,8 @@
_adlib = new Adlib(this);
_vm = this;
+ _map->init();
+
_system->beginGFXTransaction();
initCommonGFX(false);
_system->initSize(320, 200);
Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/inter_v1.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -1044,6 +1044,8 @@
WRITE_VAR_OFFSET(varOff, handle);
if (handle >= 0)
_vm->_dataio->closeData(handle);
+ else
+ warning("File \"%s\" not found", _vm->_global->_inter_resStr);
return false;
}
Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/inter_v2.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -1465,8 +1465,10 @@
if (handle >= 0) {
_vm->_dataio->closeData(handle);
size = _vm->_dataio->getDataSize(_vm->_global->_inter_resStr);
- } else
+ } else {
size = -1;
+ warning("File \"%s\" not found", _vm->_global->_inter_resStr);
+ }
}
if (size == -1)
handle = -1;
Modified: scummvm/trunk/engines/gob/map.cpp
===================================================================
--- scummvm/trunk/engines/gob/map.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/map.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -70,6 +70,20 @@
_avoDataPtr = 0;
}
+Map::~Map() {
+ if (_passMap)
+ delete[] _passMap;
+
+ if (_itemsMap) {
+ for (int i = 0; i < _mapHeight; i++)
+ delete[] _itemsMap[i];
+ delete[] _itemsMap;
+ }
+
+ if (_wayPoints)
+ delete[] _wayPoints;
+}
+
void Map::placeItem(int16 x, int16 y, int16 id) {
if ((_itemsMap[y][x] & 0xff00) != 0)
_itemsMap[y][x] = (_itemsMap[y][x] & 0xff00) | id;
Modified: scummvm/trunk/engines/gob/map.h
===================================================================
--- scummvm/trunk/engines/gob/map.h 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/map.h 2007-02-17 09:56:09 UTC (rev 25651)
@@ -102,8 +102,9 @@
virtual void findNearestToDest(Mult::Mult_Object *obj) = 0;
virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y) = 0;
+ virtual void init(void) = 0;
Map(GobEngine *vm);
- virtual ~Map() {};
+ virtual ~Map();
protected:
char *_avoDataPtr;
@@ -128,6 +129,7 @@
_passMap[y * _mapWidth + x] = pass;
}
+ virtual void init(void);
Map_v1(GobEngine *vm);
virtual ~Map_v1();
};
@@ -151,6 +153,7 @@
_passMap[y * heightOff + x] = pass;
}
+ virtual void init(void);
Map_v2(GobEngine *vm);
virtual ~Map_v2();
};
Modified: scummvm/trunk/engines/gob/map_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/map_v1.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/map_v1.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -35,6 +35,12 @@
namespace Gob {
Map_v1::Map_v1(GobEngine *vm) : Map(vm) {
+}
+
+Map_v1::~Map_v1() {
+}
+
+void Map_v1::init(void) {
int i;
int j;
@@ -60,23 +66,6 @@
}
}
-Map_v1::~Map_v1() {
- int i;
-
- _mapWidth = 26;
- _mapHeight = 28;
-
- if (_passMap)
- delete[] _passMap;
- if (_itemsMap) {
- for (i = 0; i < _mapHeight; i++)
- delete[] _itemsMap[i];
- delete[] _itemsMap;
- }
- if (_wayPoints)
- delete[] _wayPoints;
-}
-
void Map_v1::loadMapObjects(char *avjFile) {
int16 i;
char avoName[128];
Modified: scummvm/trunk/engines/gob/map_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/map_v2.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/map_v2.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -45,6 +45,9 @@
_passMap = 0;
}
+void Map_v2::init(void) {
+}
+
void Map_v2::loadMapObjects(char *avjFile) {
int i;
int j;
@@ -103,6 +106,9 @@
else
wayPointsCount = _wayPointsCount == 0 ? 1 : _wayPointsCount;
+ if (_wayPoints)
+ delete[] _wayPoints;
+
_wayPoints = new Point[wayPointsCount];
for (i = 0; i < _wayPointsCount; i++) {
_wayPoints[i].x = mapData.readSByte();
@@ -182,6 +188,8 @@
_vm->_goblin->_soundSlotsCount = _vm->_inter->load16();
for (i = 0; i < _vm->_goblin->_soundSlotsCount; i++)
_vm->_goblin->_soundSlots[i] = _vm->_inter->loadSound(1);
+
+ delete[] extData;
}
void Map_v2::findNearestToGob(Mult::Mult_Object *obj) {
Modified: scummvm/trunk/engines/gob/mult.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/mult.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -90,6 +90,25 @@
_orderArray = 0;
}
+Mult::~Mult() {
+ if (_objects)
+ delete[] _objects;
+ if (_orderArray)
+ delete[] _orderArray;
+ if (_renderData)
+ delete[] _renderData;
+ if (_renderData2)
+ delete[] _renderData2;
+ if (_multData)
+ delete _multData;
+ if (_animArrayX)
+ delete[] _animArrayX;
+ if (_animArrayY)
+ delete[] _animArrayY;
+ if (_animArrayData)
+ delete[] _animArrayData;
+}
+
void Mult::freeAll(void) {
int16 i;
Modified: scummvm/trunk/engines/gob/mult.h
===================================================================
--- scummvm/trunk/engines/gob/mult.h 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/mult.h 2007-02-17 09:56:09 UTC (rev 25651)
@@ -271,7 +271,7 @@
virtual void freeMultKeys(void) = 0;
Mult(GobEngine *vm);
- virtual ~Mult() {};
+ virtual ~Mult();
protected:
Video::Color _fadePal[5][16];
Modified: scummvm/trunk/engines/gob/mult_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult_v1.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/mult_v1.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -183,6 +183,8 @@
break;
}
}
+
+ delete[] extData;
}
void Mult_v1::setMultData(uint16 multindex) {
Modified: scummvm/trunk/engines/gob/mult_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult_v2.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/mult_v2.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -49,18 +49,11 @@
}
Mult_v2::~Mult_v2() {
- int i;
-
freeMultKeys();
- for (i = 0; i < 8; i++) {
+ for (int i = 0; i < 8; i++) {
_multData = _multDatas[i];
freeMultKeys();
}
-
- if (_orderArray)
- delete[] _orderArray;
- if (_renderData2)
- delete[] _renderData2;
}
void Mult_v2::loadMult(int16 resId) {
Modified: scummvm/trunk/engines/gob/scenery.cpp
===================================================================
--- scummvm/trunk/engines/gob/scenery.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/scenery.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -257,7 +257,7 @@
}
planeCount = layerPtr->planeCount;
- for (order = 0; order < 10; order++) {
+ for (order = 0; order < 40; order++) {
for (plane = 0, planePtr = layerPtr->planes;
plane < planeCount; plane++, planePtr++) {
if (planePtr->drawOrder != order)
@@ -312,7 +312,7 @@
planeCount = layerPtr->planeCount;
- for (order = orderFrom; order < 10; order++) {
+ for (order = orderFrom; order < 40; order++) {
for (planePtr = layerPtr->planes, plane = 0;
plane < planeCount; plane++, planePtr++) {
if (planePtr->drawOrder != order)
Modified: scummvm/trunk/engines/gob/sound.cpp
===================================================================
--- scummvm/trunk/engines/gob/sound.cpp 2007-02-17 08:06:21 UTC (rev 25650)
+++ scummvm/trunk/engines/gob/sound.cpp 2007-02-17 09:56:09 UTC (rev 25651)
@@ -98,6 +98,7 @@
Snd::Snd(GobEngine *vm) : _vm(vm) {
_cleanupFunc = 0;
_playingSound = 0;
+ _curSoundDesc = 0;
_rate = _vm->_mixer->getOutputRate();
_end = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list