aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/logic/soccer.cpp
diff options
context:
space:
mode:
authorD G Turner2019-12-23 11:56:16 +0000
committerD G Turner2019-12-23 11:56:16 +0000
commit59b639ed4d9b8c45644053641522dedabd12fa56 (patch)
treecc98618132f1de362fca07369718af68df44e70a /engines/scumm/he/logic/soccer.cpp
parentd5808d2903e2cc2a04e8545b84f1528230a9b010 (diff)
downloadscummvm-rg350-59b639ed4d9b8c45644053641522dedabd12fa56.tar.gz
scummvm-rg350-59b639ed4d9b8c45644053641522dedabd12fa56.tar.bz2
scummvm-rg350-59b639ed4d9b8c45644053641522dedabd12fa56.zip
SCUMM: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'engines/scumm/he/logic/soccer.cpp')
-rw-r--r--engines/scumm/he/logic/soccer.cpp56
1 files changed, 32 insertions, 24 deletions
diff --git a/engines/scumm/he/logic/soccer.cpp b/engines/scumm/he/logic/soccer.cpp
index 567f74efc9..af9ee7ac35 100644
--- a/engines/scumm/he/logic/soccer.cpp
+++ b/engines/scumm/he/logic/soccer.cpp
@@ -601,31 +601,35 @@ int LogicHEsoccer::op_1014(int32 srcX, int32 srcY, int32 srcZ, int32 velX, int32
adjustedVelZ = (double)velZ * (double)vecNumerator / (double)vecDenom / 100.0;
break;
case 2:
- // length of movement vector
- double v15 = vectorLength((double)velX * (double)vecNumerator / (double)vecDenom, (double)velY * (double)vecNumerator / (double)vecDenom, (double)velZ * (double)vecNumerator / (double)vecDenom);
-
- if (v15 != 0.0) {
- // add the (scaled) movement vector to the input
- double v26 = (double)ABS(velX) * (double)vecNumerator / (double)vecDenom * 50.0 / v15;
- srcX = (int)((double)srcX + v26);
- double v25 = (double)ABS(velY) * (double)vecNumerator / (double)vecDenom * 50.0 / v15;
- srcY = (int)((double)srcY + v25);
- double v24 = (double)ABS(velZ) * (double)vecNumerator / (double)vecDenom * 50.0 / v15;
- srcZ = (int)((double)srcZ + v24);
- }
+ {
+ // length of movement vector
+ double v15 = vectorLength((double)velX * (double)vecNumerator / (double)vecDenom, (double)velY * (double)vecNumerator / (double)vecDenom, (double)velZ * (double)vecNumerator / (double)vecDenom);
+
+ if (v15 != 0.0) {
+ // add the (scaled) movement vector to the input
+ double v26 = (double)ABS(velX) * (double)vecNumerator / (double)vecDenom * 50.0 / v15;
+ srcX = (int)((double)srcX + v26);
+ double v25 = (double)ABS(velY) * (double)vecNumerator / (double)vecDenom * 50.0 / v15;
+ srcY = (int)((double)srcY + v25);
+ double v24 = (double)ABS(velZ) * (double)vecNumerator / (double)vecDenom * 50.0 / v15;
+ srcZ = (int)((double)srcZ + v24);
+ }
- // srcX = (newX / newZ) * 3869
- startX = (double)srcX / (double)srcZ * 3869.0;
- // srcY = (newY - (+524 * 100)) / (newZ * 3869 + (+524 * 100)
- startY = ((double)srcY - _userDataD[524] * 100.0) / (double)srcZ * 3869.0 + _userDataD[524] * 100.0;
- // srcZ = 3869
- startZ = 3869.0;
- // vectorX = (newX - srcX) / 100
- adjustedVelX = ((double)srcX - startX) / 100.0;
- // vectorY = (newY - srcY) / 100
- adjustedVelY = ((double)srcY - startY) / 100.0;
- // vectorZ = (newZ - 3869 = srcZ) / 100
- adjustedVelZ = ((double)srcZ - 3869.0) / 100.0;
+ // srcX = (newX / newZ) * 3869
+ startX = (double)srcX / (double)srcZ * 3869.0;
+ // srcY = (newY - (+524 * 100)) / (newZ * 3869 + (+524 * 100)
+ startY = ((double)srcY - _userDataD[524] * 100.0) / (double)srcZ * 3869.0 + _userDataD[524] * 100.0;
+ // srcZ = 3869
+ startZ = 3869.0;
+ // vectorX = (newX - srcX) / 100
+ adjustedVelX = ((double)srcX - startX) / 100.0;
+ // vectorY = (newY - srcY) / 100
+ adjustedVelY = ((double)srcY - startY) / 100.0;
+ // vectorZ = (newZ - 3869 = srcZ) / 100
+ adjustedVelZ = ((double)srcZ - 3869.0) / 100.0;
+ }
+ break;
+ default:
break;
}
@@ -698,6 +702,8 @@ int LogicHEsoccer::op_1014(int32 srcX, int32 srcY, int32 srcZ, int32 velX, int32
for (int i = 0; i < 10; i++)
_internalCollisionOutData[i] = outData[i];
break;
+ default:
+ break;
}
}
}
@@ -1040,6 +1046,8 @@ void LogicHEsoccer::getPointsForFace(int faceId, float &x1, float &y1, float &z1
y4 = objPoints[19];
z4 = objPoints[20];
break;
+ default:
+ break;
}
}