MOHAWK: MYST: Use degree conversion common math funcs

This commit is contained in:
David Fioramonti 2018-05-24 07:19:04 -07:00 committed by Thierry Crozat
parent fb3dcb9ee0
commit a01babbd38

View file

@ -31,6 +31,7 @@
#include "mohawk/myst_stacks/myst.h"
#include "common/events.h"
#include "common/math.h"
#include "common/system.h"
#include "common/textconsole.h"
@ -3251,9 +3252,9 @@ Common::Point Myst::towerRotationMapComputeCoords(uint16 angle) {
Common::Point end;
// Polar to rect coords
double radians = angle * M_PI / 180.0;
end.x = (int16)(_towerRotationCenter.x + cos(radians) * 310.0);
end.y = (int16)(_towerRotationCenter.y + sin(radians) * 310.0);
float radians = Common::deg2rad<uint16,float>(angle);
end.x = (int16)(_towerRotationCenter.x + cos(radians) * 310.0f);
end.y = (int16)(_towerRotationCenter.y + sin(radians) * 310.0f);
return end;
}