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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Dec 14 11:08:31 CET 2008


Revision: 35357
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35357&view=rev
Author:   peres001
Date:     2008-12-14 10:08:31 +0000 (Sun, 14 Dec 2008)

Log Message:
-----------
Removed some unused code.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/gui_br.cpp
    scummvm/trunk/engines/parallaction/gui_ns.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp
    scummvm/trunk/engines/parallaction/parser_br.cpp
    scummvm/trunk/engines/parallaction/walk.cpp

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/graphics.h	2008-12-14 10:08:31 UTC (rev 35357)
@@ -517,7 +517,6 @@
 	// other items
 	int setItem(GfxObj* obj, uint16 x, uint16 y, byte transparentColor = 0);
 	void setItemFrame(uint item, uint16 f);
-	void hideDialogueStuff();
 	void freeItems();
 
 	// background surface
@@ -527,7 +526,6 @@
 	void grabBackground(const Common::Rect& r, Graphics::Surface &dst);
 	void fillBackground(const Common::Rect& r, byte color);
 	void invertBackground(const Common::Rect& r);
-	void freeBackground();
 
 	// palette
 	void setPalette(Palette palette);

Modified: scummvm/trunk/engines/parallaction/gui_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gui_br.cpp	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/gui_br.cpp	2008-12-14 10:08:31 UTC (rev 35357)
@@ -57,7 +57,6 @@
 		}
 
 		if (_fadeSteps == 0) {
-			_vm->freeBackground();
 			return _helper->getState(_nextState);
 		}
 

Modified: scummvm/trunk/engines/parallaction/gui_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gui_ns.cpp	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/gui_ns.cpp	2008-12-14 10:08:31 UTC (rev 35357)
@@ -51,7 +51,6 @@
 	virtual MenuInputState* run() {
 		uint32 curTime = _vm->_system->getMillis();
 		if (curTime - _startTime > _timeOut) {
-			_vm->freeBackground();
 			return _helper->getState(_nextState);
 		}
 		return this;

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-12-14 10:08:31 UTC (rev 35357)
@@ -117,8 +117,6 @@
 	_location._startPosition.y = -1000;
 	_location._startFrame = 0;
 
-	_pathBuffer = 0;
-
 	_screenSize = _screenWidth * _screenHeight;
 
 	strcpy(_characterName1, "null");
@@ -305,21 +303,10 @@
 }
 
 
-void Parallaction::freeBackground() {
-
-	_pathBuffer = 0;
-
-}
-
 void Parallaction::setBackground(const char* name, const char* mask, const char* path) {
-
 	BackgroundInfo *info = new BackgroundInfo;
 	_disk->loadScenery(*info, name, mask, path);
-
 	_gfx->setBackground(kBackgroundLocation, info);
-	_pathBuffer = &info->path;
-
-	return;
 }
 
 void Parallaction::showLocationComment(const Common::String &text, bool end) {

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-12-14 10:08:31 UTC (rev 35357)
@@ -282,7 +282,6 @@
 	Table				*_localFlagNames;
 	CommandExec			*_cmdExec;
 	ProgramExec			*_programExec;
-	PathBuffer			*_pathBuffer;
 	Inventory 			*_inventory;
 	BalloonManager 		*_balloonMan;
 	DialogueManager		*_dialogueMan;
@@ -344,7 +343,6 @@
 	void 		updateDoor(ZonePtr z, bool close);
 	void 		showZone(ZonePtr z, bool visible);
 	void		setBackground(const char *background, const char *mask, const char *path);
-	void		freeBackground();
 	void 		highlightInventoryItem(ItemPosition pos);
 	int16 		getHoverInventoryItem(int16 x, int16 y);
 	int 		addInventoryItem(ItemName item);

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-12-14 10:08:31 UTC (rev 35357)
@@ -42,8 +42,8 @@
 	"PART4"
 };
 
