aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Fioramonti2018-08-16 17:27:26 -0700
committerEugene Sandulenko2018-08-18 16:30:57 +0200
commit47c0e2701796962edd946ae463ae92ba806c4280 (patch)
treef5513dbaa072332c90aef3cb556c48acc210f386
parent0805ac2be355659229f960f6fa3a889afa2d2ddc (diff)
downloadscummvm-rg350-47c0e2701796962edd946ae463ae92ba806c4280.tar.gz
scummvm-rg350-47c0e2701796962edd946ae463ae92ba806c4280.tar.bz2
scummvm-rg350-47c0e2701796962edd946ae463ae92ba806c4280.zip
STARTREK: Simplify sine table usage
The if checks that StarTrekEngine::sin is doing to evaluate the correct index for the sine table lookup are already done in Common::SineTable::at().
-rw-r--r--engines/startrek/math.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/engines/startrek/math.cpp b/engines/startrek/math.cpp
index 114ec5cc0f..7770ed3a44 100644
--- a/engines/startrek/math.cpp
+++ b/engines/startrek/math.cpp
@@ -37,15 +37,7 @@ Fixed14 StarTrekEngine::sin(Angle angle) {
else if (i == 0x300)
return -1.0;
- float f = 0.0;
- if (i < 0x100)
- f = _sineTable.getTable()[i & 0xff];
- else if (i < 0x200)
- f = _sineTable.getTable()[256 - (i & 0xff)];
- else if (i < 0x300)
- f = -_sineTable.getTable()[i & 0xff];
- else if (i < 0x400)
- f = -_sineTable.getTable()[256 - (i & 0xff)];
+ float f = _sineTable.at(i);
return Fixed14(f);
}