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 
33 namespace 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 
93 Conv *conv_load(const char *filename, int x1, int y1, int32 myTrigger, bool want_box = true);
94 void conv_load_and_prepare(const char *filename, int trigger, bool ignoreIt = false);
95 
96 void conv_unload(Conv *c);
97 void conv_unload();
98 void conv_shutdown();
99 
100 Conv *conv_get_handle();
101 void conv_set_handle(Conv *c);
102 
103 void conv_resume(Conv *c);
104 void conv_resume();
105 void conv_reset(char *filename);
106 
107 void conv_reset_all();
108 void conv_play(Conv *c);
109 void conv_play();
110 
111 const char *conv_sound_to_play();
112 int32 conv_whos_talking();
113 
114 int32 conv_get_decl_val(Conv *c, decl_chunk *decl);
115 void conv_set_decl_val(Conv *c, decl_chunk *decl, int32 val);
116 void conv_export_value(Conv *c, int32 val, int index);
117 void conv_export_value_curr(int32 val, int index);
118 void conv_export_pointer(Conv *c, int32 *val, int index);
119 void conv_export_pointer_curr(int32 *val, int index);
120 
121 void conv_set_font_spacing(int32 h, int32 v);
122 void conv_set_text_colour(int32 norm_colour, int32 hi_colour);
123 
124 void 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 
127 void conv_set_shading(int32 shade);
128 void conv_set_box_xy(int32 x, int32 y);
129 void conv_get_dlg_coords(int32 *x1, int32 *y1, int32 *x2, int32 *y2);
130 void conv_set_dlg_coords(int32 x1, int32 y1, int32 x2, int32 y2);
131 void conv_set_default_text_colour(int32 norm_colour, int32 hi_colour);
132 void conv_set_default_hv(int32 h, int32 v);
133 
134 int conv_get_event();
135 void conv_set_event(int e);
136 int conv_is_event_ready();
137 
138 void conv_swap_words(Conv *c);
139 int32 conv_current_node();
140 int32 conv_current_entry();
141 
142 int conv_toggle_flags(entry_chunk *entry);
143 int ok_status(entry_chunk *entry);
144 int conv_get_text(int32 offset, int32 size, Conv *c);
145 void cdd_init();
146 
147 } // End of namespace M4
148 
149 #endif
Definition: gui_dialog.h:74
Definition: conv.h:116
Definition: conv_io.h:54
Definition: serializer.h:79
Definition: conv.h:87
Definition: database.h:28
Definition: conv.h:144