ScummVM API documentation
conv.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_H
24#define M4_ADV_R_CONV_H
25
26#include "common/array.h"
27#include "m4/m4_types.h"
28
29namespace M4 {
30
31#define _GC(X) _G(conversations).X
32
33#define CONV_WAIT_FOR_INPUT 1
34#define CONV_HALT_FOREVER 2
35#define CONV_HALT 3
36#define CONV_INPUT_OK 4
37#define CONV_DO_NOTHING 5
38
39#define CONV_PLAYER_TALKING 1
40#define CONV_NON_PLAYER_TALKING 0
41
42#define DLG_FLUSH_LEFT -1
43#define DLG_FLUSH_RIGHT -2
44#define DLG_FLUSH_TOP -3
45#define DLG_FLUSH_BOTTOM -4
46#define DLG_CENTER_H -5
47#define DLG_CENTER_V -6
48
49
50//from: prochunk.h
51#define C_ASGN_CHUNK ((int32) ('C' << 24) | ('A' << 16) | ('S' << 8) | 'N')
52
53#define ASGN_CHUNK ((int32) ('A' << 24) | ('S' << 16) | ('G' << 8) | 'N')
54
55#define HIDE_CHUNK ((int32) ('H' << 24) | ('I' << 16) | ('D' << 8) | 'E')
56#define UHID_CHUNK ((int32) ('U' << 24) | ('H' << 16) | ('I' << 8) | 'D')
57#define DSTR_CHUNK ((int32) ('D' << 24) | ('S' << 16) | ('T' << 8) | 'R')
58#define CHDE_CHUNK ((int32) ('C' << 24) | ('H' << 16) | ('D' << 8) | 'E')
59#define CUHD_CHUNK ((int32) ('C' << 24) | ('U' << 16) | ('H' << 8) | 'D')
60#define CDST_CHUNK ((int32) ('D' << 24) | ('D' << 16) | ('T' << 8) | 'S')
61
62#define CONV_CHUNK ((int32) ('C' << 24) | ('O' << 16) | ('N' << 8) | 'V')
63#define DECL_CHUNK ((int32) ('D' << 24) | ('E' << 16) | ('C' << 8) | 'L')
64
65#define FALL_CHUNK ((int32) ('F' << 24) | ('A' << 16) | ('L' << 8) | 'L')
66#define LNODE_CHUNK ((int32) ('L' << 24) | ('N' << 16) | ('O' << 8) | 'D')
67#define NODE_CHUNK ((int32) ('N' << 24) | ('O' << 16) | ('D' << 8) | 'E')
68#define ENTRY_CHUNK ((int32) ('E' << 24) | ('T' << 16) | ('R' << 8) | 'Y')
69#define TEXT_CHUNK ((int32) ('T' << 24) | ('E' << 16) | ('X' << 8) | 'T')
70
71//reply
72#define REPLY_CHUNK ((int32) ('R' << 24) | ('P' << 16) | ('L' << 8) | 'Y')
73#define WEIGHT_REPLY_CHUNK ((int32) ('W' << 24) | ('R' << 16) | ('P' << 8) | 'L')
74#define WEIGHT_PREPLY_CHUNK ((int32) ('W' << 24) | ('P' << 16) | ('R' << 8) | 'L')
75#define COND_REPLY_CHUNK ((int32) ('C' << 24) | ('R' << 16) | ('P' << 8) | 'L')
76
77#define MESSAGE_CHUNK ((int32) ('M' << 24) | ('E' << 16) | ('S' << 8) | 'G')
78
79// goto
80#define GOTO_CHUNK ((int32) ('G' << 24) | ('O' << 16) | ('T' << 8) | 'O')
81#define EXIT_GOTO_CHUNK ((int32) ('E' << 24) | ('X' << 16) | ('I' << 8) | 'T')
82#define COND_GOTO_CHUNK ((int32) ('C' << 24) | ('C' << 16) | ('G' << 8) | 'O')
83
84#define COND_EXIT_GOTO_CHUNK ((int32) ('C' << 24) | ('E' << 16) | ('G' << 8) | 'O')
85
86
87struct Conv {
88 int32 chunkSize = 0;
89 char *conv = nullptr;
90 int32 myCNode = 0;
91 int32 exit_now = 0;
92 int32 node_hash = 0;
93
94 int32 mode = 0;
95 int32 c_entry_num = 0;
96 Common::Array<int32 *> _pointers;
97};
98
100 char *text[16];
101 char *snd_files[16];
102 char mesg[1024];
103 char *mesg_snd_file;
104 int num_txt_ents;
105 int player_non_player;
106 int player_choice;
107};
108
109#include "common/pack-start.h" // START STRUCT PACKING
110
112 int32 tag;
113 int32 size;
114} PACKED_STRUCT;
115
117 int32 tag;
118 int32 val;
119 int32 flags;
120 int32 addrIndex; // Index into Conv::_pointers array
121} PACKED_STRUCT;
122
124 int32 tag;
125 int32 val;
126 int32 index;
127} PACKED_STRUCT;
128
130 int32 tag;
131 int32 hash;
132 int32 size;
133 int32 num_entries;
134} PACKED_STRUCT;
135
137 int32 tag;
138 int32 hash;
139 int32 size;
140 int32 entry_num;
141 int32 num_entries;
142} PACKED_STRUCT;
143
145 int32 tag;
146 int32 size;
147 int32 status;
148} PACKED_STRUCT;
149
151 int32 tag;
152 int32 size;
153} PACKED_STRUCT;
154
156 int32 tag;
157 int32 size;
158} PACKED_STRUCT;
159
161 int32 tag;
162 int32 index; // Where the message is located.
163} PACKED_STRUCT;
164
166 int32 tag;
167 int32 op_l;
168 int32 op;
169 int32 op_r;
170 int32 index; // Where the message is located.
171} PACKED_STRUCT;
172
174 int32 tag;
175 int32 num_replies;
176} PACKED_STRUCT;
177
179 int32 weight;
180 int32 index; // Where the message is located.
181} PACKED_STRUCT;
182
184 int32 tag;
185 int32 index; // Where the node is located.
186} PACKED_STRUCT;
187
189 int32 tag;
190 int32 opnd1; // Where the decl is located.
191 int32 op;
192 int32 opnd2; // Integer value.
193 int32 index; // Where the node is located.
194} PACKED_STRUCT;
195
197 int32 tag;
198 int32 index; // Where the entry is located.
199} PACKED_STRUCT;
200
202 int32 tag;
203
204 int32 c_op_l; // Where the decl is located.
205 int32 c_op;
206 int32 c_op_r; // Integer value.
207
208 int32 index; // Where the entry is located.
209} PACKED_STRUCT;
210
212 int32 tag;
213 int32 index; // Where the decl is located.
214 int32 op;
215 int32 opnd1; // Integer value.
216} PACKED_STRUCT;
217
219 int32 tag;
220
221 int32 c_op_l; // Where the decl is located.
222 int32 c_op;
223 int32 c_op_r; // Integer value.
224
225 int32 index; // Where the decl is located.
226 int32 op;
227 int32 opnd1; // Integer value.
228} PACKED_STRUCT;
229
230#include "common/pack-end.h" // END STRUCT PACKING
231
341
342void conv_go(Conv *c);
343
344} // End of namespace M4
345
346#endif
Definition: database.h:28
void set_dlg_rect()
Definition: conv.h:99
Definition: conv.h:87
Definition: conv.h:211
Definition: conv.h:218
Definition: conv.h:188
Definition: conv.h:201
Definition: conv.h:165
Definition: conv.h:111
Definition: conv.h:116
Definition: conv.h:144
Definition: conv.h:123
Definition: conv.h:183
Definition: conv.h:136
Definition: conv.h:155
Definition: conv.h:196
Definition: conv.h:129
Definition: conv.h:160
Definition: conv.h:150
Definition: conv.h:178
Definition: conv.h:173