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.
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
Class describing a point of time.
static void CP_SetGameTime(int gameLapseValue)
Set game time speed.
const char *IMPORT * Cmd_Argv(int n)
int getTimeAsSeconds() const
Return the time part of the DateTime as seconds.
void CP_GameTimeSlow(void)
Decrease game time speed.
static const int SECONDS_PER_DAY
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 short SECONDS_PER_MINUTE
void CP_UpdateTime(void)
Updates date/time and timescale (=timelapse) on the geoscape menu.
int getDateAsDays() const
Return the date part of the DateTime as days.
Human readable time information in the game.
const cgame_import_t * cgi
static bool CP_AllowTimeScale(void)
Campaign geoscape time header.
static const int DAYS_PER_YEAR
static const short MONTHS_PER_YEAR
static const short SECONDS_PER_HOUR
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.
const int DAYS_PER_MONTH[DateTime::MONTHS_PER_YEAR]
Header file for single player campaign control.
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.