forked from bvschaik/julius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreen.c
49 lines (40 loc) · 835 Bytes
/
screen.c
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
#include "screen.h"
#include "city/view.h"
#include "city/warning.h"
#include "graphics/graphics.h"
#include "graphics/window.h"
static struct {
int width;
int height;
struct {
int x;
int y;
} dialog_offset;
} data;
void screen_set_resolution(int width, int height)
{
data.width = width;
data.height = height;
data.dialog_offset.x = (width - 640) / 2;
data.dialog_offset.y = (height - 480) / 2;
graphics_init_canvas(width, height);
city_view_set_viewport(width, height);
city_warning_clear_all();
window_invalidate();
}
int screen_width(void)
{
return data.width;
}
int screen_height(void)
{
return data.height;
}
int screen_dialog_offset_x(void)
{
return data.dialog_offset.x;
}
int screen_dialog_offset_y(void)
{
return data.dialog_offset.y;
}