[Scummvm-cvs-logs] scummvm master -> 491a045eea1af99a4bf54ab84304135c946b6cc0

sev- sev at scummvm.org
Sun Jan 12 10:00:06 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
491a045eea FULLPIPE: Implement Movement::freePixelData()


Commit: 491a045eea1af99a4bf54ab84304135c946b6cc0
    https://github.com/scummvm/scummvm/commit/491a045eea1af99a4bf54ab84304135c946b6cc0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-01-12T00:59:14-08:00

Commit Message:
FULLPIPE: Implement Movement::freePixelData()

Changed paths:
    engines/fullpipe/gfx.cpp
    engines/fullpipe/gfx.h
    engines/fullpipe/statics.cpp



diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 6e6e35f..a67a4d7 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -58,6 +58,8 @@ Bitmap::Bitmap(Bitmap *src) {
 Bitmap::~Bitmap() {
 	if (_pixels)
 		free(_pixels);
+
+	_pixels = 0;
 }
 
 void Bitmap::load(Common::ReadStream *s) {
@@ -230,7 +232,7 @@ void PictureObject::drawAt(int x, int y) {
 
 bool PictureObject::setPicAniInfo(PicAniInfo *picAniInfo) {
 	if (!(picAniInfo->type & 2) || (picAniInfo->type & 1)) {
-		error("Picture::setPicAniInfo(): Wrong type: %d", picAniInfo->type);
+		error("PictureObject::setPicAniInfo(): Wrong type: %d", picAniInfo->type);
 
 		return false;
 	}
@@ -482,7 +484,7 @@ void Picture::freePicture() {
 	if (_bitmap) {
 		if (testFlags() && !_field_54) {
 			freeData();
-			delete _bitmap;
+			free(_bitmap);
 			_bitmap = 0;
 		}
 	}
@@ -499,6 +501,11 @@ void Picture::freePicture() {
 	}
 }
 
+void Picture::freePixelData() {
+	freePicture();
+	freeData();
+}
+
 bool Picture::load(MfcArchive &file) {
 	debug(5, "Picture::load()");
 	MemoryObject::load(file);
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h
index 6e32c94..d640dec 100644
--- a/engines/fullpipe/gfx.h
+++ b/engines/fullpipe/gfx.h
@@ -88,6 +88,7 @@ class Picture : public MemoryObject {
 	virtual ~Picture();
 
 	void freePicture();
+	void freePixelData();
 
 	virtual bool load(MfcArchive &file);
 	void setAOIDs();
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 9c025dc..10d9b4d 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -1690,7 +1690,12 @@ void Movement::loadPixelData() {
 }
 
 void Movement::freePixelData() {
-	warning("STUB: Movement::freePixelData()");
+	if (!_currMovement)
+		for (uint i = 0; i < _dynamicPhases.size(); i++)
+			((DynamicPhase *)_dynamicPhases[i])->freePixelData();
+
+	if (_staticsObj1)
+		_staticsObj1->freePixelData();
 }
 
 void Movement::removeFirstPhase() {






More information about the Scummvm-git-logs mailing list