@@ -3938,6 +3938,28 @@ void Game::updateFrame(std::vector<aabb3f> &highlight_boxes,
3938
3938
}
3939
3939
3940
3940
3941
+ inline static const char *yawToDirectionString (int yaw)
3942
+ {
3943
+ // NOTE: TODO: This can be done mathematically without the else/else-if
3944
+ // cascade.
3945
+
3946
+ const char *player_direction;
3947
+
3948
+ yaw = wrapDegrees_0_360 (yaw);
3949
+
3950
+ if (yaw >= 45 && yaw < 135 )
3951
+ player_direction = " West [-X]" ;
3952
+ else if (yaw >= 135 && yaw < 225 )
3953
+ player_direction = " South [-Z]" ;
3954
+ else if (yaw >= 225 && yaw < 315 )
3955
+ player_direction = " East [+X]" ;
3956
+ else
3957
+ player_direction = " North [+Z]" ;
3958
+
3959
+ return player_direction;
3960
+ }
3961
+
3962
+
3941
3963
void Game::updateGui (float *statustext_time, const RunStats &stats,
3942
3964
const GameRunData& runData, f32 dtime, const VolatileRunFlags &flags,
3943
3965
const CameraOrientation &cam)
@@ -3993,6 +4015,7 @@ void Game::updateGui(float *statustext_time, const RunStats &stats,
3993
4015
<< " , " << (player_position.Y / BS)
3994
4016
<< " , " << (player_position.Z / BS)
3995
4017
<< " ) (yaw=" << (wrapDegrees_0_360 (cam.camera_yaw ))
4018
+ << " " << yawToDirectionString (cam.camera_yaw )
3996
4019
<< " ) (seed = " << ((u64)client->getMapSeed ())
3997
4020
<< " )" ;
3998
4021
0 commit comments