1 #ifndef __FADES_H
2 #define __FADES_H
3 
4 /*
5 FADES.H
6 
7 	Copyright (C) 1991-2001 and beyond by Bungie Studios, Inc.
8 	and the "Aleph One" developers.
9 
10 	This program is free software; you can redistribute it and/or modify
11 	it under the terms of the GNU General Public License as published by
12 	the Free Software Foundation; either version 3 of the License, or
13 	(at your option) any later version.
14 
15 	This program is distributed in the hope that it will be useful,
16 	but WITHOUT ANY WARRANTY; without even the implied warranty of
17 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 	GNU General Public License for more details.
19 
20 	This license is contained in the file "COPYING",
21 	which is included with this source code; it is available online at
22 	http://www.gnu.org/licenses/gpl.html
23 
24 Tuesday, April 4, 1995 11:48:29 AM  (Jason')
25 
26 May 17, 2000 (Loren Petrich):
27 	Added separate under-JjaroGoo fade effects
28 
29 May 20, 2000 (Loren Petrich):
30 	Added XML-parser support
31 
32 Jan 31, 2001 (Loren Petrich):
33 	Added delayed action for the fader effect, so as to get around certain MacOS oddities
34 */
35 
36 /* ---------- constants */
37 
38 enum
39 {
40 	NUMBER_OF_GAMMA_LEVELS= 8,
41 	DEFAULT_GAMMA_LEVEL= 2
42 };
43 
44 enum /* fade types */
45 {
46 	_start_cinematic_fade_in, /* force all colors to black immediately */
47 	_cinematic_fade_in, /* fade in from black */
48 	_long_cinematic_fade_in,
49 	_cinematic_fade_out, /* fade out from black */
50 	_end_cinematic_fade_out, /* force all colors from black immediately */
51 
52 	_fade_red, /* bullets and fist */
53 	_fade_big_red, /* bigger bullets and fists */
54 	_fade_bonus, /* picking up items */
55 	_fade_bright, /* teleporting */
56 	_fade_long_bright, /* nuclear monster detonations */
57 	_fade_yellow, /* explosions */
58 	_fade_big_yellow, /* big explosions */
59 	_fade_purple, /* ? */
60 	_fade_cyan, /* fighter staves and projectiles */
61 	_fade_white, /* absorbed */
62 	_fade_big_white, /* rocket (probably) absorbed */
63 	_fade_orange, /* flamethrower */
64 	_fade_long_orange, /* marathon lava */
65 	_fade_green, /* hunter projectile */
66 	_fade_long_green, /* alien green goo */
67 	_fade_static, /* compiler projectile */
68 	_fade_negative, /* minor fusion projectile */
69 	_fade_big_negative, /* major fusion projectile */
70 	_fade_flicker_negative, /* hummer projectile */
71 	_fade_dodge_purple, /* alien weapon */
72 	_fade_burn_cyan, /* armageddon beast electricity */
73 	_fade_dodge_yellow, /* armageddon beast projectile */
74 	_fade_burn_green, /* hunter projectile */
75 
76 	_fade_tint_green, /* under goo */
77 	_fade_tint_blue, /* under water */
78 	_fade_tint_orange, /* under lava */
79 	_fade_tint_gross, /* under sewage */
80 	_fade_tint_jjaro, /* under JjaroGoo */ // LP addition
81 
82 	NUMBER_OF_FADE_TYPES
83 };
84 
85 // LP change: rearranged to get order: water, lava, sewage, jjaro, pfhor
86 enum /* effect types */
87 {
88 	_effect_under_water,
89 	_effect_under_lava,
90 	_effect_under_sewage,
91 	_effect_under_jjaro,
92 	_effect_under_goo,
93 	NUMBER_OF_FADE_EFFECT_TYPES
94 };
95 
96 // LP addition, since XML does not support direct specification of callbacks
97 // very well.
98 // Moved out here for the convenience of OpenGL fader implementations.
99 enum
100 {
101 	_tint_fader_type,
102 	_randomize_fader_type,
103 	_negate_fader_type,
104 	_dodge_fader_type,
105 	_burn_fader_type,
106 	_soft_tint_fader_type,
107 	NUMBER_OF_FADER_FUNCTIONS
108 };
109 
110 
111 /* ---------- prototypes/FADES.C */
112 
113 void initialize_fades(void);
114 bool update_fades(bool game_in_progress = false);
115 
116 void start_fade(short type);
117 void stop_fade(void);
118 bool fade_finished(void);
119 
120 void set_fade_effect(short type);
121 
122 short get_fade_period(short type);
123 
124 void gamma_correct_color_table(struct color_table *uncorrected_color_table, struct color_table *corrected_color_table, short gamma_level);
125 float get_actual_gamma_adjust(short gamma_level);
126 
127 void explicit_start_fade(short type, struct color_table *original_color_table, struct color_table *animated_color_table, bool game_in_progress = false);
128 void full_fade(short type, struct color_table *original_color_table);
129 
130 // see if the screen was set to black by the last fade
131 bool fade_blacked_screen(void);
132 
133 // LP: sets the number of calls of set_fade_effect() that get ignored;
134 // this is a workaround for a MacOS-version bug where something gets painted on the screen
135 // after certain dialog boxes are cleared, thus canceling out the fader effect.
136 void SetFadeEffectDelay(int _FadeEffectDelay);
137 
138 class InfoTree;
139 void parse_mml_faders(const InfoTree& root);
140 void reset_mml_faders();
141 
142 #endif
143 
144