コード例 #1
0
ファイル: init.cpp プロジェクト: kerbys/warzone2100
// 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;
}
コード例 #2
0
ファイル: cdaudio.cpp プロジェクト: Warzone2100/warzone2100
void cdAudio_Close(void)
{
	debug(LOG_SOUND, "called");
	cdAudio_Stop();
	PlayList_Quit();

	music_initialized = false;
	stopping = true;
}
コード例 #3
0
ファイル: cdaudio.cpp プロジェクト: ArtemusRus/warzone2100
void cdAudio_Close(void)
{
	debug(LOG_SOUND, "called");
	cdAudio_Stop();
	PlayList_Quit();

#if !defined(WZ_NOSOUND)
	music_initialized = false;
	stopping = true;
#endif
}
コード例 #4
0
ファイル: init.cpp プロジェクト: argit/warzone2100
// ////////////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////////
// 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;
}
コード例 #5
0
ファイル: cdaudio.cpp プロジェクト: Warzone2100/warzone2100
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
}