diff options
author | Eugene Sandulenko | 2013-07-20 23:55:04 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2013-09-06 14:51:04 +0300 |
commit | c4499bb4b290484cd1af35f2c354e0b2897e4a62 (patch) | |
tree | 92f2c4b8c6c307bca7fc6ce6c255174ff0aa162f /engines/fullpipe/gfx.cpp | |
parent | 62cbdd81f0843ad10fb768e8cf97222144cb8a1e (diff) | |
download | scummvm-rg350-c4499bb4b290484cd1af35f2c354e0b2897e4a62.tar.gz scummvm-rg350-c4499bb4b290484cd1af35f2c354e0b2897e4a62.tar.bz2 scummvm-rg350-c4499bb4b290484cd1af35f2c354e0b2897e4a62.zip |
FULLPIPE: Further work on sceneSwitcher
Diffstat (limited to 'engines/fullpipe/gfx.cpp')
-rw-r--r-- | engines/fullpipe/gfx.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 5f6d75b33b..fb9466177c 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -95,7 +95,7 @@ bool Background::load(MfcArchive &file) { void Background::addPictureObject(PictureObject *pct) { if (pct->_field_4) - renumPictures(pct); + pct->renumPictures(&_picObjList); bool inserted = false; for (uint i = 0; i < _picObjList.size(); i++) { @@ -111,24 +111,6 @@ void Background::addPictureObject(PictureObject *pct) { } } -void Background::renumPictures(PictureObject *pct) { - int *buf = (int *)calloc(_picObjList.size() + 2, sizeof(int)); - - for (uint i = 0; i < _picObjList.size(); i++) { - if (pct->_id == ((PictureObject *)_picObjList[i])->_id) - buf[((PictureObject *)_picObjList[i])->_field_4] = 1; - } - - if (buf[pct->_field_4]) { - uint count; - for (count = 1; buf[count] && count < _picObjList.size() + 2; count++) - ; - pct->_field_4 = count; - } - - free(buf); -} - PictureObject::PictureObject() { _ox = 0; _oy = 0; @@ -205,6 +187,24 @@ void GameObject::setOXY(int x, int y) { _oy = y; } +void GameObject::renumPictures(CPtrList *lst) { + int *buf = (int *)calloc(lst->size() + 2, sizeof(int)); + + for (uint i = 0; i < lst->size(); i++) { + if (_id == ((PictureObject *)((*lst)[i]))->_id) + buf[((PictureObject *)((*lst)[i]))->_field_4] = 1; + } + + if (buf[_field_4]) { + uint count; + for (count = 1; buf[count] && count < lst->size() + 2; count++) + ; + _field_4 = count; + } + + free(buf); +} + Picture::Picture() { _x = 0; _y = 0; |