UFO: Alien Invasion
|
Campaign geoscape time header. More...
Go to the source code of this file.
Data Structures | |
struct | dateLong_s |
Human readable time information in the game. More... | |
Typedefs | |
typedef struct dateLong_s | dateLong_t |
Human readable time information in the game. More... | |
Functions | |
void | CP_DateConvertLong (const date_t *date, dateLong_t *dateLong) |
Converts a date from the engine in a (longer) human-readable format. More... | |
const char * | CP_SecondConvert (int second) |
Converts a number of second into a char to display. More... | |
void | CP_UpdateTime (void) |
Updates date/time and timescale (=timelapse) on the geoscape menu. More... | |
void | CP_GameTimeStop (void) |
Stop game time speed. More... | |
bool | CP_IsTimeStopped (void) |
Check if time is stopped. More... | |
void | CP_GameTimeFast (void) |
Increase game time speed. More... | |
void | CP_GameTimeSlow (void) |
Decrease game time speed. More... | |
void | CP_SetGameTime_f (void) |
Set a new time game from id. More... | |
int | Date_DateToSeconds (const date_t *date) |
Convert a date_t date to seconds. More... | |
bool | Date_LaterThan (const date_t *now, const date_t *compare) |
Check whether the given date and time is later than current date. More... | |
bool | Date_IsDue (const date_t *date) |
Checks whether a given date is equal or earlier than the current campaign date. More... | |
date_t | Date_Add (date_t a, const date_t &b) |
Add two dates and return the result. More... | |
date_t | Date_Substract (date_t a, const date_t &b) |
Substract the second date from the first and return the result. More... | |
date_t | Date_Random (date_t minFrame, date_t maxFrame) |
Return a random relative date which lies between a lower and upper limit. More... | |
const char * | Date_GetMonthName (int month) |
Returns the short monthame to the given month index. More... | |
Campaign geoscape time header.
Definition in file cp_time.h.
typedef struct dateLong_s dateLong_t |
Human readable time information in the game.
void CP_DateConvertLong | ( | const date_t * | date, |
dateLong_t * | dateLong | ||
) |
Converts a date from the engine in a (longer) human-readable format.
[in] | date | Contains the date to be converted. |
[out] | dateLong | The converted date. |
Definition at line 72 of file cp_time.cpp.
References dateLong_s::day, date_s::day, DAYS_PER_YEAR, dateLong_s::hour, i, length, lengthof, dateLong_s::min, dateLong_s::month, monthLength, MONTHS_PER_YEAR, dateLong_s::sec, date_s::sec, SECONDS_PER_HOUR, and dateLong_s::year.
Referenced by CL_EventAddMail(), CP_CampaignRun(), CP_UpdateTime(), MS_LoadXML(), MS_TimestampedText(), SAV_GameSave(), UP_OpenMail_f(), and UP_SetMailHeader().
Increase game time speed.
Definition at line 174 of file cp_time.cpp.
References ccs, CP_AllowTimeScale(), CP_UpdateTime(), ccs_s::gameLapse, and NUM_TIMELAPSE.
Decrease game time speed.
Definition at line 160 of file cp_time.cpp.
References ccs, CP_AllowTimeScale(), CP_UpdateTime(), and ccs_s::gameLapse.
Stop game time speed.
Definition at line 126 of file cp_time.cpp.
References ccs, cp_missiontest, CP_OnGeoscape(), CP_UpdateTime(), ccs_s::gameLapse, and cvar_s::integer.
Referenced by AIR_Move(), B_BuildBase_f(), CAP_CheckOverflow(), CL_DisplayHomebasePopup(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CP_BaseAttackMissionDestroyBase(), CP_BaseAttackPrepareBattle(), CP_CampaignInit(), CP_MissionAddToGeoscape(), GEO_Click(), MS_AddNewMessage(), MSO_CheckAddNewMessage(), and NAT_HandleBudget().
bool CP_IsTimeStopped | ( | void | ) |
Check if time is stopped.
Definition at line 139 of file cp_time.cpp.
References ccs, and ccs_s::gameLapse.
Referenced by CP_CampaignRun(), and TEST_F().
const char* CP_SecondConvert | ( | int | second | ) |
Converts a number of second into a char to display.
[in] | second | Number of second. |
Definition at line 56 of file cp_time.cpp.
References Com_sprintf(), and SECONDS_PER_HOUR.
Referenced by CL_DisplayPopupInterceptMission(), GEO_GetAircraftText(), TR_List_f(), and US_SelectStoredUfo_f().
Set a new time game from id.
Definition at line 214 of file cp_time.cpp.
References cgi, cgame_import_s::Cmd_Argv(), and CP_SetGameTime().
Updates date/time and timescale (=timelapse) on the geoscape menu.
Definition at line 104 of file cp_time.cpp.
References _, ccs, cgi, CP_DateConvertLong(), cgame_import_s::Cvar_Set(), ccs_s::date, Date_GetMonthName(), dateLong_s::day, ccs_s::gameLapse, ccs_s::gameTimeScale, dateLong_s::hour, dateLong_s::min, dateLong_s::month, gameLapse_s::name, NUM_TIMELAPSE, gameLapse_s::scale, and dateLong_s::year.
Referenced by CP_CampaignInit(), CP_CampaignRun(), CP_GameTimeFast(), CP_GameTimeSlow(), CP_GameTimeStop(), CP_SetGameTime(), SAV_GameActionsAfterLoad(), and TEST_F().
Add two dates and return the result.
[in] | a | First date. |
[in] | b | Second date. |
Definition at line 272 of file cp_time.cpp.
References date_s::day, date_s::sec, and SECONDS_PER_DAY.
Referenced by CP_BeginRescueMission(), CP_BuildBaseSetUpBase(), CP_BuildBaseSubvertGovernment(), CP_CreateNewMission(), CP_HarvestMissionStart(), CP_InterceptAircraftMissionSet(), CP_InterceptAttackInstallation(), CP_InterceptNextStage(), CP_ReconMissionAerial(), CP_ReconMissionGround(), CP_SpawnCrashSiteMission(), CP_SupplySetStayAtBase(), CP_TerrorMissionStart(), CP_UFOCarrierMissionUpdate(), and CP_XVIMissionStart().
Convert a date_t date to seconds.
[in] | date | The date in date_t format |
Definition at line 228 of file cp_time.cpp.
References date_s::day, and date_s::sec.
Referenced by TR_List_f(), and US_SelectStoredUfo_f().
const char* Date_GetMonthName | ( | int | month | ) |
Returns the short monthame to the given month index.
[in] | month | The month index - [0-11] |
Definition at line 317 of file cp_time.cpp.
References _.
Referenced by CL_EventAddMail(), CP_UpdateTime(), MS_LoadXML(), MS_TimestampedText(), SAV_GameSave(), UP_OpenMail_f(), and UP_SetMailHeader().
bool Date_IsDue | ( | const date_t * | date | ) |
Checks whether a given date is equal or earlier than the current campaign date.
date | The date to check |
true
if the given date is equal or earlier than the current campaign date, false
otherwise Definition at line 255 of file cp_time.cpp.
References ccs, ccs_s::date, date_s::day, and date_s::sec.
Referenced by B_IsBuildingBuiltUp(), CP_CheckTriggerEvent(), TEST_F(), and TR_TransferRun().
Check whether the given date and time is later than current date.
[in] | now | Current date. |
[in] | compare | Date to compare. |
Definition at line 239 of file cp_time.cpp.
References date_s::day, and date_s::sec.
Referenced by CP_CheckMissionEnd(), CP_EndRescueMission(), TEST_F(), UR_ProcessActive(), and US_StoreUFO().
Return a random relative date which lies between a lower and upper limit.
[in] | minFrame | Minimal date. |
[in] | maxFrame | Maximal date. |
Definition at line 302 of file cp_time.cpp.
References date_s::day, frand(), date_s::sec, and SECONDS_PER_DAY.
Referenced by CP_BeginRescueMission(), CP_BuildBaseSetUpBase(), CP_BuildBaseSubvertGovernment(), CP_CreateNewMission(), CP_HarvestMissionStart(), CP_InterceptAircraftMissionSet(), CP_InterceptAttackInstallation(), CP_ReconMissionAerial(), CP_ReconMissionGround(), CP_SpawnCrashSiteMission(), CP_SupplySetStayAtBase(), CP_TerrorMissionStart(), and CP_XVIMissionStart().
Substract the second date from the first and return the result.
[in] | a | First date. |
[in] | b | Second date. |
Definition at line 285 of file cp_time.cpp.
References date_s::day, date_s::sec, and SECONDS_PER_DAY.
Referenced by B_GetConstructionTimeRemain(), TR_List_f(), and US_SelectStoredUfo_f().