Skip to content

Commit

Permalink
Emscripten fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed Jun 23, 2017
1 parent 0842c59 commit 44020ad
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
38 changes: 21 additions & 17 deletions include.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@

<set name="lime" />

<haxedef name="native" if="cpp || neko || nodejs || cs" />
<set name="native" if="cpp || neko || nodejs || cs" />
<define name="native" if="cpp || neko || nodejs || cs" />
<define name="howlerjs" if="html5" />

<haxedef name="howlerjs" if="html5" />
<set name="howlerjs" if="html5" />
<define name="lime-html5" if="html5" />
<define name="lime-native" if="native" />
<define name="lime-cffi" if="native" />
<define name="lime-vorbis" if="native" />

<haxedef name="lime-html5" if="html5" />
<haxedef name="lime-native" if="native" />
<haxedef name="lime-cffi" if="native" />
<haxedef name="lime-vorbis" if="native" />

<haxedef name="no-typedarray-inline" if="cs" />
<define name="no-typedarray-inline" if="cs" />
<haxedef name="no-compilation" />

<templatePath name="templates" />
Expand Down Expand Up @@ -64,16 +61,23 @@
<dependency path="dependencies/angle/libegl.dll" if="windows angle" unless="static_link" />
<dependency path="dependencies/angle/libglesv2.dll" if="windows angle" unless="static_link" />

<haxedef name="native-trace" if="flash" unless="haxe-trace || haxetrace" />
<haxedef name="MACOSX_DEPLOYMENT_TARGET" value="10.6" if="mac" unless="MACOSX_DEPLOYMENT_TARGET" />
<define name="native-trace" if="flash" unless="haxe-trace || haxetrace" />
<define name="MACOSX_DEPLOYMENT_TARGET" value="10.6" if="mac" unless="MACOSX_DEPLOYMENT_TARGET" />

<architecture name="armv7" if="android" />

<haxedef name="lime-cairo" unless="flash || html5" />
<haxedef name="lime-curl" unless="lime-console || emscripten || flash || html5" />
<haxedef name="lime-opengl" unless="lime-console || flash" />
<haxedef name="lime-openal" unless="lime-console || static_link || flash || html5" />
<haxedef name="lime-openal" if="emscripten" />
<define name="lime-cairo" unless="flash || html5" />
<define name="lime-curl" unless="lime-console || emscripten || flash || html5" />
<define name="lime-opengl" unless="lime-console || flash" />
<define name="lime-openal" unless="lime-console || static_link || flash || html5" />
<define name="lime-openal" if="emscripten" />

<section if="emscripten">

<dependency name="pthread" />
<dependency name="openal" if="lime-openal" />

</section>

<!-- TODO: Fix inheritance with separate modules -->

Expand Down
3 changes: 3 additions & 0 deletions lime/_backend/native/NativeAudioSource.hx
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,13 @@ class NativeAudioSource {

public function getPosition ():Vector4 {

#if !emscripten
var value = AL.getSource3f (handle, AL.POSITION);
position.x = value[0];
position.y = value[1];
position.z = value[2];
#end

return position;

}
Expand Down
11 changes: 11 additions & 0 deletions lime/tools/platforms/EmscriptenPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,20 @@ class EmscriptenPlatform extends PlatformTarget {

args.push ("-s");
args.push ("NO_EXIT_RUNTIME=1");

args.push ("-s");
args.push ("USE_SDL=2");

for (dependency in project.dependencies) {

if (dependency.name != "") {

args.push ("-l" + dependency.name);

}

}

if (project.targetFlags.exists ("final")) {

args.push ("-s");
Expand Down
5 changes: 3 additions & 2 deletions project/Build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/openal/include/" unless="emscripten" />
<compilerflag value="-DLIME_OPENAL" />
<compilerflag value="-DLIME_OPENALSOFT" if="LIME_OPENALSOFT" />
<compilerflag value="-DAL_LIBTYPE_STATIC=1" />
<compilerflag value="-DAL_ALEXT_PROTOTYPES" />
<compilerflag value="-DAL_LIBTYPE_STATIC=1" if="LIME_OPENALSOFT" />
<compilerflag value="-DAL_ALEXT_PROTOTYPES" if="LIME_OPENALSOFT" />

<file name="src/media/openal/OpenALBindings.cpp" />

Expand Down Expand Up @@ -437,6 +437,7 @@
<lib name="-lGLESv2" />

</section>

</section>

</target>
Expand Down

0 comments on commit 44020ad

Please sign in to comment.