UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_time.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, 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
36typedef struct dateLong_s {
37 short year;
38 byte month;
39 byte day;
40 byte hour;
41 byte min;
42 byte sec;
44
45void CP_DateConvertLong(const DateTime& date, dateLong_t* dateLong);
46const char* CP_SecondConvert(int second);
47
48void CP_UpdateTime(void);
49void CP_GameTimeStop(void);
50bool CP_IsTimeStopped(void);
51void CP_GameTimeFast(void);
52void CP_GameTimeSlow(void);
53void CP_SetGameTime_f(void);
54
55int Date_DateToSeconds(const DateTime& date);
56DateTime Date_Random(const DateTime& minFrame, const DateTime& maxFrame);
57const char* Date_GetMonthName(int month);
DateTime class definition.
Share stuff between the different cgame implementations.
Class describing a point of time.
Definition DateTime.h:31
void CP_GameTimeFast(void)
Increase game time speed.
Definition cp_time.cpp:174
const char * CP_SecondConvert(int second)
Converts a number of second into a char to display.
Definition cp_time.cpp:57
void CP_GameTimeStop(void)
Stop game time speed.
Definition cp_time.cpp:126
void CP_UpdateTime(void)
Updates date/time and timescale (=timelapse) on the geoscape menu.
Definition cp_time.cpp:104
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
bool CP_IsTimeStopped(void)
Check if time is stopped.
Definition cp_time.cpp:139
void CP_GameTimeSlow(void)
Decrease game time speed.
Definition cp_time.cpp:160
void CP_SetGameTime_f(void)
Set a new time game from id.
Definition cp_time.cpp:214
int Date_DateToSeconds(const DateTime &date)
Convert a date to seconds.
Definition cp_time.cpp:228
const char * Date_GetMonthName(int month)
Returns the short monthame to the given month index.
Definition cp_time.cpp:250
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
Human readable time information in the game.
Definition cp_time.h:36
byte hour
Definition cp_time.h:40
byte month
Definition cp_time.h:38
byte day
Definition cp_time.h:39
byte min
Definition cp_time.h:41
short year
Definition cp_time.h:37
byte sec
Definition cp_time.h:42