aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-02-03 22:58:08 +0200
committerEugene Sandulenko2014-02-03 22:58:08 +0200
commita67b7f487c47fa833a5fa273d96f531708557edf (patch)
tree54b71f665de4fadc6413fe4ca6b3f02336245e15
parent140f110377de81ce25812bd734cfca4f9c1e0de8 (diff)
downloadscummvm-rg350-a67b7f487c47fa833a5fa273d96f531708557edf.tar.gz
scummvm-rg350-a67b7f487c47fa833a5fa273d96f531708557edf.tar.bz2
scummvm-rg350-a67b7f487c47fa833a5fa273d96f531708557edf.zip
FULLPIPE: Implement sceneHandler27_batCalcDistance()
-rw-r--r--engines/fullpipe/scenes/scene27.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index 3d5106690b..e8c9db0fb7 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -339,9 +339,13 @@ bool sceneHandler27_batFallLogic(int bat) {
}
bool sceneHandler27_batCalcDistance(int bat1, int bat2) {
- warning("STUB: sceneHandler27_batCalcDistance()");
+ double at = atan2(g_vars->scene27_bats[bat1]->currX - g_vars->scene27_bats[bat2]->currX, g_vars->scene27_bats[bat1]->currY - g_vars->scene27_bats[bat2]->currY);
+ double dy = g_vars->scene27_bats[bat1]->currY - g_vars->scene27_bats[bat2]->currY;
+ double dx = g_vars->scene27_bats[bat1]->currX - g_vars->scene27_bats[bat2]->currX;
+ double ay = cos(at);
+ double ax = sin(at);
- return false;
+ return sqrt(ax * ax * 0.25 + ay * ay) * 54.0 > sqrt(dx * dx + dy * dy);
}
void sceneHandler27_knockBats(int bat1, int bat2) {