[Scummvm-cvs-logs] SF.net SVN: scummvm: [32974] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Wed Jul 9 12:52:46 CEST 2008


Revision: 32974
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32974&view=rev
Author:   peres001
Date:     2008-07-09 03:52:46 -0700 (Wed, 09 Jul 2008)

Log Message:
-----------
Fixed regression introduced with GfxObj: the character sprite was sometimes removed from the rendering list.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/gfxbase.cpp
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/trunk/engines/parallaction/gfxbase.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gfxbase.cpp	2008-07-09 10:42:47 UTC (rev 32973)
+++ scummvm/trunk/engines/parallaction/gfxbase.cpp	2008-07-09 10:52:46 UTC (rev 32974)
@@ -32,7 +32,7 @@
 
 namespace Parallaction {
 
-GfxObj::GfxObj(uint objType, Frames *frames, const char* name) : type(objType), _frames(frames), x(0), y(0), z(0), frame(0), layer(3), _flags(0), _keep(true) {
+GfxObj::GfxObj(uint objType, Frames *frames, const char* name) : type(objType), _frames(frames), x(0), y(0), z(0), frame(0), layer(3), _flags(kGfxObjNormal), _keep(true) {
 	if (name) {
 		_name = strdup(name);
 	} else {
@@ -124,15 +124,22 @@
 	return obj;
 }
 
-void Gfx::clearGfxObjects() {
-	_gfxobjList.clear();
+void Gfx::clearGfxObjects(uint filter) {
+
+	GfxObjList::iterator b = _gfxobjList.begin();
+	GfxObjList::iterator e = _gfxobjList.end();
+
+	for ( ; b != e; ) {
+		if (((*b)->_flags & filter) != 0) {
+			b = _gfxobjList.erase(b);
+		} else {
+			b++;
+		}
+	}
+
 }
 
 void Gfx::showGfxObj(GfxObj* obj, bool visible) {
-//	if (!obj || obj->isVisible() == visible) {
-//		return;
-//	}
-
 	if (!obj) {
 		return;
 	}
@@ -141,9 +148,7 @@
 		obj->setFlags(kGfxObjVisible);
 	} else {
 		obj->clearFlags(kGfxObjVisible);
-//		_gfxobjList.remove(obj);
 	}
-
 }
 
 
@@ -187,9 +192,7 @@
 
 	sortAnimations();
 	// TODO: some zones don't appear because of wrong masking (3 or 0?)
-	// TODO: Dr.Ki is not visible inside the club
 
-
 	GfxObjList::iterator b = _gfxobjList.begin();
 	GfxObjList::iterator e = _gfxobjList.end();
 

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2008-07-09 10:42:47 UTC (rev 32973)
+++ scummvm/trunk/engines/parallaction/graphics.h	2008-07-09 10:52:46 UTC (rev 32974)
@@ -340,12 +340,15 @@
 enum {
 	kGfxObjVisible = 1,
 
+	kGfxObjNormal = 2,
+	kGfxObjCharacter = 4,
 
 	kGfxObjTypeDoor = 0,
 	kGfxObjTypeGet = 1,
 	kGfxObjTypeAnim = 2,
 	kGfxObjTypeLabel = 3,
-	kGfxObjTypeBalloon = 4
+	kGfxObjTypeBalloon = 4,
+	kGfxObjTypeCharacter = 8
 };
 
 enum {
@@ -356,7 +359,6 @@
 class GfxObj {
 	char *_name;
 	Frames *_frames;
-	uint32 _flags;
 
 	bool _keep;
 
@@ -365,6 +367,7 @@
 
 	int32 z;
 
+	uint32 _flags;
 
 	uint type;
 	uint frame;
@@ -478,7 +481,7 @@
 	GfxObj* loadDoor(const char *name);
 	void drawGfxObjects(Graphics::Surface &surf);
 	void showGfxObj(GfxObj* obj, bool visible);
-	void clearGfxObjects();
+	void clearGfxObjects(uint filter);
 	void sortAnimations();
 
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-07-09 10:42:47 UTC (rev 32973)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-07-09 10:52:46 UTC (rev 32974)
@@ -91,6 +91,8 @@
 	delete _globalTable;
 	delete _callableNames;
 
+	_gfx->clearGfxObjects(kGfxObjCharacter | kGfxObjNormal);
+	hideDialogueStuff();
 	freeLocation();
 
 	freeCharacter();
@@ -166,6 +168,8 @@
 	delete _objectsNames;
 	_objectsNames = 0;
 
+	_gfx->clearGfxObjects(kGfxObjCharacter);
+
 	_char.free();
 
 	return;
@@ -248,7 +252,7 @@
 
 	_location._walkNodes.clear();
 
-	_gfx->clearGfxObjects();
+	_gfx->clearGfxObjects(kGfxObjNormal);
 	freeBackground();
 
 	_location._programs.clear();
@@ -569,10 +573,14 @@
 	const char *end = begin + strlen(name);
 
 	_prefix = _empty;
+	_suffix = _empty;
 
 	_dummy = IS_DUMMY_CHARACTER(name);
 
 	if (!_dummy) {
+		if (!strstr(name, "donna")) {
+			_engineFlags &= ~kEngineTransformedDonna;
+		} else
 		if (_engineFlags & kEngineTransformedDonna) {
 			_suffix = _suffixTras;
 		} else {
@@ -581,8 +589,6 @@
 				_engineFlags |= kEngineTransformedDonna;
 				_suffix = _suffixTras;
 				end = s;
-			} else {
-				_suffix = _empty;
 			}
 		}
 		if (IS_MINI_CHARACTER(name)) {

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-07-09 10:42:47 UTC (rev 32973)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-07-09 10:52:46 UTC (rev 32974)
@@ -224,7 +224,7 @@
 	// free open location stuff
 	clearSubtitles();
 	freeBackground();
-	_gfx->clearGfxObjects();
+	_gfx->clearGfxObjects(kGfxObjNormal | kGfxObjCharacter);
 	_location._programs.clear();
 	freeZones();
 	freeAnimations();

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-07-09 10:42:47 UTC (rev 32973)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-07-09 10:52:46 UTC (rev 32974)
@@ -306,6 +306,7 @@
 		setArrowCursor();
 	}
 
+	_gfx->showGfxObj(_char._ani->gfxobj, false);
 	_location._animations.remove(_char._ani);
 
 	freeLocation();
@@ -327,6 +328,7 @@
 	}
 
 	_location._animations.push_front(_char._ani);
+	_gfx->showGfxObj(_char._ani->gfxobj, true);
 
 	strcpy(_saveData1, locname.location());
 	parseLocation(_saveData1);
@@ -411,6 +413,7 @@
 
 	Common::String oldArchive = _disk->selectArchive((getFeatures() & GF_DEMO) ? "disk0" : "disk1");
 	_char._ani->gfxobj = _gfx->loadAnim(_char.getFullName());
+	_char._ani->gfxobj->setFlags(kGfxObjCharacter);
 
 	if (!_char.dummy()) {
 		if (getPlatform() == Common::kPlatformAmiga) {


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