fp: Fix regression with camera not clamping to map bounds

This commit is contained in:
doyle 2023-10-22 20:02:35 +11:00
parent 60071826aa
commit 943bea72f1

View File

@ -2192,7 +2192,8 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
if (game->play.camera_tracking_entity.size)
camera->world_pos_target /= DQN_CAST(Dqn_f32)game->play.camera_tracking_entity.size;
if (!FP_Game_IsNilEntityHandle(game, game->play.clicked_entity)) {
// NOTE: Clamp camera to map bounds ============================================================
{
Dqn_V2 window_size = Dqn_V2_InitV2I(platform->core.window_size);
camera->scale = window_size / camera->size;