[Scummvm-cvs-logs] SF.net SVN: scummvm: [31856] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Sun May 4 04:26:26 CEST 2008
Revision: 31856
http://scummvm.svn.sourceforge.net/scummvm/?rev=31856&view=rev
Author: drmccoy
Date: 2008-05-03 19:26:25 -0700 (Sat, 03 May 2008)
Log Message:
-----------
Properly close the object videos when the objects are destroyed
Modified Paths:
--------------
scummvm/trunk/engines/gob/inter_v2.cpp
scummvm/trunk/engines/gob/mult.cpp
scummvm/trunk/engines/gob/mult.h
scummvm/trunk/engines/gob/mult_v1.cpp
Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp 2008-05-04 01:02:27 UTC (rev 31855)
+++ scummvm/trunk/engines/gob/inter_v2.cpp 2008-05-04 02:26:25 UTC (rev 31856)
@@ -880,6 +880,9 @@
if (_vm->_mult->_objects && (oldObjCount != _vm->_mult->_objCount)) {
warning("Initializing new objects without having "
"cleaned up the old ones at first");
+
+ _vm->_mult->clearObjectVideos();
+
delete[] _vm->_mult->_objects;
delete[] _vm->_mult->_renderObjs;
delete[] _vm->_mult->_orderArray;
Modified: scummvm/trunk/engines/gob/mult.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult.cpp 2008-05-04 01:02:27 UTC (rev 31855)
+++ scummvm/trunk/engines/gob/mult.cpp 2008-05-04 02:26:25 UTC (rev 31856)
@@ -36,6 +36,7 @@
#include "gob/scenery.h"
#include "gob/sound.h"
#include "gob/video.h"
+#include "gob/videoplayer.h"
namespace Gob {
@@ -120,6 +121,8 @@
}
void Mult::freeMult() {
+ clearObjectVideos();
+
delete[] _objects;
delete[] _renderData;
delete[] _renderObjs;
@@ -198,6 +201,8 @@
if (!stopNoClear) {
if (_animDataAllocated) {
+ clearObjectVideos();
+
delete[] _objects;
delete[] _renderData;
delete[] _renderObjs;
@@ -424,4 +429,10 @@
}
}
+void Mult::clearObjectVideos() {
+ for (int i = 0; i < _objCount; i++)
+ if (_objects[i].videoSlot > 0)
+ _vm->_vidPlayer->slotClose(_objects[i].videoSlot - 1);
+}
+
} // End of namespace Gob
Modified: scummvm/trunk/engines/gob/mult.h
===================================================================
--- scummvm/trunk/engines/gob/mult.h 2008-05-04 01:02:27 UTC (rev 31855)
+++ scummvm/trunk/engines/gob/mult.h 2008-05-04 02:26:25 UTC (rev 31856)
@@ -245,6 +245,8 @@
void playMult(int16 startFrame, int16 endFrame, char checkEscape,
char handleMouse);
+ void clearObjectVideos();
+
virtual void loadMult(int16 resId) = 0;
virtual void freeMultKeys() = 0;
virtual bool hasMultData(uint16 multIndex) = 0;
Modified: scummvm/trunk/engines/gob/mult_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult_v1.cpp 2008-05-04 01:02:27 UTC (rev 31855)
+++ scummvm/trunk/engines/gob/mult_v1.cpp 2008-05-04 02:26:25 UTC (rev 31856)
@@ -215,6 +215,8 @@
delete[] _multData->sndKeys;
if (_animDataAllocated) {
+ clearObjectVideos();
+
delete[] _objects;
delete[] _renderData;
delete[] _animArrayX;
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