daytime.h constants

This commit is contained in:
xtreme8000 2022-12-21 22:37:33 +01:00
parent 5ca09dae29
commit 66d5183e5c
2 changed files with 7 additions and 3 deletions

View file

@ -22,6 +22,9 @@
#include "cglm/cglm.h"
#define DAY_TICK_MS 50
#define DAY_LENGTH_TICKS 24000
float daytime_brightness(float time);
float daytime_celestial_angle(float time);
void daytime_sky_colors(float time, vec3 top_plane, vec3 bottom_plane,

View file

@ -113,9 +113,10 @@ int main(void) {
float daytime
= (float)((gstate.world_time
+ time_diff_ms(gstate.world_time_start, this_frame) / 50)
% 24000)
/ 24000.0F;
+ time_diff_ms(gstate.world_time_start, this_frame)
/ DAY_TICK_MS)
% DAY_LENGTH_TICKS)
/ (float)DAY_LENGTH_TICKS;
input_poll();