From cfe2f711dec2692e0a6f0a4935412f8d4651563d Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Sun, 27 Apr 2025 20:19:28 +0200 Subject: [PATCH] Add FOV setting --- TODO.txt | 3 ++- assets.h | 4 ++-- data | 8 ++++++++ renderer.h | 5 ++++- settings.h | 6 ++++++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/TODO.txt b/TODO.txt index fb588a7..7ea4397 100644 --- a/TODO.txt +++ b/TODO.txt @@ -3,7 +3,8 @@ fuck issue trackers :D =========== GENERAL ============== - make some kinda repo for world record runs? -- fix the ramp map again due to new physics +- fix the ramp map again due to new physics -- NOW it's almost good but it's + still possible to reach the finish at first jump, try to do something about it - keyboard ghosting is an issue, particularly when initiating drift with brake (arrow keys must be used with S for braking for left drift to work) -- think about what to do about this? or leave as is? diff --git a/assets.h b/assets.h index 07b4963..a6ca3ca 100644 --- a/assets.h +++ b/assets.h @@ -503,7 +503,7 @@ static const char *LCR_internalDataFile = // TINY MAP 4: "#MLCtiny4;4321 2" - ":*M2AJ" + ":*M1AJ" // box: ":=C2w:faca" ":=C6w2:fa1a" @@ -527,7 +527,7 @@ static const char *LCR_internalDataFile = ":'C1D:fb11" ":transform.scale = LCR_renderer.carModel->transform.scale; -LCR_renderer.ghostModel->transform.translation.x -= LCR_GAME_UNIT / 4; +LCR_renderer.ghostModel->transform.translation.x -= LCR_GAME_UNIT / 4; // why is this here? TODO #if LCR_ANIMATE_CAR for (int i = 0; i < LCR_CAR_VERTEX_COUNT * 3; ++i) @@ -1250,6 +1250,9 @@ LCR_renderer.ghostModel->transform.translation.x -= LCR_GAME_UNIT / 4; S3L_sceneInit( LCR_renderer.models,LCR_RENDERER_MODEL_COUNT,&LCR_renderer.scene); + LCR_renderer.scene.camera.focalLength = + (LCR_SETTING_CAMERA_FOCAL_LENGTH * S3L_F) / 16; + return 1; } diff --git a/settings.h b/settings.h index 33da949..c6be0fa 100644 --- a/settings.h +++ b/settings.h @@ -32,6 +32,12 @@ #define LCR_SETTING_FPS 30 #endif +#ifndef LCR_SETTING_CAMERA_FOCAL_LENGTH + /** Adjusts camera's focal length, which affects field of view (FOV). The + value must be in range from 1 to 32. */ + #define LCR_SETTING_CAMERA_FOCAL_LENGTH 17 +#endif + #ifndef LCR_SETTING_FREE_CAMERA_SPEED /** Move speed of free camera, in 1/8ths of block length. */ #define LCR_SETTING_FREE_CAMERA_SPEED 50