| 1403 | } |
| 1404 | |
| 1405 | void LoadGameLevel(BOOL firstflag, int lvldir) |
| 1406 | { |
| 1407 | int i, j; |
| 1408 | BOOL visited; |
| 1409 | |
| 1410 | if (setseed) |
| 1411 | glSeedTbl[currlevel] = setseed; |
| 1412 | |
| 1413 | music_stop(); |
| 1414 | SetCursor_(CURSOR_HAND); |
| 1415 | SetRndSeed(glSeedTbl[currlevel]); |
| 1416 | IncProgress(); |
| 1417 | MakeLightTable(); |
| 1418 | LoadLvlGFX(); |
| 1419 | IncProgress(); |
| 1420 | |
| 1421 | if (firstflag) { |
| 1422 | InitInv(); |
| 1423 | InitItemGFX(); |
| 1424 | InitQuestText(); |
| 1425 | |
| 1426 | for (i = 0; i < gbMaxPlayers; i++) |
| 1427 | InitPlrGFXMem(i); |
| 1428 | |
| 1429 | InitStores(); |
| 1430 | InitAutomapOnce(); |
| 1431 | InitHelp(); |
| 1432 | } |
| 1433 | |
| 1434 | SetRndSeed(glSeedTbl[currlevel]); |
| 1435 | |
| 1436 | if (leveltype == DTYPE_TOWN) |
| 1437 | SetupTownStores(); |
| 1438 | |
| 1439 | IncProgress(); |
| 1440 | InitAutomap(); |
| 1441 | |
| 1442 | if (leveltype != DTYPE_TOWN && lvldir != 4) { |
| 1443 | InitLighting(); |
| 1444 | InitVision(); |
| 1445 | } |
| 1446 | |
| 1447 | InitLevelMonsters(); |
| 1448 | IncProgress(); |
| 1449 | |
| 1450 | if (!setlevel) { |
| 1451 | CreateLevel(lvldir); |
| 1452 | IncProgress(); |
| 1453 | FillSolidBlockTbls(); |
| 1454 | SetRndSeed(glSeedTbl[currlevel]); |
| 1455 | |
| 1456 | if (leveltype != DTYPE_TOWN) { |
| 1457 | GetLevelMTypes(); |
| 1458 | InitThemes(); |
| 1459 | LoadAllGFX(); |
| 1460 | } else { |
| 1461 | IncProgress(); |
| 1462 | IncProgress(); |
no test coverage detected