25 #include "../../cl_shared.h"
29 static const int monthLength[
MONTHS_PER_YEAR] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
36 #define NUM_TIMELAPSE 8
42 {
N_(
"5 mins"), 5 * 60},
58 static char buffer[6];
61 Com_sprintf(buffer,
sizeof(buffer),
"%2i:%02i", hour, min);
83 for (i = 0; i <
length; i++) {
89 dateLong->
day = d + 1;
90 dateLong->
month = i + 1;
216 if (
cgi->Cmd_Argc() < 2) {
230 return date->
day * 86400 + date->
sec;
241 if (now->
day > compare->
day)
243 if (now->
day < compare->
day)
245 if (now->
sec > compare->
sec)
bool CP_IsTimeStopped(void)
Check if time is stopped.
bool Date_IsDue(const date_t *date)
Checks whether a given date is equal or earlier than the current campaign date.
bool CP_OnGeoscape(void)
Returns if we are currently on the Geoscape.
CASSERT(lengthof(lapse)==NUM_TIMELAPSE)
void CP_SetGameTime_f(void)
Set a new time game from id.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
int Date_DateToSeconds(const date_t *date)
Convert a date_t date to seconds.
static void CP_SetGameTime(int gameLapseValue)
Set game time speed.
void CP_GameTimeSlow(void)
Decrease game time speed.
bool Date_LaterThan(const date_t *now, const date_t *compare)
Check whether the given date and time is later than current date.
void CP_GameTimeStop(void)
Stop game time speed.
const char * Date_GetMonthName(int month)
Returns the short monthame to the given month index.
cvar_t *IMPORT * Cvar_Set(const char *varName, const char *value,...) __attribute__((format(__printf__
static const int monthLength[MONTHS_PER_YEAR]
void CP_UpdateTime(void)
Updates date/time and timescale (=timelapse) on the geoscape menu.
QGL_EXTERN GLuint GLsizei GLsizei * length
const cgame_import_t * cgi
static bool CP_AllowTimeScale(void)
Engine-side time information in the game.
date_t Date_Substract(date_t a, const date_t &b)
Substract the second date from the first and return the result.
Campaign geoscape time header.
date_t Date_Add(date_t a, const date_t &b)
Add two dates and return the result.
struct gameLapse_s gameLapse_t
Human readable time information in the game.
float frand(void)
Return random values between 0 and 1.
static const gameLapse_t lapse[NUM_TIMELAPSE]
The possible geoscape time intervalls.
void CP_GameTimeFast(void)
Increase game time speed.
void CP_DateConvertLong(const date_t *date, dateLong_t *dateLong)
Converts a date from the engine in a (longer) human-readable format.
Header file for single player campaign control.
date_t Date_Random(date_t minFrame, date_t maxFrame)
Return a random relative date which lies between a lower and upper limit.
const char *IMPORT * Cmd_Argv(int n)
const char * CP_SecondConvert(int second)
Converts a number of second into a char to display.