| 1148 | } |
| 1149 | |
| 1150 | void zSceneExit(S32 beginReload) |
| 1151 | { |
| 1152 | zScene* s = globals.sceneCur; |
| 1153 | |
| 1154 | zThrown_Reset(); |
| 1155 | zEntPickup_FlushGrabbed(); |
| 1156 | zGridExit(s); |
| 1157 | zSceneForAllBase(zSceneExitSoundIteratorCB, NULL); |
| 1158 | xSndStopAll(~SND_CAT_UI); |
| 1159 | xSndUpdate(); |
| 1160 | iSndWaitForDeadSounds(); |
| 1161 | iSndSceneExit(); |
| 1162 | xSFXEnvironmentalStreamSceneExit(); |
| 1163 | iSndSuspendCD(1); |
| 1164 | iFuncProfileDump(); |
| 1165 | |
| 1166 | RpWorld* world = s->env->geom->world; |
| 1167 | |
| 1168 | xModel_SceneExit(world); |
| 1169 | zFX_SceneExit(world); |
| 1170 | zEntEventAll(NULL, 0, eEventRoomEnd, NULL); |
| 1171 | zEntEventAll(NULL, 0, eEventSceneEnd, NULL); |
| 1172 | |
| 1173 | if (globals.sceneCur->pendingPortal) |
| 1174 | { |
| 1175 | char nextScene[8]; |
| 1176 | char curScene[8]; |
| 1177 | |
| 1178 | strcpy(nextScene, xUtil_idtag2string(globals.sceneCur->pendingPortal->passet->sceneID, 0)); |
| 1179 | strcpy(curScene, xUtil_idtag2string(globals.sceneCur->sceneID, 0)); |
| 1180 | } |
| 1181 | |
| 1182 | // non-matching: two instructions are swapped here... |
| 1183 | gOccludeCount = 0; |
| 1184 | |
| 1185 | if (globals.sceneCur->sceneID != 'MNU3') |
| 1186 | { |
| 1187 | zSceneSave(s, NULL); |
| 1188 | } |
| 1189 | |
| 1190 | zEntPlayerExit(&globals.player.ent); |
| 1191 | zSurfaceExit(); |
| 1192 | zLightDestroyAll(); |
| 1193 | xEntSceneExit(); |
| 1194 | xEntMotionDebugExit(); |
| 1195 | zSceneObjHashtableExit(); |
| 1196 | |
| 1197 | if (s->baseCount[eBaseTypeParticleSystem]) |
| 1198 | { |
| 1199 | zParSys* ps = (zParSys*)s->baseList[eBaseTypeParticleSystem]; |
| 1200 | |
| 1201 | for (U32 i = 0; i < s->baseCount[eBaseTypeParticleSystem]; i++) |
| 1202 | { |
| 1203 | if (xBaseIsValid(&ps[i])) |
| 1204 | { |
| 1205 | xParSysExit(&ps[i]); |
| 1206 | } |
| 1207 | } |
no test coverage detected