ScummVM API documentation
matte.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef MADS_CORE_MATTE_H
23#define MADS_CORE_MATTE_H
24
25#include "mads/core/general.h"
26#include "mads/core/anim.h"
27#include "mads/core/tile.h"
28
29namespace MADS {
30
31#define SERIES_LIST_SIZE 50
32
33#define SERIES_BONUS_SIZE 1
34#define SERIES_BONUS_OBJECT 1 /* Bonus number of spinning objects */
35
36
37#define IMAGE_LIST_SIZE 50
38#define MESSAGE_LIST_SIZE 40
39
40#define IMAGE_INTER_LIST_SIZE 50
41
42#define MATTE_LIST_SIZE (IMAGE_LIST_SIZE + MESSAGE_LIST_SIZE)
43#define FIRST_MESSAGE_MATTE IMAGE_LIST_SIZE
44
45#define MATTE_FX_NONE 0
46#define MATTE_FX_FADE_FROM_BLACK 1
47#define MATTE_FX_FADE_THRU_BLACK 2
48#define MATTE_FX_CORNER_LOWER_LEFT 3
49#define MATTE_FX_CORNER_LOWER_RIGHT 4
50#define MATTE_FX_CORNER_UPPER_LEFT 5
51#define MATTE_FX_CORNER_UPPER_RIGHT 6
52#define MATTE_FX_EDGE_LEFT 7
53#define MATTE_FX_EDGE_RIGHT 8
54#define MATTE_FX_CIRCLE_OUT_SLOW 9
55#define MATTE_FX_CIRCLE_IN_SLOW 10
56#define MATTE_FX_CIRCLE_OUT_FAST 11
57#define MATTE_FX_CIRCLE_IN_FAST 12
58
59#define MATTE_FX_FAST_THRU_BLACK 20
60#define MATTE_FX_FAST_AND_FANCY 21
61
62
63struct Matte {
64 int x, y; /* upper left coords */
65 int xs, ys; /* sizes */
66 int xh, yh; /* half sizes */
67 int xc, yc; /* centers */
68 byte changed; /* changed this update? */
69 byte valid; /* contains valid matte?*/
70 Matte *linked_matte;
71};
72
73typedef Matte *MattePtr;
74
75extern SeriesPtr series_list[SERIES_LIST_SIZE + SERIES_BONUS_SIZE]; /* Master sprite list */
76
77extern char series_name[SERIES_LIST_SIZE][9]; /* Master sprite name list*/
78extern byte series_user[SERIES_LIST_SIZE]; /* Master sprite user list*/
79
80extern Image image_list[IMAGE_LIST_SIZE]; /* Master image list */
81extern Matte matte_list[MATTE_LIST_SIZE]; /* Master matte list */
82
83extern byte depth_list_id[MATTE_LIST_SIZE]; /* Depth list for sorting */
84extern word depth_list[MATTE_LIST_SIZE];
85
86extern Message message_list[MESSAGE_LIST_SIZE];
87
88extern ImageInter image_inter_list[IMAGE_INTER_LIST_SIZE]; /* Interface lists */
89extern Matte matte_inter_list[IMAGE_INTER_LIST_SIZE];
90
91extern int series_list_marker; /* # of series list entries in use */
92
93extern int picture_view_x; /* Current viewing offset for upper left */
94extern int picture_view_y;
95
96extern int viewing_at_x; /* Screen X coordinate of left window column */
97extern int viewing_at_y; /* Screen Y coordinate of upper window line */
98extern int inter_viewing_at_y; /* Screen Y coordinate of upper interface line */
99
100extern int matte_disable_screen_update; /* Matte driver updates live screen */
101
102extern byte attr_packed; /* Flag if attributes packed */
103
104extern byte image_marker; /* Number of active images */
105extern byte image_inter_marker; /* Number of active interface images */
106
107extern Buffer scr_main; /* Full-screen sized work buffer */
108extern Buffer scr_work; /* Background picture sized buffer */
109extern Buffer scr_inter; /* Interface screen sized buffer */
110
111extern Buffer scr_orig; /* Buffer to hold full background picture */
112extern Buffer scr_depth; /* Buffer to hold depth codes */
113extern Buffer scr_walk; /* Buffer to hold walk codes */
114extern Buffer scr_special; /* Buffer to hold special codes */
115
116extern Buffer scr_inter_orig; /* Buffer to hold original interface */
117
118extern int matte_guard_depth_0; /* Guard popup window depth */
119
120extern int work_screen_ems_handle; /* Work screen in EMS */
121
122extern TileMapHeader picture_map, depth_map; /* Tile maps */
123extern TileResource picture_resource, depth_resource; /* Tile resources */
124
125extern void matte_init(int init_series);
126extern int matte_map_work_screen();
127
128// completion_deadline uses timer_read() ticks and is updated when a minimum
129// black interval after palette preparation moves the reveal. nullptr leaves
130// reveal timing unchanged.
131// boundary_line_color restores AnimView rows after a through-black clear;
132// -1 leaves boundary pixels unmanaged.
133extern void matte_frame(int special_effect, int full_screen,
134 bool full_fade_in = false, int fade_step_rate = 0,
135 long *completion_deadline = nullptr, int minimum_black_ticks = 0,
136 int boundary_line_color = -1);
137
138extern int matte_load_series(const char *name, int load_flags, int bonus_series_number);
139extern void matte_deallocate_series(int id, int free_memory);
140extern int matte_allocate_series(SeriesPtr series, int bonus_series_number);
141
142extern int matte_add_message(FontPtr font, char *text, int x, int y,
143 int message_color, int auto_spacing, bool useMacintoshFont = false);
144extern void matte_clear_message(int handle);
145
146extern int matte_allocate_image();
147
148extern void matte_refresh_work();
149
150extern void matte_inter_frame(int update_live, int clear_chaff);
151extern int matte_allocate_inter_image();
152extern void matte_refresh_inter();
153
154extern void init_matte();
155
156} // namespace MADS
157
158#endif
Definition: general.h:57
Definition: font.h:33
Definition: image.h:29
Definition: anim.h:231
Definition: matte.h:63
Definition: anim.h:247
Definition: sprite.h:244
Definition: tile.h:62
Definition: tile.h:41