Skip to content

Commit

Permalink
FULLPIPE: Added and using StaticANIObject::isPixelHitAtPos()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 7, 2016
1 parent 5dddde1 commit a021b4c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions engines/fullpipe/scene.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/scenes/scene09.cpp
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions engines/fullpipe/statics.cpp
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions engines/fullpipe/statics.h
Expand Up @@ -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 {
Expand Down

0 comments on commit a021b4c

Please sign in to comment.