1 #ifndef __SHELL_H
2 #define __SHELL_H
3 
4 /*
5 SHELL.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 Saturday, August 22, 1992 2:18:48 PM
25 
26 Saturday, January 2, 1993 10:22:46 PM
27 	thank god c doesn�t choke on incomplete structure references.
28 
29 Jul 5, 2000 (Loren Petrich):
30 	Added XML support for controlling the cheats
31 
32 Jul 7, 2000 (Loren Petrich):
33 	Added Ben Thompson's change: an Input-Sprocket-only input mode
34 
35 Aug 12, 2000 (Loren Petrich):
36 	Using object-oriented file handler
37 
38 Dec 29, 2000 (Loren Petrich):
39 	Added function for showing text messages on the screen
40 */
41 
42 #include "cstypes.h"
43 
44 class FileSpecifier;
45 struct RGBColor;
46 struct SDL_Color;
47 struct SDL_Surface;
48 
49 /* ---------- constants */
50 
51 /* ---------- resources */
52 
53 enum {
54 	strPROMPTS= 131,
55 	_save_game_prompt= 0,
56 	_save_replay_prompt,
57 	_select_replay_prompt,
58 	_default_prompt
59 };
60 
61 /* ---------- structures */
62 
63 struct screen_mode_data
64 {
65 	short acceleration;
66 
67 	bool high_resolution;
68 	bool fullscreen;
69 	bool draw_every_other_line;
70 
71 	short bit_depth;  // currently 8 or 16
72 	short gamma_level;
73 
74 	short width;
75 	short height;
76 	bool auto_resolution;
77 	bool high_dpi;
78 	bool hud;
79 	short hud_scale_level;
80 	short term_scale_level;
81 	bool fix_h_not_v;
82 	bool translucent_map;
83 	bool camera_bob;
84 
85 };
86 
87 #define NUMBER_OF_KEYS 21
88 #define NUMBER_UNUSED_KEYS 10
89 
90 enum // input devices
91 {
92 	_keyboard_or_game_pad,
93 	_mouse_yaw_pitch
94 };
95 
96 #define PREFERENCES_NAME_LENGTH 32
97 
98 /* ---------- prototypes/SHELL.C [now shell_misc.cpp, shell_macintosh.cpp, shell_sdl.cpp] */
99 
100 void global_idle_proc(void);
101 
102 class InfoTree;
103 void parse_mml_cheats(const InfoTree& root);
104 void reset_mml_cheats();
105 
106 // Load the base MML scripts:
107 void LoadBaseMMLScripts();
108 
109 // Application and directory info:
110 char *expand_symbolic_paths(char *dest, const char *src, int maxlen);
111 char *contract_symbolic_paths(char *dest, const char *src, int maxlen);
112 
113 /* ---------- prototypes/SHAPES.C */
114 
115 void initialize_shape_handler(void);
116 
117 // ZZZ: this now works with RLE'd shapes, but needs extra storage.  Caller should
118 // be prepared to take a byte* if using an RLE shape (it will be set to NULL if
119 // shape is straight-coded); caller will need to free() that storage after freeing
120 // the SDL_Surface.
121 // If inIllumination is >= 0, it'd better be <= 1.  Shading tables are then used instead of the collection's CLUT.
122 // Among other effects (like being able to get darkened shapes), this lets player shapes be colorized according to
123 // team or player color.
124 // OK, yet another change... we now (optionally) take shape and collection separately, since there are too many
125 // low-level shapes in some collections to fit in the number of bits allotted.  If collection != NONE, it's taken
126 // as a collection and CLUT reference together; shape is (then) taken directly as a low-level shape index.
127 // If collection == NONE, shape is expected to convey information about all three elements (CLUT, collection,
128 // low-level shape index).
129 // Sigh, the extensions keep piling up... now we can also provide a quarter-sized surface from a shape.  It's hacky -
130 // the shape is shrunk by nearest-neighbor-style scaling (no smoothing), even at 16-bit and above, and it only works for RLE shapes.
131 SDL_Surface *get_shape_surface(int shape, int collection = NONE, byte** outPointerToPixelData = NULL, float inIllumination = -1.0f, bool inShrinkImage = false);
132 
133 void open_shapes_file(FileSpecifier& File);
134 
135 /* ---------- prototypes/SCREEN_DRAWING.C */
136 
137 void _get_player_color(size_t color_index, RGBColor *color);
138 void _get_interface_color(size_t color_index, RGBColor *color);
139 void _get_player_color(size_t color_index, SDL_Color *color);
140 void _get_interface_color(size_t color_index, SDL_Color *color);
141 
142 
143 /* ---------- protoypes/INTERFACE_MACINTOSH.C */
144 void update_game_window(void);
145 
146 /* ---------- prototypes/PREFERENCES.C */
147 void load_environment_from_preferences(void);
148 
149 // LP: displays a text message on the screen in "printf" fashion
150 // Implemented in the "screen" routines
151 void screen_printf(const char *format, ...);
152 
153 
154 #endif
155