aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-13 23:25:36 +0200
committerEugene Sandulenko2016-08-14 09:50:03 +0200
commit62656b89a297d3fb5a472ad0fdb83b2600982e21 (patch)
tree9b8669dcfb60c001138e211d29867a543b798e60 /engines/fullpipe
parentc6c76e7f4cdcdf8b0719cf5bd5f603219a11094f (diff)
downloadscummvm-rg350-62656b89a297d3fb5a472ad0fdb83b2600982e21.tar.gz
scummvm-rg350-62656b89a297d3fb5a472ad0fdb83b2600982e21.tar.bz2
scummvm-rg350-62656b89a297d3fb5a472ad0fdb83b2600982e21.zip
FULLPIPE: Swap atan2 arguments
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/motion.cpp4
-rw-r--r--engines/fullpipe/scenes/scene27.cpp12
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index fbfa602e62..ff0a6caff3 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -2905,7 +2905,7 @@ void MovGraphLink::recalcLength() {
double dy = _graphDst->_y - _graphSrc->_y;
_length = sqrt(dy * dy + dx * dx);
- _angle = atan2(dx, dy);
+ _angle = atan2(dy, dx);
}
}
@@ -2950,7 +2950,7 @@ void ReactParallel::createRegion() {
for (int i = 0; i < 4; i++)
_points[i] = new Common::Point;
- double at = atan2((double)(_x1 - _x2), (double)(_y1 - _y2)) + 1.570796; // pi/2
+ double at = atan2((double)(_y1 - _y2), (double)(_x1 - _x2)) + 1.570796; // pi/2
double sn = sin(at);
double cs = cos(at);
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index 9570d30913..b23f29ad4c 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -331,7 +331,7 @@ void sceneHandler27_aimDude() {
void sceneHandler27_wipeDo() {
for (uint i = 0; i < g_vars->scene27_bats.size(); i++) {
if (g_vars->scene27_bats[i]->currX < 800.0) {
- g_vars->scene27_bats[i]->field_10 = atan2(800.0 - g_vars->scene27_bats[i]->currX, 520.0 - g_vars->scene27_bats[i]->currY);
+ g_vars->scene27_bats[i]->field_10 = atan2(520.0 - g_vars->scene27_bats[i]->currY, 800.0 - g_vars->scene27_bats[i]->currX);
g_vars->scene27_bats[i]->power += 1.0;
}
}
@@ -360,7 +360,7 @@ bool sceneHandler27_batFallLogic(uint batn) {
}
bool sceneHandler27_batCalcDistance(int bat1, int bat2) {
- 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 at = atan2(g_vars->scene27_bats[bat1]->currY - g_vars->scene27_bats[bat2]->currY, g_vars->scene27_bats[bat1]->currX - g_vars->scene27_bats[bat2]->currX);
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);
@@ -375,7 +375,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
if (0.0 != bat1->power) {
double rndF = (double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
- + atan2(bat2->currX - bat1->currX, bat2->currY - bat1->currY);
+ + atan2(bat2->currY - bat1->currY, bat2->currX - bat1->currX);
double rndCos = cos(rndF);
double rndSin = sin(rndF);
@@ -386,7 +386,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
bat1->powerSin -= pow1y * 1.1;
rndF = ((double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
- + atan2(bat1->currX - bat2->currX, bat1->currY - bat2->currY));
+ + atan2(bat1->currY - bat2->currY, bat1->currX - bat2->currX));
double pow2x = cos(bat2->field_10 - rndF) * (double)((int)(bat1->currX - bat2->currX) >= 0 ? 1 : -1) * bat2->power;
double pow2y = sin(bat2->field_10 - rndF) * (double)((int)(bat1->currY - bat2->currY) >= 0 ? 1 : -1) * bat2->power;
@@ -405,7 +405,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
else
bat1->powerSin += pow2y * 0.64;
- bat1->field_10 = atan2(bat1->powerCos, bat1->powerSin);
+ bat1->field_10 = atan2(bat1->powerSin, bat1->powerCos);
bat1->power = sqrt(bat1->powerCos * bat1->powerCos + bat1->powerSin * bat1->powerSin);
bat2->powerCos += pow1x * 0.64;
@@ -414,7 +414,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
else
bat2->powerSin += pow1y * 0.64;
- bat2->field_10 = atan2(bat2->powerCos, bat2->powerSin);
+ bat2->field_10 = atan2(bat2->powerSin, bat2->powerCos);
bat2->power = sqrt(bat2->powerCos * bat2->powerCos + bat2->powerSin * bat2->powerSin);
g_fp->playSound(SND_27_026, 0);