FULLPIPE: Added and using StaticANIObject::isPixelHitAtPos()

This commit is contained in:
Eugene Sandulenko 2016-09-07 12:12:31 +02:00
parent 5dddde199f
commit a021b4c7e8
4 changed files with 7 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -258,6 +258,7 @@ public:
void changeStatics2(int objId);
bool getPixelAtPos(int x, int y, int *pixel, bool hitOnly = false);
bool isPixelHitAtPos(int x, int y);
};
struct MovTable {