Make camera zoom fps independent

isolation_bkp/dynres
Dominik Madarász 2021-10-27 01:36:21 +02:00
parent 276f85dee8
commit 01315fb75d
3 changed files with 191 additions and 192 deletions

View File

@ -28,7 +28,6 @@ void platform_init() {
InitWindow(screenWidth, screenHeight, "eco2d"); InitWindow(screenWidth, screenHeight, "eco2d");
SetWindowState(FLAG_WINDOW_UNDECORATED|FLAG_WINDOW_MAXIMIZED|FLAG_WINDOW_RESIZABLE|FLAG_MSAA_4X_HINT); SetWindowState(FLAG_WINDOW_UNDECORATED|FLAG_WINDOW_MAXIMIZED|FLAG_WINDOW_RESIZABLE|FLAG_MSAA_4X_HINT);
//SetTargetFPS(144);
screenWidth = GetScreenWidth(); screenWidth = GetScreenWidth();
screenHeight = GetScreenHeight(); screenHeight = GetScreenHeight();
renderer_init(); renderer_init();

View File

@ -82,7 +82,7 @@ void DEBUG_draw_entities_3d(uint64_t key, entity_view * data) {
} }
void renderer_draw_3d(void) { void renderer_draw_3d(void) {
cam_zoom = zpl_min(zpl_lerp(cam_zoom, target_zoom, 0.18), 9.98f); cam_zoom = zpl_min(zpl_lerp(cam_zoom, target_zoom, GetFrameTime()*2.18f), 9.98f);
camera_update(); camera_update();
camera game_camera_3d = camera_get(); camera game_camera_3d = camera_get();

View File

@ -108,7 +108,7 @@ void DEBUG_draw_entities_low(uint64_t key, entity_view * data) {
} }
void renderer_draw_v0(void) { void renderer_draw_v0(void) {
render_camera.zoom = zpl_lerp(render_camera.zoom, target_zoom, 0.18); render_camera.zoom = zpl_lerp(render_camera.zoom, target_zoom, GetFrameTime()*2.9978f);
camera_update(); camera_update();
camera game_camera = camera_get(); camera game_camera = camera_get();