UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_time.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2020 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
34 typedef struct dateLong_s {
35  short year;
41 } dateLong_t;
42 
43 void CP_DateConvertLong(const date_t* date, dateLong_t* dateLong);
44 const char* CP_SecondConvert(int second);
45 
46 void CP_UpdateTime(void);
47 void CP_GameTimeStop(void);
48 bool CP_IsTimeStopped(void);
49 void CP_GameTimeFast(void);
50 void CP_GameTimeSlow(void);
51 void CP_SetGameTime_f(void);
52 
53 int Date_DateToSeconds(const date_t* date);
54 bool Date_LaterThan(const date_t* now, const date_t* compare);
55 bool Date_IsDue(const date_t* date);
56 date_t Date_Add(date_t a, const date_t& b);
57 date_t Date_Substract(date_t a, const date_t& b);
58 date_t Date_Random(date_t minFrame, date_t maxFrame);
59 const char* Date_GetMonthName(int month);
byte hour
Definition: cp_time.h:38
byte min
Definition: cp_time.h:39
struct dateLong_s dateLong_t
Human readable time information in the game.
void CP_UpdateTime(void)
Updates date/time and timescale (=timelapse) on the geoscape menu.
Definition: cp_time.cpp:104
int Date_DateToSeconds(const date_t *date)
Convert a date_t date to seconds.
Definition: cp_time.cpp:228
void CP_GameTimeSlow(void)
Decrease game time speed.
Definition: cp_time.cpp:160
byte day
Definition: cp_time.h:37
date_t Date_Random(date_t minFrame, date_t maxFrame)
Return a random relative date which lies between a lower and upper limit.
Definition: cp_time.cpp:302
bool Date_IsDue(const date_t *date)
Checks whether a given date is equal or earlier than the current campaign date.
Definition: cp_time.cpp:255
const char * CP_SecondConvert(int second)
Converts a number of second into a char to display.
Definition: cp_time.cpp:56
void CP_SetGameTime_f(void)
Set a new time game from id.
Definition: cp_time.cpp:214
short year
Definition: cp_time.h:35
Engine-side time information in the game.
Definition: common.h:290
byte month
Definition: cp_time.h:36
void CP_DateConvertLong(const date_t *date, dateLong_t *dateLong)
Converts a date from the engine in a (longer) human-readable format.
Definition: cp_time.cpp:72
void CP_GameTimeFast(void)
Increase game time speed.
Definition: cp_time.cpp:174
Human readable time information in the game.
Definition: cp_time.h:34
byte sec
Definition: cp_time.h:40
bool Date_LaterThan(const date_t *now, const date_t *compare)
Check whether the given date and time is later than current date.
Definition: cp_time.cpp:239
date_t Date_Substract(date_t a, const date_t &b)
Substract the second date from the first and return the result.
Definition: cp_time.cpp:285
void CP_GameTimeStop(void)
Stop game time speed.
Definition: cp_time.cpp:126
bool CP_IsTimeStopped(void)
Check if time is stopped.
Definition: cp_time.cpp:139
uint8_t byte
Definition: ufotypes.h:34
date_t Date_Add(date_t a, const date_t &b)
Add two dates and return the result.
Definition: cp_time.cpp:272
const char * Date_GetMonthName(int month)
Returns the short monthame to the given month index.
Definition: cp_time.cpp:317