From 4a93bea96248c11fee6d69b111c6bd339f38db51 Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 12 Mar 2022 16:43:32 +0800 Subject: [PATCH] Fix MSVC 2015 build --- lib/graphics_engine/src/ge_vulkan_driver.cpp | 1 + src/audio/music_manager.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/graphics_engine/src/ge_vulkan_driver.cpp b/lib/graphics_engine/src/ge_vulkan_driver.cpp index a2580d7ac..8d908cd52 100644 --- a/lib/graphics_engine/src/ge_vulkan_driver.cpp +++ b/lib/graphics_engine/src/ge_vulkan_driver.cpp @@ -3,6 +3,7 @@ #ifdef _IRR_COMPILE_WITH_VULKAN_ const unsigned int MAX_FRAMES_IN_FLIGHT = 2; #include "SDL_vulkan.h" +#include #include #include #include diff --git a/src/audio/music_manager.cpp b/src/audio/music_manager.cpp index 73d09cc37..c344a0db6 100644 --- a/src/audio/music_manager.cpp +++ b/src/audio/music_manager.cpp @@ -164,7 +164,7 @@ void MusicManager::addMusicToTracks() */ void MusicManager::startMusic() { - if (m_current_music && UserConfigParams::m_music) + if (m_current_music.load() != NULL && UserConfigParams::m_music) SFXManager::get()->queue(SFXManager::SFX_MUSIC_START, m_current_music); } // startMusic @@ -202,7 +202,7 @@ void MusicManager::startMusic(MusicInformation* mi, bool start_right_now) */ void MusicManager::stopMusic() { - if (m_current_music) + if (m_current_music.load() != NULL) SFXManager::get()->queue(SFXManager::SFX_MUSIC_STOP, m_current_music); } // stopMusic @@ -211,7 +211,7 @@ void MusicManager::stopMusic() */ void MusicManager::pauseMusic() { - if (m_current_music) + if (m_current_music.load() != NULL) SFXManager::get()->queue(SFXManager::SFX_MUSIC_PAUSE, m_current_music); } // pauseMusic @@ -220,7 +220,7 @@ void MusicManager::pauseMusic() */ void MusicManager::resumeMusic() { - if (m_current_music) + if (m_current_music.load() != NULL) SFXManager::get()->queue(SFXManager::SFX_MUSIC_RESUME, m_current_music); } // resumeMusic @@ -229,7 +229,7 @@ void MusicManager::resumeMusic() */ void MusicManager::switchToFastMusic() { - if (m_current_music) + if (m_current_music.load() != NULL) SFXManager::get()->queue(SFXManager::SFX_MUSIC_SWITCH_FAST, m_current_music); } // switchToFastMusic @@ -241,7 +241,7 @@ void MusicManager::switchToFastMusic() */ void MusicManager::setTemporaryVolume(float gain) { - if (m_current_music) + if (m_current_music.load() != NULL) SFXManager::get()->queue(SFXManager::SFX_MUSIC_SET_TMP_VOLUME, m_current_music, gain); } // setTemporaryVolume @@ -251,7 +251,7 @@ void MusicManager::setTemporaryVolume(float gain) */ void MusicManager::resetTemporaryVolume() { - if (m_current_music) + if (m_current_music.load() != NULL) SFXManager::get()->queue(SFXManager::SFX_MUSIC_DEFAULT_VOLUME, m_current_music); } // resetTemporaryVolume @@ -268,7 +268,7 @@ void MusicManager::setMasterMusicVolume(float gain) gain = 0.0f; m_master_gain = gain; - if (m_current_music) + if (m_current_music.load() != NULL) { // Sets the music volume to m_master_gain SFXManager::get()->queue(SFXManager::SFX_MUSIC_DEFAULT_VOLUME,