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

Function zUI_ParseINI

src/SB/Game/zUI.cpp:1259–1315  ·  view source on GitHub ↗

This function only matches when using string literals for some reason. Need to wait until all strings are decompiled.

Source from the content-addressed store, hash-verified

1257// This function only matches when using string literals for some reason.
1258// Need to wait until all strings are decompiled.
1259void zUI_ParseINI(xIniFile* ini)
1260{
1261 char itemName[16];
1262 char *value, *tok, *ltok;
1263
1264 strcpy(itemName, "Menu00");
1265
1266 for (U32 i = 0; i < WORLD_COUNT; i++)
1267 {
1268 U32 j;
1269
1270 if (++itemName[5] > '9')
1271 {
1272 itemName[5] = '0';
1273 itemName[4]++;
1274 }
1275
1276 value = xIniGetString(ini, itemName, NULL);
1277
1278 if (!value)
1279 {
1280 sWorld[i].worldPrefix[0] = 'H';
1281 sWorld[i].worldPrefix[1] = 'B';
1282
1283 j = 0;
1284 }
1285 else
1286 {
1287 tok = xStrTok(value, " ", &ltok);
1288
1289 sWorld[i].worldPrefix[0] = tok[0];
1290 sWorld[i].worldPrefix[1] = tok[1];
1291
1292 j = 0;
1293
1294 tok = xStrTok(NULL, " ", &ltok);
1295
1296 while (tok)
1297 {
1298 sWorld[i].task[j].levelSuffix[0] = tok[0];
1299 sWorld[i].task[j].levelSuffix[1] = tok[1];
1300
1301 tok = xStrTok(NULL, " ", &ltok);
1302
1303 j++;
1304 }
1305 }
1306
1307 while (j < sWorld[i].numTasks)
1308 {
1309 sWorld[i].task[j].levelSuffix[0] = '0';
1310 sWorld[i].task[j].levelSuffix[1] = '0';
1311
1312 j++;
1313 }
1314 }
1315}
1316

Callers

nothing calls this directly

Calls 2

xIniGetStringFunction · 0.85
xStrTokFunction · 0.50

Tested by

no test coverage detected