comparison Engine/MMT.cpp @ 2509:fc5e83bbafd1

FileExists
author Ritor1
date Thu, 02 Oct 2014 12:23:52 +0600
parents 491f0babd563
children fb1c61a82a55
comparison
equal deleted inserted replaced
2508:491f0babd563 2509:fc5e83bbafd1
1 #define _CRTDBG_MAP_ALLOC 1 #define _CRTDBG_MAP_ALLOC
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <crtdbg.h> 3 #include <crtdbg.h>
4 4 #include <io.h>
5 #define _CRT_SECURE_NO_WARNINGS 5 #define _CRT_SECURE_NO_WARNINGS
6 6
7 #include "MMT.h" 7 #include "MMT.h"
8 #include "GUI/GUIWindow.h" 8 #include "GUI/GUIWindow.h"
9 9
17 #include "Engine/ErrorHandling.h" 17 #include "Engine/ErrorHandling.h"
18 #include "Media/Video/Bink_Smacker.h" 18 #include "Media/Video/Bink_Smacker.h"
19 #include "Game.h" 19 #include "Game.h"
20 #include "Log.h" 20 #include "Log.h"
21 21
22 bool FileExists(const char *fname)
23 {
24 return access(fname, 0) != -1;
25 }
22 26
23 void ShowLogoVideo() 27 void ShowLogoVideo()
24 { 28 {
25 RGBTexture tex; // [sp+Ch] [bp-30h]@1 29 RGBTexture tex; // [sp+Ch] [bp-30h]@1
26 unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8 30 unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8
84 { 88 {
85 if (!bNoSound && pAudioPlayer->hAILRedbook ) 89 if (!bNoSound && pAudioPlayer->hAILRedbook )
86 { 90 {
87 if ( use_music_folder ) 91 if ( use_music_folder )
88 { 92 {
93 if (!FileExists("Music\\14.mp3"))
94 {
95 Log::Warning(L"File 14.mp3 in Music\\ folder not found");
96 return;
97 }
89 PlayAudio(L"Music\\14.mp3"); 98 PlayAudio(L"Music\\14.mp3");
90 alSourcef (mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]); 99 alSourcef (mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
91 } 100 }
92 else 101 else
93 { 102 {