MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / load_wait_context

Function load_wait_context

src/SB/Game/zTalkBox.cpp:193–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 }
192
193 static void load_wait_context(wait_context& c, const xtextbox::tag_entry_list& el)
194 {
195 static S32 v[32];
196
197 c.reset_type();
198 c.delay = 0.0f;
199
200 xtextbox::tag_entry* e = xtextbox::find_entry(el, substr::create("wait", 4));
201
202 if (e && xtextbox::read_list(*e, &c.delay, 1) == 1)
203 {
204 c.type.time = true;
205 }
206
207 xtextbox::tag_entry* prompt = xtextbox::find_entry(el, substr::create("prompt", 6));
208
209 if (prompt)
210 {
211 c.type.prompt = true;
212 if (prompt->op == '=' && prompt->args_size == 1 &&
213 icompare(*prompt->args, substr::create("yesno", 5)) == 0)
214 {
215 c.query = Q_YESNO;
216 }
217 else
218 {
219 c.query = Q_SKIP;
220 }
221 }
222
223 e = xtextbox::find_entry(el, substr::create("sound", 5));
224 c.type.sound = (e != NULL);
225
226 e = xtextbox::find_entry(el, substr::create("event", 5));
227 if (e)
228 {
229 c.type.event = true;
230 U32 r = xtextbox::read_list(*e, v, 32);
231 if (r == 0)
232 {
233 c.event_mask = -1;
234 }
235 else if (e->op == '=')
236 {
237 for (U32 i = 0; i < r; i++)
238 {
239 if ((U32)v[i] < 32)
240 {
241 c.event_mask |= (1 << v[i]);
242 }
243 }
244 if (c.event_mask & 1)
245 {
246 c.event_mask = -1;
247 }
248 }
249 }
250 e = xtextbox::find_entry(el, substr::create("need", 4));

Callers 2

parse_tag_auto_waitFunction · 0.70
parse_tag_waitFunction · 0.70

Calls 6

find_entryFunction · 0.85
read_listFunction · 0.85
reset_typeMethod · 0.80
read_boolFunction · 0.70
createFunction · 0.50
icompareFunction · 0.50

Tested by

no test coverage detected