Add shadows and light effects
[mercenary-reloaded.git] / src / mercenary / mercenary.h
1
2 /* cause why the cpu execution loop stopped */
3 enum {
4         STOP_AT_END = 0,
5         STOP_AT_PATCH_RENDER,
6         STOP_AT_PATCH_VR,
7         STOP_AT_WAIT_VBL,
8         STOP_AT_WAIT_INPUT,
9         STOP_AT_CLEAR_SCREEN1,
10         STOP_AT_CLEAR_SCREEN2,
11         STOP_AT_CLEAR_SCREEN3,
12         STOP_AT_DRAW_GROUND,
13         STOP_AT_INFO_OBJECT_MOVING,
14         STOP_AT_INFO_OBJECT_FIX,
15         STOP_AT_TAG_IS_OBJECT_1,
16         STOP_AT_TAG_IS_OBJECT_0,
17         STOP_AT_COORD_OBJECT,
18         STOP_AT_POLY_OBJECT_M3,
19         STOP_AT_POLY_OBJECT_M2,
20         STOP_AT_LINE_OBJECT,
21         STOP_AT_COORD_BEACON,
22         STOP_AT_POINT_BEACON,
23         STOP_AT_COORD_BUILDING_EXTERIOR,
24         STOP_AT_POLY_BUILDING_EXTERIOR,
25         STOP_AT_LINE_BUILDING_EXTERIOR,
26         STOP_AT_COORD_BUILDING_INTERIOR,
27         STOP_AT_POLY_BUILDING_INTERIOR1,
28         STOP_AT_POLY_BUILDING_INTERIOR2,
29         STOP_AT_POLY_BUILDING_INTERIOR3,
30         STOP_AT_POLY_BUILDING_INTERIOR4,
31         STOP_AT_POLY_BUILDING_INTERIOR5,
32         STOP_AT_POLY_BUILDING_INTERIOR6,
33         STOP_AT_POLY_BUILDING_INTERIOR1to4,
34         STOP_AT_POLY_BUILDING_INTERIOR5to6,
35         STOP_AT_WALL_BUILDING,
36         STOP_AT_COORD_COMET,
37         STOP_AT_MATRIX_COMET,
38         STOP_AT_POLY_COMET,
39         STOP_AT_COORD_LINE_ROADS,
40         STOP_AT_LINE_ROADS,
41         STOP_AT_LINE_ROADS_CENTER,
42         STOP_AT_COORD_POLY_ROADS,
43         STOP_AT_POLY_ROADS,
44         STOP_AT_COORD_TAGS,
45         STOP_AT_COORD_TAGS2,
46         STOP_AT_LINE_TAGS1,
47         STOP_AT_LINE_TAGS2,
48         STOP_AT_POLY_TAGS1,
49         STOP_AT_POLY_TAGS2,
50         STOP_AT_COORD_PLANET,
51         STOP_AT_MATRIX_PLANET,
52         STOP_AT_DRAW_PLANET,
53         STOP_AT_DRAW_COMET,
54         STOP_AT_DRAW_STARS_SPACE,
55         STOP_AT_DRAW_STARS_GROUND,
56         STOP_AT_DRAW_STARS_FLYING,
57         STOP_AT_DRAW_STARS_FLYING2,
58         STOP_AT_DRAW_STARS_INTERSTELLAR,
59         STOP_AT_DRAW_SUN_INTERSTELLAR,
60         STOP_AT_COORD_ISLANDS,
61         STOP_AT_POLY_ISLANDS,
62         STOP_AT_LINE_ISLANDS,
63         STOP_AT_DRAW_SIGHTS,
64         STOP_AT_POLY_UKN2,
65         STOP_AT_COORD_EXPLOSION,
66         STOP_AT_DRAW_EXPLOSION,
67         STOP_AT_SHADOW_BUILDING,
68 };
69
70 struct vr_move {
71         int override;
72         int index;
73         int32_t east[4];
74         int32_t north[4];
75         int yaw, pitch;
76 };
77
78 extern const struct cpu_stop mercenary_stop_at[];
79 void mercenary_load(void);
80 void mercenary_patch(void);
81 void mercenary_patch_render(int shadows);
82 void mercenary_patch_vr(void);
83 uint32_t mercenary_palette_view(void);
84 uint32_t mercenary_palette_render(void);
85 uint32_t mercenary_palette_predefined(void);
86 uint32_t mercenary_palette_stars(void);
87 void mercenary_get_sky_colors(uint16_t *day, uint16_t *night);
88 uint32_t mercenary_object_vertex_register(void);
89 void mercenary_get_orientation(double *roll, double *pitch, double *yaw);
90 void mercenary_set_orientation(double yaw);
91 void mercenary_get_orientation_raw(int16_t *pitch, uint16_t *yaw);
92 void mercenary_get_orientation_planet(double *inclination, double *azimuth, int improved);
93 void mercenary_get_location(int32_t *east, int32_t *height, int32_t *north);
94 void mercenary_get_object_info(int *id, int32_t *east, int32_t *height, int32_t *north);
95 void mercenary_get_building_exterior_info(int32_t *loc_x, int32_t *loc_z, int32_t *scale_x, int32_t *scale_y, int32_t *scale_z, uint16_t *anim_flag, uint16_t *anim_x, uint16_t *anim_y, uint16_t *anim_z, uint16_t *anim_phase, uint32_t *a4, uint32_t *a0, uint32_t *a5);
96 void mercenary_coord_building_interior(int16_t *east, int32_t *height1, int32_t *height2, int32_t *height3, int32_t *height4, int16_t *north);
97 int mercenary_street_color_index(void);
98 int mercenary_line_tags_index(void);
99 uint16_t mercenary_poly_tags_color(void);
100 int mercenary_background_index(void);
101 uint32_t mercenary_planet_scale_index(void);
102 uint32_t mercenary_star_table(void);
103 void mercenary_vr_move(int override, int32_t *east, int32_t *north, int yaw, int pitch);
104 int mercenary_get_info_walking(void);
105 extern const char *mercenary_name;
106 extern const char *mercenary_gamesavesuffix;
107 const uint8_t *get_mission_disk(int disk, int mission);
108