ScummVM API documentation
conv_io.h
1
2/* ScummVM - Graphic Adventure Engine
3 *
4 * ScummVM is the legal property of its developers, whose names
5 * are too numerous to list here. Please refer to the COPYRIGHT
6 * file distributed with this source distribution.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef M4_ADV_R_CONV_IO_H
24#define M4_ADV_R_CONV_IO_H
25
26#include "common/array.h"
27#include "common/serializer.h"
28#include "m4/m4_types.h"
29#include "m4/adv_r/conv.h"
30#include "m4/graphics/gr_pal.h"
31#include "m4/gui/gui_dialog.h"
32
33namespace M4 {
34
35#define HIDDEN 0x00000004
36#define DESTROYED 0x00000008
37
38#define INITIAL 1
39#define PERSISTENT 2
40
41#define CONV_OK 0
42#define CONV_QUIT -1
43#define CONV_NEW -2
44#define CONV_BAIL -3
45
46#define CONV_UNKNOWN_MODE 0
47#define CONV_GET_TEXT_MODE 1
48#define CONV_SET_TEXT_MODE 2
49#define CONV_GET_MESG_MODE 3
50#define CONV_UPDATE_MODE 4
51
52#define DECL_POINTER 1
53
55 Common::Array<byte> convSave; // Original used an actual file. We use a memory buffer
56 int event = 0;
57 int event_ready = 0;
58 char conv_name[16];
59 Conv *globConv = nullptr;
60 bool playerCommAllowed = false;
61 int32 myFinalTrigger = 0;
62 bool interface_was_visible = false; // to remember to turn it back on
63 int restore_conv = 1;
64 int ent = 0;
65 bool swap = false;
66
67 int32 conv_font_spacing_h = 0;
68 int32 conv_font_spacing_v = 5;
69 int32 conv_default_h = conv_font_spacing_h;
70 int32 conv_default_v = conv_font_spacing_v;
71 int32 conv_shading = 65;
72
73 int32 conv_normal_colour = __BLACK;
74 int32 conv_normal_colour_alt1 = __GREEN;
75 int32 conv_normal_colour_alt2 = __GREEN;
76 int32 conv_hilite_colour = __YELLOW;
77 int32 conv_default_hilite_colour = __YELLOW;
78 int32 conv_hilite_colour_alt1 = __YELLOW;
79 int32 conv_hilite_colour_alt2 = __YELLOW;
80 int32 conv_default_normal_colour = __BLACK;
81
82 TextScrn *myTextScrn = nullptr;
83 int32 width = 0, height = 0;
84 int32 glob_x = 0, glob_y = 0;
85 int32 r_x1 = 0, r_y1 = 0, r_x2 = 0, r_y2 = 0;
86 int n_t_e = 0;
87
88 void syncGame(Common::Serializer &s);
89
90 void conv_reset_all();
91};
92
93Conv *conv_load(const char *filename, int x1, int y1, int32 myTrigger, bool want_box = true);
94void conv_load_and_prepare(const char *filename, int trigger, bool ignoreIt = false);
95
96void conv_unload(Conv *c);
97void conv_unload();
98void conv_shutdown();
99
100Conv *conv_get_handle();
101void conv_set_handle(Conv *c);
102
103void conv_resume(Conv *c);
104void conv_resume();
105void conv_reset(const char *filename);
106
107void conv_reset_all();
108void conv_play(Conv *c);
109void conv_play();
110
111const char *conv_sound_to_play();
112int32 conv_whos_talking();
113
114int32 conv_get_decl_val(Conv *c, decl_chunk *decl);
115void conv_set_decl_val(Conv *c, decl_chunk *decl, int32 val);
116void conv_export_value(Conv *c, int32 val, int index);
117void conv_export_value_curr(int32 val, int index);
118void conv_export_pointer(Conv *c, int32 *val, int index);
119void conv_export_pointer_curr(int32 *val, int index);
120
121void conv_set_font_spacing(int32 h, int32 v);
122void conv_set_text_colour(int32 norm_colour, int32 hi_colour);
123
124void conv_set_text_colours(int32 norm_colour, int32 norm_colour_alt1, int32 norm_colour_alt2,
125 int32 hi_colour, int32 hi_colour_alt1, int32 hi_colour_alt2);
126
127void conv_set_shading(int32 shade);
128void conv_set_box_xy(int32 x, int32 y);
129void conv_get_dlg_coords(int32 *x1, int32 *y1, int32 *x2, int32 *y2);
130void conv_set_dlg_coords(int32 x1, int32 y1, int32 x2, int32 y2);
131void conv_set_default_text_colour(int32 norm_colour, int32 hi_colour);
132void conv_set_default_hv(int32 h, int32 v);
133
134int conv_get_event();
135void conv_set_event(int e);
136int conv_is_event_ready();
137
138void conv_swap_words(Conv *c);
139int32 conv_current_node();
140int32 conv_current_entry();
141
142int conv_toggle_flags(entry_chunk *entry);
143int ok_status(entry_chunk *entry);
144int conv_get_text(int32 offset, int32 size, Conv *c);
145void cdd_init();
146
147} // End of namespace M4
148
149#endif
Definition: serializer.h:80
Definition: database.h:28
Definition: conv.h:87
Definition: conv_io.h:54
Definition: gui_dialog.h:62
Definition: conv.h:116
Definition: conv.h:144