mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-24 02:36:27 +00:00
FULLPIPE: Implement CInteraction::isOverlapping()
This commit is contained in:
parent
ec650efb47
commit
940c686858
@ -72,10 +72,8 @@ void CInteractionController::sortInteractions(int sceneId) {
|
||||
Common::sort(_interactions.begin(), _interactions.end(), CInteractionController::compareInteractions);
|
||||
}
|
||||
|
||||
int CInteractionController::handleInteraction(GameObject *subject, GameObject *object, int invId) {
|
||||
warning("STUB: CInteractionController::handleInteraction()");
|
||||
|
||||
return 0;
|
||||
bool CInteractionController::handleInteraction(GameObject *subj, GameObject *obj, int invId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
CInteraction::CInteraction() {
|
||||
@ -172,6 +170,17 @@ bool CInteraction::canInteract(GameObject *obj1, GameObject *obj2, int invId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CInteraction::isOverlapping(StaticANIObject *subj, StaticANIObject *obj) {
|
||||
if (abs(_xOffs + obj->_ox - subj->_ox) <= 1
|
||||
&& abs(obj->_oy + _yOffs - subj->_oy) <= 1) {
|
||||
if (!this->_staticsId2 || subj->_statics != 0 && subj->_statics->_staticsId == _staticsId2) {
|
||||
if (!_staticsId1 || !(_flags & 1) || obj->_statics != 0 && obj->_statics->_staticsId == _staticsId1)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EntranceInfo::load(MfcArchive &file) {
|
||||
debug(5, "EntranceInfo::load()");
|
||||
|
||||
|
@ -54,6 +54,7 @@ class CInteraction : public CObject {
|
||||
CInteraction();
|
||||
virtual bool load(MfcArchive &file);
|
||||
bool canInteract(GameObject *obj1, GameObject *obj2, int invId);
|
||||
bool isOverlapping(StaticANIObject *subj, StaticANIObject *obj);
|
||||
};
|
||||
|
||||
class CInteractionController : public CObject {
|
||||
@ -75,7 +76,7 @@ class CInteractionController : public CObject {
|
||||
|
||||
void sortInteractions(int sceneId);
|
||||
|
||||
int handleInteraction(GameObject *subject, GameObject *object, int invId);
|
||||
bool handleInteraction(GameObject *subj, GameObject *obj, int invId);
|
||||
};
|
||||
|
||||
struct EntranceInfo {
|
||||
|
Loading…
Reference in New Issue
Block a user