I don't think a function like that exists, but it's so simple you can just write it yourself. It might look something like this:
angle_dist(int d1, int d2) {
if(abs(d2 - d1) > 180)
if(d2 > d1)
return (360-d2) + d1;
else
return (360-d1) + d2;
else
return abs(d2 - d1)
}
(I'll leave the signs for you to figure out)
Thanks I was going to write something similar but wanted to make sure thats how it's normally done in game development(as in for top down rpg's or shooters with 360* rotation).
Edit: Wooo got it!!, even with your help that felt like a minor win hehe
int Player::findRotation(int rotation)
{
int currentRot = playSprite.getRotation();
int desiredRot = rotation;
if((desiredRot - currentRot) > 180)
{
return -rotation;
}
}