[Scummvm-cvs-logs] scummvm master -> 73612b897934fd33183ebf3f93658e30f24314cf
sev-
sev at scummvm.org
Fri Nov 29 08:35:16 CET 2013
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
afa735cec4 FULLPIPE: Fix crash at scene03 load
a742b5fe8c FULLPIPE: Skip reading empty filenames
73612b8979 FULLPIPE: Fix crash at scene04 start
Commit: afa735cec4491c5986c459e889e17fcea94853a5
https://github.com/scummvm/scummvm/commit/afa735cec4491c5986c459e889e17fcea94853a5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-11-28T23:34:38-08:00
Commit Message:
FULLPIPE: Fix crash at scene03 load
Changed paths:
engines/fullpipe/gfx.cpp
engines/fullpipe/utils.cpp
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 2e89bd6..fba7e40 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -464,6 +464,8 @@ Picture::~Picture() {
}
void Picture::freePicture() {
+ debug(5, "Picture::freePicture(): file: %s", _memfilename);
+
if (_bitmap) {
if (testFlags() && !_field_54) {
freeData();
@@ -519,7 +521,7 @@ bool Picture::load(MfcArchive &file) {
getData();
- debug(5, "Picture::load: <%s>", _memfilename);
+ debug(5, "Picture::load: loaded <%s>", _memfilename);
return true;
}
@@ -539,6 +541,10 @@ void Picture::setAOIDs() {
}
void Picture::init() {
+ debug(5, "Picture::init(), %s", _memfilename);
+
+ MemoryObject::getData();
+
_bitmap = new Bitmap();
getDibInfo();
@@ -567,6 +573,12 @@ void Picture::getDibInfo() {
warning("Uneven data size: 0x%x", _dataSize);
}
+ if (!_data) {
+ warning("Picture::getDibInfo: data is empty <%s>", _memfilename);
+
+ MemoryObject::load();
+ }
+
Common::MemoryReadStream *s = new Common::MemoryReadStream(_data + off - 32, 32);
_bitmap->load(s);
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index 3304a93..3c2aaeb 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -149,6 +149,11 @@ bool MemoryObject::load(MfcArchive &file) {
void MemoryObject::loadFile(char *filename) {
debug(5, "MemoryObject::loadFile(<%s>)", filename);
if (!_data) {
+ NGIArchive *arr = g_fullpipe->_currArchive;
+
+ if (g_fullpipe->_currArchive != _libHandle && _libHandle)
+ g_fullpipe->_currArchive = _libHandle;
+
Common::SeekableReadStream *s = g_fullpipe->_currArchive->createReadStreamForMember(filename);
if (s) {
@@ -161,7 +166,11 @@ void MemoryObject::loadFile(char *filename) {
s->read(_data, _dataSize);
delete s;
+ } else {
+ warning("MemoryObject::loadFile(): reading failure");
}
+
+ g_fullpipe->_currArchive = arr;
}
}
@@ -181,6 +190,8 @@ byte *MemoryObject::loadData() {
}
void MemoryObject::freeData() {
+ debug(8, "MemoryObject::freeData(): file: %s", _memfilename);
+
if (_data)
free(_data);
Commit: a742b5fe8c6f09dd017c645c65d4cdff35f47202
https://github.com/scummvm/scummvm/commit/a742b5fe8c6f09dd017c645c65d4cdff35f47202
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-11-28T23:34:38-08:00
Commit Message:
FULLPIPE: Skip reading empty filenames
Changed paths:
engines/fullpipe/utils.cpp
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index 3c2aaeb..3a65801 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -148,6 +148,10 @@ bool MemoryObject::load(MfcArchive &file) {
void MemoryObject::loadFile(char *filename) {
debug(5, "MemoryObject::loadFile(<%s>)", filename);
+
+ if (!*filename)
+ return;
+
if (!_data) {
NGIArchive *arr = g_fullpipe->_currArchive;
Commit: 73612b897934fd33183ebf3f93658e30f24314cf
https://github.com/scummvm/scummvm/commit/73612b897934fd33183ebf3f93658e30f24314cf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-11-28T23:34:38-08:00
Commit Message:
FULLPIPE: Fix crash at scene04 start
Changed paths:
engines/fullpipe/statics.cpp
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index c86d5ab..d14c3d8 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -152,15 +152,19 @@ StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
_statics = 0;
for (uint i = 0; i < src->_movements.size(); i++) {
- Movement *mov;
- if (((Movement *)src->_movements[i])->_currMovement) {
- mov = new Movement(getMovementById(src->getMovementIdById(((Movement *)src->_movements[i])->_id)), this);
- mov->_id = ((Movement *)src->_movements[i])->_id;
+ Movement *newmov;
+ Movement *mov = (Movement *)src->_movements[i];
+
+ if (mov->_currMovement) {
+ // WORKAROUND: Original uses weird construction here:
+ // new Movement(getMovementById(src->getMovementIdById(mov->_id)), this);
+ newmov = new Movement(src->getMovementById(src->getMovementIdById(mov->_id)), this);
+ newmov->_id = mov->_id;
} else {
- mov = new Movement(((Movement *)src->_movements[i]), 0, -1, this);
+ newmov = new Movement(mov, 0, -1, this);
}
- _movements.push_back(mov);
+ _movements.push_back(newmov);
}
}
More information about the Scummvm-git-logs
mailing list