diff options
author | Nicola Mettifogo | 2008-07-09 10:52:46 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-07-09 10:52:46 +0000 |
commit | 18b48c74a9de417254badf23744d5c5f73c2966c (patch) | |
tree | 3406cc24c3e4afdbad48df7a20cf27f7b0b7ca88 /engines/parallaction/gfxbase.cpp | |
parent | d24e7706057aaf5d20c31d6eebf6e55440cfb20a (diff) | |
download | scummvm-rg350-18b48c74a9de417254badf23744d5c5f73c2966c.tar.gz scummvm-rg350-18b48c74a9de417254badf23744d5c5f73c2966c.tar.bz2 scummvm-rg350-18b48c74a9de417254badf23744d5c5f73c2966c.zip |
Fixed regression introduced with GfxObj: the character sprite was sometimes removed from the rendering list.
svn-id: r32974
Diffstat (limited to 'engines/parallaction/gfxbase.cpp')
-rw-r--r-- | engines/parallaction/gfxbase.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index 3e9bd79e5d..9e7eb12ed8 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -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 @@ GfxObj* Gfx::loadDoor(const char *name) { 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 @@ void Gfx::showGfxObj(GfxObj* obj, bool visible) { obj->setFlags(kGfxObjVisible); } else { obj->clearFlags(kGfxObjVisible); -// _gfxobjList.remove(obj); } - } @@ -187,8 +192,6 @@ void Gfx::drawGfxObjects(Graphics::Surface &surf) { 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(); |