-Parallaction_br::Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc), 
-	_locationParser(0), _programParser(0) { 
+Parallaction_br::Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc),
+	_locationParser(0), _programParser(0) {
 }
 
 Common::Error Parallaction_br::init() {
@@ -100,7 +100,7 @@
 
 Parallaction_br::~Parallaction_br() {
 	freeFonts();
-	
+
 	delete _locationParser;
 	delete _programParser;
 }
@@ -182,7 +182,6 @@
 
 	// free open location stuff
 	clearSubtitles();
-	freeBackground();
 	_gfx->clearGfxObjects(kGfxObjNormal);
 	_gfx->freeLabels();
 	_subtitle[0] = _subtitle[1] = -1;

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-12-14 10:08:31 UTC (rev 35357)
@@ -323,7 +323,6 @@
 
 		_input->waitForButtonEvent(kMouseLeftUp);
 		_gfx->freeLabels();
-		freeBackground();
 	}
 
 	if (locname.hasCharacter()) {

Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_br.cpp	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/parser_br.cpp	2008-12-14 10:08:31 UTC (rev 35357)
@@ -1244,9 +1244,7 @@
 	LocationParser_ns::parse(script2);
 
 	_vm->_gfx->setBackground(kBackgroundLocation, ctxt.info);
-	_vm->_pathBuffer = &ctxt.info->path;
 
-
 	ZoneList::iterator it = _vm->_location._zones.begin();
 	for ( ; it != _vm->_location._zones.end(); it++) {
 		bool visible = ((*it)->_flags & kFlagsRemove) == 0;

Modified: scummvm/trunk/engines/parallaction/walk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/walk.cpp	2008-12-14 04:39:25 UTC (rev 35356)
+++ scummvm/trunk/engines/parallaction/walk.cpp	2008-12-14 10:08:31 UTC (rev 35357)
@@ -29,7 +29,7 @@
 
 
 
-#define IS_PATH_CLEAR(x,y) _vm->_pathBuffer->getValue((x), (y))
+#define IS_PATH_CLEAR(x,y) _vm->_gfx->_backgroundInfo->path.getValue((x), (y))
 
 inline byte PathBuffer::getValue(uint16 x, uint16 y) {
 	byte m = data[(x >> 3) + y * internalWidth];
@@ -56,15 +56,18 @@
 
 	if (IS_PATH_CLEAR(to.x, to.y)) return;
 
+	int maxX = _vm->_gfx->_backgroundInfo->path.w;
+	int maxY = _vm->_gfx->_backgroundInfo->path.h;
+
 	int16 right = to.x;
 	int16 left = to.x;
 	do {
 		right++;
-	} while (!IS_PATH_CLEAR(right, to.y) && (right < _vm->_pathBuffer->w));
+	} while (!IS_PATH_CLEAR(right, to.y) && (right < maxX));
 	do {
 		left--;
 	} while (!IS_PATH_CLEAR(left, to.y) && (left > 0));
-	right = (right == _vm->_pathBuffer->w) ? 1000 : right - to.x;
+	right = (right == maxX) ? 1000 : right - to.x;
 	left = (left == 0) ? 1000 : to.x - left;
 
 
@@ -75,9 +78,9 @@
 	} while (!IS_PATH_CLEAR(to.x, top) && (top > 0));
 	do {
 		bottom++;
-	} while (!IS_PATH_CLEAR(to.x, bottom) && (bottom < _vm->_pathBuffer->h));
+	} while (!IS_PATH_CLEAR(to.x, bottom) && (bottom < maxY));
 	top = (top == 0) ? 1000 : to.y - top;
-	bottom = (bottom == _vm->_pathBuffer->h) ? 1000 : bottom - to.y;
+	bottom = (bottom == maxY) ? 1000 : bottom - to.y;
 
 
 	int16 closeX = (right >= left) ? left : right;
@@ -247,7 +250,7 @@
 
 void PathWalker_NS::clipMove(Common::Point& pos, const Common::Point& to) {
 
-	if ((pos.x < to.x) && (pos.x < _vm->_pathBuffer->w) && IS_PATH_CLEAR(pos.x + 2, pos.y)) {
+	if ((pos.x < to.x) && (pos.x < _vm->_gfx->_backgroundInfo->path.w) && IS_PATH_CLEAR(pos.x + 2, pos.y)) {
 		pos.x = (pos.x + 2 < to.x) ? pos.x + 2 : to.x;
 	}
 
@@ -255,7 +258,7 @@
 		pos.x = (pos.x - 2 > to.x) ? pos.x - 2 : to.x;
 	}
 
-	if ((pos.y < to.y) && (pos.y < _vm->_pathBuffer->h) && IS_PATH_CLEAR(pos.x, pos.y + 2)) {
+	if ((pos.y < to.y) && (pos.y < _vm->_gfx->_backgroundInfo->path.h) && IS_PATH_CLEAR(pos.x, pos.y + 2)) {
 		pos.y = (pos.y + 2 <= to.y) ? pos.y + 2 : to.y;
 	}
 


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