26 #include "../../DateTime.h" 27 #include "../../cl_shared.h" 30 typedef struct gameLapse_s {
35 #define NUM_TIMELAPSE 8 37 const int DAYS_PER_MONTH[
DateTime::MONTHS_PER_YEAR] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
59 static char buffer[6];
62 Com_sprintf(buffer,
sizeof(buffer),
"%2i:%02i", hour, min);
89 dateLong->
day = d + 1;
216 if (
cgi->Cmd_Argc() < 2) {
bool CP_IsTimeStopped(void)
Check if time is stopped.
Class describing a point of time.
static const short MONTHS_PER_YEAR
bool CP_OnGeoscape(void)
Returns if we are currently on the Geoscape.
CASSERT(lengthof(lapse)==NUM_TIMELAPSE)
cvar_t *IMPORT * Cvar_Set(const char *varName, const char *value,...) __attribute__((format(__printf__
void CP_SetGameTime_f(void)
Set a new time game from id.
int Date_DateToSeconds(const DateTime &date)
Convert a date to seconds.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
static void CP_SetGameTime(int gameLapseValue)
Set game time speed.
const char *IMPORT * Cmd_Argv(int n)
void CP_GameTimeSlow(void)
Decrease game time speed.
void CP_GameTimeStop(void)
Stop game time speed.
const char * Date_GetMonthName(int month)
Returns the short monthame to the given month index.
static const int SECONDS_PER_DAY
void CP_UpdateTime(void)
Updates date/time and timescale (=timelapse) on the geoscape menu.
static const int DAYS_PER_YEAR
const cgame_import_t * cgi
Human readable time information in the game.
static bool CP_AllowTimeScale(void)
int getTimeAsSeconds() const
Return the time part of the DateTime as seconds.
Campaign geoscape time header.
int getDateAsDays() const
Return the date part of the DateTime as days.
float frand(void)
Return random values between 0 and 1.
DateTime Date_Random(const DateTime &minFrame, const DateTime &maxFrame)
Return a random relative date which lies between a lower and upper limit.
static const gameLapse_t lapse[NUM_TIMELAPSE]
The possible geoscape time intervalls.
void CP_GameTimeFast(void)
Increase game time speed.
static const short SECONDS_PER_MINUTE
const int DAYS_PER_MONTH[DateTime::MONTHS_PER_YEAR]
Header file for single player campaign control.
static const short SECONDS_PER_HOUR
void CP_DateConvertLong(const DateTime &date, dateLong_t *dateLong)
Converts a date from the engine in a (longer) human-readable format.
const char * CP_SecondConvert(int second)
Converts a number of second into a char to display.