| 104 | //--------------------------------------------------------------------------- |
| 105 | |
| 106 | uint8_t LoadLevel(MapRecord* map) |
| 107 | { |
| 108 | if (map->gameflags & LEVEL_EX_COUNTDOWN) |
| 109 | { |
| 110 | lCountDown = 81000; |
| 111 | nAlarmTicks = 30; |
| 112 | nRedTicks = 0; |
| 113 | nClockVal = 0; |
| 114 | nEnergyTowers = 0; |
| 115 | } |
| 116 | |
| 117 | // init stuff |
| 118 | { |
| 119 | StopAllSounds(); |
| 120 | Level.clearStats(); |
| 121 | nFreeze = 0; |
| 122 | pSpiritSprite = nullptr; |
| 123 | PlayClock = 0; |
| 124 | memset(Counters, 0, sizeof(Counters)); |
| 125 | |
| 126 | InitQueens(); |
| 127 | InitRats(); |
| 128 | InitBullets(); |
| 129 | InitWeapons(); |
| 130 | InitSnakes(); |
| 131 | InitLights(); |
| 132 | ClearAutomap(); |
| 133 | InitObjects(); |
| 134 | InitPushBlocks(); |
| 135 | InitPlayer(); |
| 136 | InitItems(); |
| 137 | |
| 138 | if (map->gameflags & LEVEL_EX_COUNTDOWN) { |
| 139 | InitEnergyTile(); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | if (map->gameflags & LEVEL_EX_ALTSOUND) |
| 144 | { |
| 145 | nSwitchSound = 35; |
| 146 | nStoneSound = 23; |
| 147 | nElevSound = 51; |
| 148 | nStopSound = 35; |
| 149 | } |
| 150 | else |
| 151 | { |
| 152 | nSwitchSound = 33; |
| 153 | nStoneSound = 23; |
| 154 | nElevSound = 23; |
| 155 | nStopSound = 66; |
| 156 | } |
| 157 | |
| 158 | sectortype* initsect; |
| 159 | SpawnSpriteDef spawned; |
| 160 | DVector3 initpos; |
| 161 | int16_t mapang; |
| 162 | loadMap(currentLevel->fileName.GetChars(), 0, &initpos, &mapang, &initsect, spawned); |
| 163 | auto actors = spawnactors(spawned); |
no test coverage detected