diff --git a/premake4.lua b/premake4.lua index 579b2108b..6f8013a35 100644 --- a/premake4.lua +++ b/premake4.lua @@ -328,7 +328,7 @@ function build_link_configuration( package_name, use_ee_icon ) package_name ~= "eepp-physics" and package_name ~= "eepp-vbo-fbo-batch" ) then - linkoptions { "--preload-file ../../assets@/" } + linkoptions { "--preload-file assets/" } end set_ios_config() @@ -353,6 +353,8 @@ function generate_os_links() multiple_insert( os_links, { "openal", "GL" } ) elseif os.is_real("ios") then multiple_insert( os_links, { "OpenGLES.framework", "OpenAL.framework", "AudioToolbox.framework", "CoreAudio.framework", "Foundation.framework", "CoreFoundation.framework", "UIKit.framework", "QuartzCore.framework", "CoreGraphics.framework" } ) + elseif os.is_real("emscripten") then + multiple_insert( os_links, { "openal" } ) end end diff --git a/projects/emscripten/make.sh b/projects/emscripten/make.sh index af9becf0d..92a6b3ac3 100755 --- a/projects/emscripten/make.sh +++ b/projects/emscripten/make.sh @@ -2,5 +2,7 @@ cd $(dirname "$0") premake4 --file=../../premake4.lua --with-gles1 --with-gles2 --with-static-eepp --with-static-freetype --platform=emscripten --with-backend=SDL gmake cd ../../make/emscripten/ +#mkdir -p data +ln -sf ../../assets/ ./ sed -i 's/-rcs/rcs/g' *.make emmake make $@ diff --git a/src/eepp/audio/caudiodevice.cpp b/src/eepp/audio/caudiodevice.cpp index 46aed2843..67a3ba427 100755 --- a/src/eepp/audio/caudiodevice.cpp +++ b/src/eepp/audio/caudiodevice.cpp @@ -23,10 +23,11 @@ cAudioDevice::cAudioDevice() { // Initialize the listener, located at the origin and looking along the Z axis #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN ALCheck( alListenerf( AL_GAIN, 1.f ) ); - - ALCheck( alListener3f( AL_POSITION, 0.f, 0.f, 0.f ) ); #endif + float Position[] = {0.f, 0.f, 0.f}; + ALCheck( alListenerfv( AL_POSITION, Position ) ); + float Orientation[] = {0.f, 0.f, -1.f, 0.f, 1.f, 0.f}; ALCheck( alListenerfv( AL_ORIENTATION, Orientation ) ); diff --git a/src/eepp/audio/csound.cpp b/src/eepp/audio/csound.cpp index 3dff064da..244eb6483 100755 --- a/src/eepp/audio/csound.cpp +++ b/src/eepp/audio/csound.cpp @@ -131,7 +131,10 @@ float cSound::Volume() const { eeVector3ff cSound::Position() const { eeVector3ff Position; + + #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN ALCheck( alGetSource3f( mSource, AL_POSITION, &Position.x, &Position.y, &Position.z ) ); + #endif return Position; }