mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-05 18:10:09 +03:00
OpenAL + Android
This commit is contained in:
committed by
iProgramInCpp
parent
68166a3c36
commit
93dc4e934e
@@ -10,9 +10,19 @@ add_library(reminecraftpe-openal STATIC
|
||||
target_link_libraries(reminecraftpe-openal PUBLIC reminecraftpe-core)
|
||||
|
||||
# OpenAL
|
||||
if(EMSCRIPTEN)
|
||||
if(ANDROID)
|
||||
# Use Vendored OpenAL
|
||||
set(ALSOFT_UTILS FALSE CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_EXAMPLES FALSE CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_TESTS FALSE CACHE BOOL "" FORCE)
|
||||
set(ALSOFT_REQUIRE_OPENSL TRUE CACHE BOOL "" FORCE)
|
||||
add_subdirectory(../../thirdparty/OpenAL openal EXCLUDE_FROM_ALL)
|
||||
target_link_libraries(reminecraftpe-openal PUBLIC OpenAL::OpenAL)
|
||||
elseif(EMSCRIPTEN)
|
||||
# Use Emscripten's OpenAL
|
||||
target_link_libraries(reminecraftpe-openal PUBLIC openal)
|
||||
else()
|
||||
# Use System ZLib
|
||||
find_library(OPENAL_LIBRARY NAMES openal REQUIRED)
|
||||
target_link_libraries(reminecraftpe-openal PUBLIC "${OPENAL_LIBRARY}")
|
||||
endif()
|
||||
|
||||
@@ -55,10 +55,8 @@ add_subdirectory(../../source source)
|
||||
target_link_libraries(reminecraftpe reminecraftpe-core)
|
||||
|
||||
# OpenAL
|
||||
if(NOT ANDROID)
|
||||
add_subdirectory(../openal openal)
|
||||
target_link_libraries(reminecraftpe reminecraftpe-openal)
|
||||
endif()
|
||||
add_subdirectory(../openal openal)
|
||||
target_link_libraries(reminecraftpe reminecraftpe-openal)
|
||||
|
||||
# stb_image (If Needed)
|
||||
if(NOT EMSCRIPTEN)
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
|
||||
#include "common/Utils.hpp"
|
||||
|
||||
#ifndef ANDROID
|
||||
#include "SoundSystemAL.hpp"
|
||||
#endif
|
||||
|
||||
void AppPlatform_sdl_base::_init(std::string storageDir, SDL_Window *window)
|
||||
{
|
||||
@@ -58,11 +56,7 @@ void AppPlatform_sdl_base::initSoundSystem()
|
||||
{
|
||||
if (!m_pSoundSystem)
|
||||
{
|
||||
#ifndef ANDROID
|
||||
m_pSoundSystem = new SoundSystemAL();
|
||||
#else
|
||||
m_pSoundSystem = new SoundSystem();
|
||||
#endif
|
||||
LOG_I("Initializing OpenAL SoundSystem...");
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user