From 9485a7cd951e269f9bb83922f81ad70ad127ae68 Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Wed, 15 Jan 2025 22:01:50 +0100 Subject: [PATCH] Add horizon shift --- TODO.txt | 2 +- renderer.h | 3 ++- settings.h | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TODO.txt b/TODO.txt index 9eb8360..f11b359 100644 --- a/TODO.txt +++ b/TODO.txt @@ -2,7 +2,6 @@ - replay validation - add time slow down setting -- the horizon on background seems too low? maybe add setting to shift it a bit? - add argc/argv to gameInit? could be used to quickly start maps, verify replays etc. - maybe each map could have a target time embedded: when beaten, the map would @@ -27,6 +26,7 @@ =========== HANDLED ============== - allow stopping car rotation in air like in Trackmania +- the horizon on background seems too low? maybe add setting to shift it a bit? - replay format - prevent time overflow! stop incrementing level frame once it's at maximum - car shadow? probably would have to be done as screen space effect with diff --git a/renderer.h b/renderer.h index 311f830..ada0c84 100644 --- a/renderer.h +++ b/renderer.h @@ -1312,7 +1312,8 @@ void LCR_rendererDrawSky(int sky, S3L_Unit offsetH, S3L_Unit offsetV) anchorPoint[0] += 2 * LCR_IMAGE_SIZE * LCR_SETTING_SKY_SIZE; anchorPoint[1] = - (LCR_EFFECTIVE_RESOLUTION_Y) / 3 - // 3: we place the center a bit more up + (LCR_EFFECTIVE_RESOLUTION_Y) / 2 - // 3: we place the center a bit more up + (LCR_SETTING_HORIZON_SHIFT * LCR_EFFECTIVE_RESOLUTION_Y) / 16 - (LCR_EFFECTIVE_RESOLUTION_Y * offsetV) / S3L_F - LCR_IMAGE_SIZE * LCR_SETTING_SKY_SIZE; diff --git a/settings.h b/settings.h index 6f1c42f..35fabde 100644 --- a/settings.h +++ b/settings.h @@ -204,4 +204,9 @@ #define LCR_SETTING_REPLAY_MAX_SIZE 256 #endif +#ifndef LCR_SETTING_HORIZON_SHIFT + /** Vertical offset of the background horizon, 1/16th of screen height. */ + #define LCR_SETTING_HORIZON_SHIFT 5 +#endif + #endif // guard