UFO: Alien Invasion
Doxygen documentation generating
cp_time.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2023 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 
28 #include "../../DateTime.h"
29 #include "../../cl_shared.h"
30 
36 typedef struct dateLong_s {
37  short year;
43 } dateLong_t;
44 
45 void CP_DateConvertLong(const DateTime& date, dateLong_t* dateLong);
46 const char* CP_SecondConvert(int second);
47 
48 void CP_UpdateTime(void);
49 void CP_GameTimeStop(void);
50 bool CP_IsTimeStopped(void);
51 void CP_GameTimeFast(void);
52 void CP_GameTimeSlow(void);
53 void CP_SetGameTime_f(void);
54 
55 int Date_DateToSeconds(const DateTime& date);
56 DateTime Date_Random(const DateTime& minFrame, const DateTime& maxFrame);
57 const char* Date_GetMonthName(int month);
Class describing a point of time.
Definition: DateTime.h:30
byte min
Definition: cp_time.h:41
void CP_UpdateTime(void)
Updates date/time and timescale (=timelapse) on the geoscape menu.
Definition: cp_time.cpp:104
byte sec
Definition: cp_time.h:42
void CP_GameTimeSlow(void)
Decrease game time speed.
Definition: cp_time.cpp:160
byte day
Definition: cp_time.h:39
byte hour
Definition: cp_time.h:40
const char * CP_SecondConvert(int second)
Converts a number of second into a char to display.
Definition: cp_time.cpp:57
void CP_SetGameTime_f(void)
Set a new time game from id.
Definition: cp_time.cpp:214
Human readable time information in the game.
Definition: cp_time.h:36
short year
Definition: cp_time.h:37
int Date_DateToSeconds(const DateTime &date)
Convert a date to seconds.
Definition: cp_time.cpp:228
void CP_DateConvertLong(const DateTime &date, dateLong_t *dateLong)
Converts a date from the engine in a (longer) human-readable format.
Definition: cp_time.cpp:73
void CP_GameTimeFast(void)
Increase game time speed.
Definition: cp_time.cpp:174
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
DateTime Date_Random(const DateTime &minFrame, const DateTime &maxFrame)
Return a random relative date which lies between a lower and upper limit.
Definition: cp_time.cpp:239
uint8_t byte
Definition: ufotypes.h:34
byte month
Definition: cp_time.h:38
const char * Date_GetMonthName(int month)
Returns the short monthame to the given month index.
Definition: cp_time.cpp:250