Permalink
Browse files

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().
  • Loading branch information...
dafioram committed Aug 17, 2018
1 parent 9d860ca commit 067efdd7579d2ada9ecb0393c77dbb15844038a2
Showing with 1 addition and 9 deletions.
  1. +1 −9 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);
}

0 comments on commit 067efdd

Please sign in to comment.