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> conv_save_buff;
56  Common::Array<byte> convSave;
57  int event = 0;
58  int event_ready = 0;
59  char conv_name[16];
60  Conv *globConv = nullptr;
61  bool playerCommAllowed = false;
62  int32 myFinalTrigger = 0;
63  bool interface_was_visible = false; // to remember to turn it back on
64  int restore_conv = 1;
65  int ent = 0;
66  bool swap = false;
67 
68  int32 conv_font_spacing_h = 0;
69  int32 conv_font_spacing_v = 5;
70  int32 conv_default_h = conv_font_spacing_h;
71  int32 conv_default_v = conv_font_spacing_v;
72  int32 conv_shading = 65;
73 
74  int32 conv_normal_colour = __BLACK;
75  int32 conv_normal_colour_alt1 = __GREEN;
76  int32 conv_normal_colour_alt2 = __GREEN;
77  int32 conv_hilite_colour = __YELLOW;
78  int32 conv_default_hilite_colour = __YELLOW;
79  int32 conv_hilite_colour_alt1 = __YELLOW;
80  int32 conv_hilite_colour_alt2 = __YELLOW;
81  int32 conv_default_normal_colour = __BLACK;
82 
83  TextScrn *myTextScrn = nullptr;
84  int32 width = 0, height = 0;
85  int32 glob_x = 0, glob_y = 0;
86  int32 r_x1 = 0, r_y1 = 0, r_x2 = 0, r_y2 = 0;
87  int n_t_e = 0;
88 
89  void syncGame(Common::Serializer &s);
90 
91  void conv_reset_all();
92 };
93 
94 Conv *conv_load(const char *filename, int x1, int y1, int32 myTrigger, bool want_box = true);
95 void conv_load_and_prepare(const char *filename, int trigger, bool ignoreIt = false);
96 
97 void conv_unload(Conv *c);
98 void conv_unload();
99 void conv_shutdown();
100 
101 Conv *conv_get_handle();
102 void conv_set_handle(Conv *c);
103 
104 void conv_resume(Conv *c);
105 void conv_resume();
106 void conv_reset(char *filename);
107 
108 void conv_reset_all();
109 void conv_play(Conv *c);
110 void conv_play();
111 
112 const char *conv_sound_to_play();
113 int32 conv_whos_talking();
114 
115 int32 conv_get_decl_val(Conv *c, decl_chunk *decl);
116 void conv_set_decl_val(Conv *c, decl_chunk *decl, int32 val);
117 void conv_export_value(Conv *c, int32 val, int index);
118 void conv_export_value_curr(int32 val, int index);
119 void conv_export_pointer(Conv *c, int32 *val, int index);
120 void conv_export_pointer_curr(int32 *val, int index);
121 
122 void conv_set_font_spacing(int32 h, int32 v);
123 void conv_set_text_colour(int32 norm_colour, int32 hi_colour);
124 
125 void conv_set_text_colours(int32 norm_colour, int32 norm_colour_alt1, int32 norm_colour_alt2,
126  int32 hi_colour, int32 hi_colour_alt1, int32 hi_colour_alt2);
127 
128 void conv_set_shading(int32 shade);
129 void conv_set_box_xy(int32 x, int32 y);
130 void conv_get_dlg_coords(int32 *x1, int32 *y1, int32 *x2, int32 *y2);
131 void conv_set_dlg_coords(int32 x1, int32 y1, int32 x2, int32 y2);
132 void conv_set_default_text_colour(int32 norm_colour, int32 hi_colour);
133 void conv_set_default_hv(int32 h, int32 v);
134 
135 int conv_get_event();
136 void conv_set_event(int e);
137 int conv_is_event_ready();
138 
139 void conv_swap_words(Conv *c);
140 int32 conv_current_node();
141 int32 conv_current_entry();
142 
143 int conv_toggle_flags(entry_chunk *entry);
144 int ok_status(entry_chunk *entry);
145 int conv_get_text(int32 offset, int32 size, Conv *c);
146 void cdd_init();
147 
148 } // End of namespace M4
149 
150 #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