From a021b4c7e8c811f56c522e69f1723d29d7c36cc7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 7 Sep 2016 12:12:31 +0200 Subject: [PATCH] FULLPIPE: Added and using StaticANIObject::isPixelHitAtPos() --- engines/fullpipe/scene.cpp | 3 +-- engines/fullpipe/scenes/scene09.cpp | 2 +- engines/fullpipe/statics.cpp | 4 ++++ engines/fullpipe/statics.h | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 71990f79164c..1d693fcebdd1 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -601,10 +601,9 @@ StaticANIObject *Scene::getStaticANIObjectAtPos(int x, int y) { for (uint i = 0; i < _staticANIObjectList1.size(); i++) { StaticANIObject *p = _staticANIObjectList1[i]; - int pixel; if ((p->_field_8 & 0x100) && (p->_flags & 4) && - p->getPixelAtPos(x, y, &pixel) && + p->isPixelHitAtPos(x, y) && (!res || res->_priority > p->_priority)) res = p; } diff --git a/engines/fullpipe/scenes/scene09.cpp b/engines/fullpipe/scenes/scene09.cpp index aaa430d0774c..fe9051e5409b 100644 --- a/engines/fullpipe/scenes/scene09.cpp +++ b/engines/fullpipe/scenes/scene09.cpp @@ -369,7 +369,7 @@ void sceneHandler09_checkHangerCollide() { for (int i = 0; i < g_vars->scene09_numMovingHangers; i++) { for (int j = 0; j < 4; j++) { - hit = g_vars->scene09_hangers[i]->ani->getPixelAtPos(newx + g_vars->scene09_hangerOffsets[j].x, ball->_oy + g_vars->scene09_hangerOffsets[j].y, 0, true); + hit = g_vars->scene09_hangers[i]->ani->isPixelHitAtPos(newx + g_vars->scene09_hangerOffsets[j].x, ball->_oy + g_vars->scene09_hangerOffsets[j].y); if (hit) { sceneHandler09_ballExplode(b); diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index a1f91bc9dbd0..fe1f1e2d01b2 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -458,6 +458,10 @@ Movement *StaticANIObject::getMovementByName(char *name) { return 0; } +bool StaticANIObject::isPixelHitAtPos(int x, int y) { + return getPixelAtPos(x, y, 0, true); +} + bool StaticANIObject::getPixelAtPos(int x, int y, int *pixel, bool hitOnly) { bool res = false; Picture *pic; diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 5082d501b38e..6206fef4de24 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -258,6 +258,7 @@ class StaticANIObject : public GameObject { void changeStatics2(int objId); bool getPixelAtPos(int x, int y, int *pixel, bool hitOnly = false); + bool isPixelHitAtPos(int x, int y); }; struct MovTable {