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 authored and sev- committed Aug 17, 2018
1 parent 0805ac2 commit 47c0e2701796962edd946ae463ae92ba806c4280
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 47c0e27

Please sign in to comment.