diff options
author | Eugene Sandulenko | 2013-07-25 16:42:44 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2013-09-06 14:51:05 +0300 |
commit | 7f332e1f208344f88d1cfd1899743eb7dd5403de (patch) | |
tree | 2d9cb293e2749756ab7f8b11a59ff2d3f697c062 /engines/fullpipe | |
parent | aaf5bae026416e158d69633eb1b07c73a63fcccd (diff) | |
download | scummvm-rg350-7f332e1f208344f88d1cfd1899743eb7dd5403de.tar.gz scummvm-rg350-7f332e1f208344f88d1cfd1899743eb7dd5403de.tar.bz2 scummvm-rg350-7f332e1f208344f88d1cfd1899743eb7dd5403de.zip |
FULLPIPE: Second part of scene drawing
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 1 | ||||
-rw-r--r-- | engines/fullpipe/gfx.cpp | 11 | ||||
-rw-r--r-- | engines/fullpipe/gfx.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/scene.cpp | 148 |
4 files changed, 86 insertions, 75 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index de4da66f3a..ce310c9f2c 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -108,6 +108,7 @@ Common::Error FullpipeEngine::run() { EntranceInfo ent; ent._sceneId = 3896; + //ent._sceneId = 2072; sceneSwitcher(&ent); _currentScene->draw(); diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 1e1f1b554f..79de4ef5ae 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -151,6 +151,13 @@ Common::Point *PictureObject::getDimensions(Common::Point *p) { return p; } +void PictureObject::draw() { + if (_flags & 1) + _picture->draw(_ox, _oy, 2, 0); + else + _picture->draw(_ox, _oy, 0, 0); +} + GameObject::GameObject() { _field_4 = 0; _flags = 0; @@ -511,7 +518,7 @@ void Bitmap::putDibRB(int32 *palette) { } } - g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1, endy + 1); + g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty); } void Bitmap::putDibCB(int32 *palette) { @@ -565,7 +572,7 @@ void Bitmap::putDibCB(int32 *palette) { } } - g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1, endy + 1); + g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty); } void Bitmap::colorFill(uint16 *dest, int len, int32 color) { diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h index 4f89f39188..5848e57536 100644 --- a/engines/fullpipe/gfx.h +++ b/engines/fullpipe/gfx.h @@ -124,6 +124,7 @@ class PictureObject : public GameObject { PictureObject(); bool load(MfcArchive &file, bool bigPicture); Common::Point *getDimensions(Common::Point *p); + void draw(); }; class Background : public CObject { diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 78d38a7943..f9b4c0b8ef 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -320,7 +320,7 @@ void Scene::setPictureObjectsFlag4() { PictureObject *Scene::getPictureObjectById(int objId, int flags) { for (uint i = 1; i < _picObjList.size(); i++) { - if(((PictureObject *)_picObjList[i])->_id == objId && ((PictureObject *)_picObjList[i])->_field_4 == flags) + if (((PictureObject *)_picObjList[i])->_id == objId && ((PictureObject *)_picObjList[i])->_field_4 == flags) return (PictureObject *)_picObjList[i]; } @@ -380,7 +380,7 @@ void Scene::draw() { int priority = -1; for (CPtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s) { - drawContent(((StaticANIObject *)s)->_priority, priority, false); + drawContent(((StaticANIObject *)*s)->_priority, priority, false); ((StaticANIObject *)*s)->draw(); priority = ((StaticANIObject *)*s)->_priority; @@ -401,6 +401,8 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { warning("Scene palette is ignored"); } + debug(0, "Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg); + if (_picObjList.size() > 2) { // We need to z-sort them objectList_sortByPriority(_picObjList); } @@ -411,9 +413,12 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { if (maxPri == -1) maxPri = 60000; + debug(0, "-> Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg); + + Common::Point point; + debug(0, "_bigPict: %d objlist: %d", _bigPictureArray1Count, _picObjList.size()); if (drawBg && _bigPictureArray1Count && _picObjList.size()) { - Common::Point point; _bigPictureArray[0][0]->getDimensions(&point); @@ -449,7 +454,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { int v51 = height * bgNumY; while (1) { int v25 = bgNumY; - for (int y = g_fullpipe->_sceneRect.top - bgOffsetY; y < g_fullpipe->_sceneRect.bottom - 1; ) { + for (int y = g_fullpipe->_sceneRect.top - bgOffsetY; y < g_fullpipe->_sceneRect.bottom - 1;) { BigPicture *v27 = _bigPictureArray[bgNumX][v25]; v27->draw(bgPosX, y, 0, 0); y += v27->getDimensions(&point)->y; @@ -478,77 +483,74 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { } } -#if 0 - v34 = this_->bg.picObjList.m_pNodeHead; - if (v34) { - while (1) { - v35 = v34->pNext; - v36 = (PictureObject *)v34->data; - drawBgb = v35; - v37 = v36->GameObject.priority; - if (v37 >= minPri && v37 < maxPri) { - v38 = v36->GameObject.ox; - v39 = v36->GameObject.oy; - v40 = PictureObject_getDimensions(v36, &v58); - v41 = v40->x; - bgOffsetXa = v40->y; - if (v36->GameObject.flags & 8) { - while (v38 > g_sceneRect.right) { - v38 -= v41; - v36->setOXY(v38, v39); - } - for (j = v41 + v38; v41 + v38 < g_sceneRect.left; j = v41 + v38) { - v38 = j; - v36->setOXY(j, v39); - } - } - if (v36->GameObject.flags & 0x10) { - while (v39 > g_sceneRect.bottom) { - v39 -= bgOffsetXa; - v36->setOXY(v38, v39); - } - for (k = v39 + bgOffsetXa; v39 + bgOffsetXa < g_sceneRect.top; k = v39 + bgOffsetXa) { - v39 = k; - v36->setOXY(v38, k); - } - } - if (v36->GameObject.flags & 4) - v36->draw(); - if (v36->GameObject.flags & 2) { - if (v38 > g_sceneRect.left) { - v44 = v38 - v41; - v36->setOXY(v44, v39); - v36->draw(); - v38 = v41 + v44; - v36->setOXY(v38, v39); - } - if (v41 + v38 < g_sceneRect.right) { - v36->setOXY(v41 + v38, v39); - v36->draw(); - v36->setOXY(v38, v39); - } - } - if (v36->GameObject.flags & 0x20) { - if (v39 > g_sceneRect.top) { - v45 = v39 - bgOffsetXa; - v36->setOXY(v38, v45); - v36->draw(); - v39 = bgOffsetXa + v45; - v36->setOXY(v38, v39); - } - if (bgOffsetXa + v39 < g_sceneRect.bottom) { - v36->setOXY(v38, bgOffsetXa + v39); - v36->draw(); - v36->setOXY(v38, v39); - } - } + + for (uint i = 1; i < _picObjList.size(); i++) { + PictureObject *obj = (PictureObject *)_picObjList[i]; + + debug(0, "pri: %d", obj->_priority); + if (obj->_priority < minPri || obj->_priority >= maxPri) + continue; + + int objX = obj->_ox; + int objY = obj->_oy; + + debug(0, "obj: %d %d", objX, objY); + + obj->getDimensions(&point); + + int width = point.x; + int height = point.y; + + if (obj->_flags & 8) { + while (objX > g_fullpipe->_sceneRect.right) { + objX -= width; + obj->setOXY(objX, objY); + } + for (int j = width + objX; width + objX < g_fullpipe->_sceneRect.left; j = width + objX) { + objX = j; + obj->setOXY(j, objY); } - if (!drawBgb) - break; - v34 = drawBgb; } - } -#endif + + if (obj->_flags & 0x10) { + while (objY > g_fullpipe->_sceneRect.bottom) { + objY -= height; + obj->setOXY(objX, objY); + } + for (int j = objY + height; objY + height < g_fullpipe->_sceneRect.top; j = objY + height) { + objY = j; + obj->setOXY(objX, j); + } + } + if (obj->_flags & 4) + obj->draw(); + + if (obj->_flags & 2) { + if (objX > g_fullpipe->_sceneRect.left) { + obj->setOXY(objX - width, objY); + obj->draw(); + obj->setOXY(objX, objY); + } + if (width + objX < g_fullpipe->_sceneRect.right) { + obj->setOXY(width + objX, objY); + obj->draw(); + obj->setOXY(objX, objY); + } + } + + if (obj->_flags & 0x20) { + if (objY > g_fullpipe->_sceneRect.top) { + obj->setOXY(objX, objY - height); + obj->draw(); + obj->setOXY(objX, objY); + } + if (height + objY < g_fullpipe->_sceneRect.bottom) { + obj->setOXY(objX, height + objY); + obj->draw(); + obj->setOXY(objX, objY); + } + } + } } } // End of namespace Fullpipe |