mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 22:58:09 +00:00
FULLPIPE: Added and using StaticANIObject::isPixelHitAtPos()
This commit is contained in:
parent
5dddde199f
commit
a021b4c7e8
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user