aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2016-09-26 18:48:19 +0200
committerEugene Sandulenko2016-09-26 20:41:17 +0200
commitdea4b64839a90b3dfc2503b77439f24ba30f9b47 (patch)
treed8bbf7cf0d1f120ada0c3a123a5a1e47a274e457 /engines/fullpipe
parent6dae7a33ce6e6e6c722d8fc6f45d936482749a54 (diff)
downloadscummvm-rg350-dea4b64839a90b3dfc2503b77439f24ba30f9b47.tar.gz
scummvm-rg350-dea4b64839a90b3dfc2503b77439f24ba30f9b47.tar.bz2
scummvm-rg350-dea4b64839a90b3dfc2503b77439f24ba30f9b47.zip
FULLPIPE: Assign unique number to objects in the scene, so they stay stable
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/scene.cpp16
-rw-r--r--engines/fullpipe/scenes/scene04.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index 9e44449158..cba688a123 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -333,6 +333,10 @@ void Scene::deleteStaticANIObject(StaticANIObject *obj) {
}
void Scene::addStaticANIObject(StaticANIObject *obj, bool addList2) {
+ // WORKAROUND: This is used for making sure that the objects
+ // with same priority do not get swapped during drawing
+ obj->_cnum = _staticANIObjectList2.size() + 1;
+
if (obj->_odelay)
obj->renumPictures(&_staticANIObjectList1);
@@ -477,10 +481,6 @@ bool Scene::compareObjPriority(const void *p1, const void *p2) {
}
void Scene::objectList_sortByPriority(Common::Array<StaticANIObject *> &list, bool skipFirst) {
- // Ensure the sort is stable
- for (uint i = 0; i < list.size(); i++)
- list[i]->_cnum = i;
-
if (skipFirst) {
Common::Array<StaticANIObject *>::iterator s = list.begin();
@@ -493,10 +493,6 @@ void Scene::objectList_sortByPriority(Common::Array<StaticANIObject *> &list, bo
}
void Scene::objectList_sortByPriority(Common::Array<PictureObject *> &list, bool skipFirst) {
- // Ensure the sort is stable
- for (uint i = 0; i < list.size(); i++)
- list[i]->_cnum = i;
-
if (skipFirst) {
Common::Array<PictureObject *>::iterator s = list.begin();
@@ -519,12 +515,14 @@ void Scene::draw() {
objectList_sortByPriority(_staticANIObjectList2);
- for (uint i = 0; i < _staticANIObjectList2.size(); i++)
+ for (uint i = 0; i < _staticANIObjectList2.size(); i++) {
_staticANIObjectList2[i]->draw2();
+ }
int priority = -1;
for (uint i = 0; i < _staticANIObjectList2.size(); i++) {
drawContent(_staticANIObjectList2[i]->_priority, priority, false);
+
_staticANIObjectList2[i]->draw();
priority = _staticANIObjectList2[i]->_priority;
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index 6c746b8a9a..c3557cc6aa 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -43,6 +43,8 @@ static const int scene04_speakerPhases[] = {
0, 2, -1, -1, -1, -1
};
+void sceneHandler04_putKozyawkaBack(StaticANIObject *ani);
+
void scene04_speakerCallback(int *phase) {
if (g_vars->scene04_soundPlaying) {
if (g_vars->scene04_speakerPhase >= 0) {