diff options
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(); |