ScummVM API documentation
magic.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_MAGIC_H
23#define MADS_CORE_MAGIC_H
24
25#include "mads/core/general.h"
26
27namespace MADS {
28
29#define MAGIC_LOWER_LEFT 1
30#define MAGIC_LOWER_RIGHT 2
31#define MAGIC_UPPER_LEFT 3
32#define MAGIC_UPPER_RIGHT 4
33
34#define MAGIC_LEFT 0
35#define MAGIC_RIGHT 1
36
37#define MAGIC_IMMEDIATE 0
38#define MAGIC_THRU_BLACK 1
39#define MAGIC_SECRET_FUJI 2
40
41#define MAGIC_SWAP_BACKGROUND 0
42#define MAGIC_SWAP_FOREGROUND 1
43
44struct MagicGrey {
45 byte intensity;
46 byte map_color;
47 word accum[3];
48};
49
50typedef MagicGrey *MagicGreyPtr;
51
53 uint32 base_time;
54 int base_step;
55};
56
57extern byte magic_color_flags[3];
58extern byte magic_color_values[3];
59extern int magic_low_fade_bound;
60extern int magic_high_fade_bound;
61extern int magic_special_center_x;
62extern int magic_special_center_y;
63
64
65extern void magic_get_grey_values(Palette *pal, byte *grey_value,
66 int base_color, int num_colors);
67extern void magic_grey_palette(Palette *pal);
68
78extern void magic_grey_popularity(byte *grey_list, byte *grey_table, int num_colors);
79extern void magic_set_color_flags(byte r, byte g, byte b);
80extern void magic_set_color_values(byte r, byte g, byte b);
81extern void magic_map_to_grey_ramp(Palette *pal, int base_color, int num_colors,
82 int base_grey, int num_greys, MagicGreyPtr magic_map);
83extern void magic_grey_ramp_palette(Palette &pal, int num_greys);
84extern void magic_fade_pacer_init(MagicFadePacer &pacer);
85extern void magic_fade_pacer_wait(MagicFadePacer &pacer, int step,
86 int fade_step_rate);
87extern void magic_wait_for_fade_start(long *completion_deadline, int steps,
88 int fade_step_rate, int minimum_black_ticks);
89extern void magic_fade_to_grey(Palette &pal, byte *map_pointer,
90 int base_color, int num_colors, int base_grey, int num_greys,
91 int tick_delay, int steps, int fade_step_rate = 0);
92// completion_deadline uses timer_read() ticks and is updated when a minimum
93// black interval after palette preparation moves the reveal. nullptr leaves
94// reveal timing unchanged.
95extern void magic_fade_from_grey(RGBcolor *pal, Palette target, int base_color,
96 int num_colors, int base_grey, int num_greys, int tick_delay, int steps,
97 int fade_step_rate = 0, long *completion_deadline = nullptr,
98 int minimum_black_ticks = 0);
99
116extern void magic_screen_change_corner(Buffer *new_screen, Palette &pal, int corner_id,
117 int buffer_base_x, int buffer_base_y, int screen_base_x, int screen_base_y,
118 int thru_black, int set_palette, int tick_delay);
119
120/*
121 * Picture-to-picture transition in which the new picture sweeps
122 * in from either the right or left edge.
123 *
124 * @param new_screen
125 * @param pal
126 * @param edge_id
127 * @param buffer_base_x
128 * @param buffer_base_y
129 * @param screen_base_x
130 * @param screen_base_y
131 * @param thru_black
132 * @param set_palette
133 * @param tick_delay
134 */
135extern void magic_screen_change_edge(Buffer *new_screen, Palette &pal, int edge_id,
136 int buffer_base_x, int buffer_base_y, int screen_base_x, int screen_base_y,
137 int thru_black, int set_palette, int tick_delay);
138
156extern void magic_screen_change_circle(Buffer *new_screen, Palette &pal,
157 int inward_flag, int buffer_base_x, int buffer_base_y,
158 int screen_base_x, int screen_base_y, int thru_black, int set_palette,
159 int tick_delay, int pixel_rate);
160extern void magic_shrink_buffer(Buffer *from, Buffer *unto);
161extern int magic_shrinking_buffer(Buffer *source, Buffer *rear, int grow_flag,
162 int buffer_base_x, int buffer_base_y, int screen_base_x, int screen_base_y,
163 int tick_delay);
164extern void magic_swap_me_in_the_dark_baby(byte *swap, Palette &pal, int start);
165extern void magic_swap_foreground(byte *background_table, Palette background_palette);
166
173extern int magic_closest_color(RGBcolor *match_color, byte *list, int list_wrap,
174 int list_length);
175
179extern int magic_hash_color(RGBcolor *hash_color);
180
181} // namespace MADS
182
183#endif
Definition: atari-screen.h:42
Definition: general.h:57
Definition: magic.h:52
Definition: magic.h:44
Definition: general.h:42