// Reset the game when loading a save game bool saveGameReset(void) { debug(LOG_MAIN, "saveGameReset"); cdAudio_Stop(); freeAllStructs(); freeAllDroids(); freeAllFeatures(); freeAllFlagPositions(); initMission(); initTransporters(); //free up the gateway stuff? gwShutDown(); intResetScreen(true); intResetPreviousObj(); if (!mapShutdown()) { return false; } //clear out any messages freeMessages(); return true; }
void cdAudio_Close(void) { debug(LOG_SOUND, "called"); cdAudio_Stop(); PlayList_Quit(); music_initialized = false; stopping = true; }
void cdAudio_Close(void) { debug(LOG_SOUND, "called"); cdAudio_Stop(); PlayList_Quit(); #if !defined(WZ_NOSOUND) music_initialized = false; stopping = true; #endif }
// //////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////// // Free up after level specific data has been released but before base data is released // bool stageTwoShutDown(void) { debug(LOG_WZ, "== stageTwoShutDown =="); cdAudio_Stop(); freeAllStructs(); freeAllDroids(); freeAllFeatures(); freeAllFlagPositions(); if (!shutdownScripts()) { return false; } if (!messageShutdown()) { return false; } if (!mechanicsShutdown()) { return false; } if(!ShutdownRadar()) { return false; } interfaceShutDown(); cmdDroidShutDown(); //free up the gateway stuff? gwShutDown(); if (!mapShutdown()) { return false; } return true; }
static bool cdAudio_OpenTrack(const char *filename) { if (!music_initialized) { return false; } debug(LOG_SOUND, "called(%s)", filename); cdAudio_Stop(); if (strncasecmp(filename + strlen(filename) - 4, ".ogg", 4) == 0) { PHYSFS_file *music_file = PHYSFS_openRead(filename); debug(LOG_WZ, "Reading...[directory: %s] %s", PHYSFS_getRealDir(filename), filename); if (music_file == nullptr) { debug(LOG_ERROR, "Failed opening file [directory: %s] %s, with error %s", PHYSFS_getRealDir(filename), filename, WZ_PHYSFS_getLastError()); return false; } cdStream = sound_PlayStreamWithBuf(music_file, music_volume, cdAudio_TrackFinished, filename, bufferSize, buffer_count); if (cdStream == nullptr) { PHYSFS_close(music_file); debug(LOG_ERROR, "Failed creating audio stream for %s", filename); return false; } debug(LOG_SOUND, "successful(%s)", filename); stopping = false; return true; } return false; // unhandled }