1 #ifndef LIBFSEMU_THEME_H_
2 #define LIBFSEMU_THEME_H_
3 
4 #include "texture.h"
5 
6 #define FS_EMU_MAX_OVERLAYS 64
7 #define FS_EMU_MAX_OVERLAY_STATES 11
8 
9 enum {
10     FS_EMU_TOP_LEFT_OVERLAY,
11     FS_EMU_TOP_RIGHT_OVERLAY,
12     FS_EMU_BOTTOM_RIGHT_OVERLAY,
13     FS_EMU_BOTTOM_LEFT_OVERLAY,
14     FS_EMU_VSYNC_LED_OVERLAY,
15     FS_EMU_FPS_LED_OVERLAY,
16     FS_EMU_AUDIO_LED_OVERLAY,
17     FS_EMU_FPS_D0_OVERLAY,
18     FS_EMU_FPS_D1_OVERLAY,
19     // the following name must be last in this list!
20     FS_EMU_FIRST_CUSTOM_OVERLAY,
21 };
22 
23 #define FS_EMU_ANCHOR_RIGHT_BIT 1
24 #define FS_EMU_ANCHOR_BOTTOM_BIT 2
25 
26 #define FS_EMU_ANCHOR_TOP_LEFT 0
27 #define FS_EMU_ANCHOR_TOP_RIGHT (FS_EMU_ANCHOR_RIGHT_BIT)
28 #define FS_EMU_ANCHOR_BOTTOM_RIGHT (FS_EMU_ANCHOR_BOTTOM_BIT | \
29         FS_EMU_ANCHOR_RIGHT_BIT)
30 #define FS_EMU_ANCHOR_BOTTOM_LEFT (FS_EMU_ANCHOR_BOTTOM_BIT)
31 
32 typedef struct fs_emu_theme_overlay {
33     char *name;
34     fs_emu_texture *textures[FS_EMU_MAX_OVERLAY_STATES];
35     float x;
36     float y;
37     float w;
38     float h;
39     int anchor;
40 } fs_emu_theme_overlay;
41 
42 struct fs_emu_theme {
43     char *name;
44     int width;
45     int height;
46     char *path;
47     float wall_color_1[4];
48     float wall_color_2[4];
49     float floor_color_1[4];
50     float floor_color_2[4];
51     int floor_height;
52     char *overlay_image;
53     float fade_color[4];
54     float heading_color[4];
55     float item_color[4];
56     fs_emu_theme_overlay overlays[FS_EMU_MAX_OVERLAYS];
57     int display_x;
58     int display_y;
59     int display_w;
60     int display_h;
61 };
62 
63 void fse_init_theme();
64 char *fs_emu_theme_get_resource_path(const char *name);
65 int fs_emu_theme_get_resource_data(const char *name, char **data, int *size);
66 void fs_emu_set_overlay_state(int overlay, int state);
67 
68 extern struct fs_emu_theme g_fs_emu_theme;
69 
70 #endif // LIBFSEMU_THEME_H_
71