fp: Affix the camera to the clicked entity

This commit is contained in:
doyle 2023-09-30 21:36:27 +10:00
parent 1a1281e37d
commit 8301bdb86c
2 changed files with 5 additions and 3 deletions

View File

@ -1230,6 +1230,8 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
entity->sprite_height.meters -= 1; entity->sprite_height.meters -= 1;
Dqn_Log_InfoF("Height: %.1f", entity->sprite_height.meters); Dqn_Log_InfoF("Height: %.1f", entity->sprite_height.meters);
} }
game->camera.world_pos = FP_Game_CalcEntityWorldPos(game, entity->handle) - Dqn_V2_InitV2I(platform->core.window_size) * .5f;
} }
} }
@ -1694,8 +1696,8 @@ void TELY_DLL_FrameUpdate(void *user_data)
TELY_RFui_TextF(rfui, TELY_RFui_TextF(rfui,
" | %dx%d %.1fHz | TSC %.1f GHz", " | %dx%d %.1fHz | TSC %.1f GHz",
platform->core.display.size.w, platform->core.window_size.w,
platform->core.display.size.h, platform->core.window_size.h,
platform->core.display.refresh_rate, platform->core.display.refresh_rate,
platform->core.tsc_per_second / 1'000'000'000.0); platform->core.tsc_per_second / 1'000'000'000.0);

View File

@ -201,7 +201,7 @@ struct FP_GameCamera
Dqn_V2 scale; Dqn_V2 scale;
}; };
enum FP_GameAudio enum FP_GameAudio
{ {
FP_GameAudio_TestAudio, FP_GameAudio_TestAudio,
FP_GameAudio_TerryHit, FP_GameAudio_TerryHit,