forked from aburch/simutrans
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathsimintr.h
62 lines (41 loc) · 1.35 KB
/
simintr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* This file is part of the Simutrans-Extended project under the Artistic License.
* (see LICENSE.txt)
*/
#ifndef SIMINTR_H
#define SIMINTR_H
#include "macros.h"
class karte_t;
class main_view_t;
/// Try to increase fps
bool reduce_frame_time();
/// Try to decrease fps
bool increase_frame_time();
uint32 get_frame_time();
void set_frame_time(uint32 ms);
void intr_refresh_display(bool dirty);
void intr_set_view(main_view_t *view);
void intr_set_last_time(sint32 time);
void intr_enable();
void intr_disable();
void interrupt_check(const char* caller_info = "0");
#if COLOUR_DEPTH == 0 && defined PROFILE
// 0 bit graphic + profiling: no interrupt_check.
#define INT_CHECK(info)
#else
#ifndef DEBUG
// standard version
#define INT_CHECK(info) do { interrupt_check(); } while(false)
#else
// debug version
#define INT_CHECK(info) do { interrupt_check( __FILE__ ":" QUOTEME(__LINE__) ); } while(false)
#endif
#endif
// returns a time string in the desired format
// Returns an empty string if called before the world model defining time is initalized.
char const *tick_to_string( sint64 ticks, bool show_full );
// returns a time difference string in the desired format
// assume the month has 31 days
// round will reduce presion to qrater or less (depending on month length)
char const *difftick_to_string( sint32 ticks, bool round );
#endif