[Scummvm-cvs-logs] SF.net SVN: scummvm:[35521] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Wed Dec 24 10:51:07 CET 2008
Revision: 35521
http://scummvm.svn.sourceforge.net/scummvm/?rev=35521&view=rev
Author: peres001
Date: 2008-12-24 09:51:07 +0000 (Wed, 24 Dec 2008)
Log Message:
-----------
Simplified destructions of Balloon objects.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/balloons.cpp
scummvm/trunk/engines/parallaction/callables_ns.cpp
scummvm/trunk/engines/parallaction/graphics.cpp
scummvm/trunk/engines/parallaction/graphics.h
scummvm/trunk/engines/parallaction/parallaction.cpp
Modified: scummvm/trunk/engines/parallaction/balloons.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/balloons.cpp 2008-12-24 05:41:27 UTC (rev 35520)
+++ scummvm/trunk/engines/parallaction/balloons.cpp 2008-12-24 09:51:07 UTC (rev 35521)
@@ -267,7 +267,7 @@
BalloonManager_ns(Gfx *gfx, Font *font);
~BalloonManager_ns();
- void freeBalloons();
+ void reset();
int setLocationBalloon(const char *text, bool endGame);
int setDialogueBalloon(const char *text, uint16 winding, TextColor textColor);
int setSingleBalloon(const char *text, uint16 x, uint16 y, uint16 winding, TextColor textColor);
@@ -429,14 +429,11 @@
return -1;
}
-void BalloonManager_ns::freeBalloons() {
- _gfx->destroyBalloons();
-
+void BalloonManager_ns::reset() {
for (uint i = 0; i < _numBalloons; i++) {
_intBalloons[i].obj = 0;
- _intBalloons[i].surface = 0; // no need to delete surface, since it is done by destroyBalloons
+ _intBalloons[i].surface = 0; // no need to delete surface, since it is done by Gfx
}
-
_numBalloons = 0;
}
@@ -566,7 +563,7 @@
BalloonManager_br(Disk *disk, Gfx *gfx, Font *font);
~BalloonManager_br();
- void freeBalloons();
+ void reset();
int setLocationBalloon(const char *text, bool endGame);
int setDialogueBalloon(const char *text, uint16 winding, TextColor textColor);
int setSingleBalloon(const char *text, uint16 x, uint16 y, uint16 winding, TextColor textColor);
@@ -724,12 +721,10 @@
return -1;
}
-void BalloonManager_br::freeBalloons() {
- _gfx->destroyBalloons();
-
+void BalloonManager_br::reset() {
for (uint i = 0; i < _numBalloons; i++) {
_intBalloons[i].obj = 0;
- _intBalloons[i].surface = 0; // no need to delete surface, since it is done by destroyBalloons
+ _intBalloons[i].surface = 0; // no need to delete surface, since it is done by Gfx
}
_numBalloons = 0;
Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp 2008-12-24 05:41:27 UTC (rev 35520)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp 2008-12-24 09:51:07 UTC (rev 35521)
@@ -310,9 +310,7 @@
}
_input->waitForButtonEvent(kMouseLeftUp);
- _balloonMan->freeBalloons();
-
- return;
+ _gfx->freeDialogueObjects();
}
void Parallaction_ns::_c_frankenstein(void *parm) {
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2008-12-24 05:41:27 UTC (rev 35520)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2008-12-24 09:51:07 UTC (rev 35521)
@@ -768,22 +768,17 @@
return obj;
}
-void Gfx::destroyBalloons() {
+void Gfx::freeDialogueObjects() {
+ _items.clear();
+
+ _vm->_balloonMan->reset();
+
for (uint i = 0; i < _balloons.size(); i++) {
delete _balloons[i];
}
_balloons.clear();
}
-void Gfx::freeDialogueObjects() {
- freeItems();
- _vm->_balloonMan->freeBalloons();
-}
-
-void Gfx::freeItems() {
- _items.clear();
-}
-
void Gfx::setBackground(uint type, BackgroundInfo *info) {
delete _backgroundInfo;
_backgroundInfo = info;
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2008-12-24 05:41:27 UTC (rev 35520)
+++ scummvm/trunk/engines/parallaction/graphics.h 2008-12-24 09:51:07 UTC (rev 35521)
@@ -483,7 +483,7 @@
virtual ~BalloonManager() { }
- virtual void freeBalloons() = 0;
+ virtual void reset() = 0;
virtual int setLocationBalloon(const char *text, bool endGame) = 0;
virtual int setDialogueBalloon(const char *text, uint16 winding, TextColor textColor) = 0;
virtual int setSingleBalloon(const char *text, uint16 x, uint16 y, uint16 winding, TextColor textColor) = 0;
@@ -525,16 +525,11 @@
void hideLabel(uint id);
void freeLabels();
- // dialogue balloons
+ // dialogue handling
GfxObj* registerBalloon(Frames *frames, const char *text);
- void destroyBalloons();
-
- void freeDialogueObjects();
-
- // other items
int setItem(GfxObj* obj, uint16 x, uint16 y, byte transparentColor = 0);
void setItemFrame(uint item, uint16 f);
- void freeItems();
+ void freeDialogueObjects();
// background surface
BackgroundInfo *_backgroundInfo;
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2008-12-24 05:41:27 UTC (rev 35520)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2008-12-24 09:51:07 UTC (rev 35521)
@@ -384,7 +384,7 @@
_gfx->updateScreen();
_input->waitForButtonEvent(kMouseLeftUp);
- _balloonMan->freeBalloons();
+ _gfx->freeDialogueObjects();
// fades maximum intensity palette towards approximation of main palette
for (uint16 _si = 0; _si<6; _si++) {
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