#ifndef WORLD_DAYCYCLE_H #define WORLD_DAYCYCLE_H /* In-game clock driving sun position and light colors. */ #include #include "render/renderer.h" typedef struct { float seconds; /* seconds since midnight, 0..86400 */ float time_scale; /* game seconds per real second */ float day_start; /* sunrise hour */ float day_end; /* sunset hour */ Lighting light; /* derived from the time of day */ } DayCycle; void DayCycle_init(DayCycle *dc, float start_hour, float time_scale); void DayCycle_update(DayCycle *dc, float dt); /* Writes "HH:MM:SS". */ void DayCycle_format(const DayCycle *dc, char *out, size_t out_size); #endif /* WORLD_DAYCYCLE_H */