Mercurial > mm7
diff Engine/MMT.cpp @ 2509:fc5e83bbafd1
FileExists
author | Ritor1 |
---|---|
date | Thu, 02 Oct 2014 12:23:52 +0600 |
parents | 491f0babd563 |
children | fb1c61a82a55 |
line wrap: on
line diff
--- a/Engine/MMT.cpp Thu Oct 02 11:52:31 2014 +0600 +++ b/Engine/MMT.cpp Thu Oct 02 12:23:52 2014 +0600 @@ -1,7 +1,7 @@ #define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> - +#include <io.h> #define _CRT_SECURE_NO_WARNINGS #include "MMT.h" @@ -19,6 +19,10 @@ #include "Game.h" #include "Log.h" +bool FileExists(const char *fname) +{ + return access(fname, 0) != -1; +} void ShowLogoVideo() { @@ -86,6 +90,11 @@ { if ( use_music_folder ) { + if (!FileExists("Music\\14.mp3")) + { + Log::Warning(L"File 14.mp3 in Music\\ folder not found"); + return; + } PlayAudio(L"Music\\14.mp3"); alSourcef (mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]); }