Make camera zoom fps independent
parent
276f85dee8
commit
01315fb75d
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue