More fixes for the emscripten port.

This commit is contained in:
Martín Lucas Golini
2013-11-09 13:55:44 -03:00
parent c40d8c9549
commit 0045461ec6
4 changed files with 11 additions and 3 deletions

View File

@@ -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

View File

@@ -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 $@

View File

@@ -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 ) );

View File

@@ -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;
}