Do not define -Dlime-legacy when using Lime hybrid

This commit is contained in:
Joshua Granick
2015-04-06 12:37:08 -07:00
parent b23ddbb2c9
commit 5df7984255
8 changed files with 55 additions and 25 deletions

View File

@@ -7,6 +7,9 @@ public class Lime {
static {
System.loadLibrary("openal");
System.loadLibrary("lime");
::if DEFINE_LIME_HYBRID::
System.loadLibrary("lime-legacy");
::end::
}
public static final int ACTIVATE = 1;

View File

@@ -343,10 +343,10 @@ class Timer {
}
#if lime_legacy
#if (lime_legacy || lime_hybrid)
@:noCompletion public static function __nextWake (limit:Float):Float {
var now = lime_time_stamp () * 1000.0;
var now = getMS ();
var sleep;
for (timer in sRunningTimers) {

View File

@@ -9,10 +9,22 @@
<set name="included" value="1" if="windows || mac || linux || ios || android || blackberry || tizen || firefox || html5 || flash || emscripten" />
<set name="lime-legacy" value="1" if="legacy || lime_legacy" />
<set name="lime-hybrid" value="1" if="hybrid || lime_hybrid" />
<set name="lime-legacy" value="1" if="legacy || lime_legacy" unless="lime-hybrid" />
<section if="web || display">
<unset name="lime-legacy" />
<unset name="lime-hybrid" />
<unset name="legacy" />
<unset name="hybrid" />
</section>
<haxedef name="lime-hybrid" if="lime-hybrid" />
<haxedef name="lime-legacy" if="lime-legacy" />
<include path="legacy/include.xml" if="lime-legacy" unless="setup" />
<include path="legacy/include.xml" if="lime-legacy || lime-hybrid" unless="setup" />
<templatePath name="templates" unless="lime-legacy" />
<sample path="samples" unless="openfl" />

View File

@@ -5,6 +5,10 @@ package org.haxe.lime;
public class Lime {
static {
::if DEFINE_LIME_HYBRID::
System.loadLibrary("openal");
System.loadLibrary("lime");
::end::
System.loadLibrary("lime-legacy");
}

View File

@@ -25,6 +25,6 @@
</section>
<templatePath name="templates" />
<templatePath name="templates" unless="lime-hybrid" />
</extension>

View File

@@ -24,7 +24,7 @@
<unset name="LEGACY_CURL" if="emscripten" />
<set name="LEGACY_SSL" value="1" />
<set name="LEGACY_SSL_EXTRA" value="_ssl" if="LEGACY_SSL" />
<set name="LEGACY_S3D" value="1" />
<!-- <set name="LEGACY_S3D" value="1" /> -->
<set name="LEGACY_OPENAL" value="1" />
<set name="LEGACY_OPENAL" value="1" if="iphone" />
<!-- <set name="LEGACY_CAMERA" value="1" unless="lime" /> -->
@@ -144,6 +144,7 @@
<compilerflag value="-DSDL_OGL" />
<compilerflag value="-DNME_MIXER" unless="LEGACY_OPENAL" />
<compilerflag value="-DNME_SDL2" />
<compilerflag value="-DNME_GLES" unless="windows || mac || linux" />
<file name="${LEGACY_SRC_DIR}/sdl/SDLSound.cpp" unless="LEGACY_OPENAL" />
<file name="${LEGACY_SRC_DIR}/sdl2/SDL2Stage.cpp" />

View File

@@ -882,7 +882,7 @@ class HXProject {
if (StringTools.startsWith (haxeflag, "-lib")) {
Reflect.setField (context, "LIB_" + haxeflag.substr (5).toUpperCase (), "true");
Reflect.setField (context, "LIB_" + StringHelper.formatUppercaseVariable (haxeflag.substr (5)), "true");
}
@@ -1038,7 +1038,7 @@ class HXProject {
#end
Reflect.setField (context, "LIB_" + haxelib.name.toUpperCase (), true);
Reflect.setField (context, "LIB_" + StringHelper.formatUppercaseVariable (haxelib.name), true);
if (name == "nme") {
@@ -1060,11 +1060,11 @@ class HXProject {
if (value == null || value == "") {
Reflect.setField (context, "SET_" + key.toUpperCase (), true);
Reflect.setField (context, "SET_" + StringHelper.formatUppercaseVariable (key), true);
} else {
Reflect.setField (context, "SET_" + key.toUpperCase (), value);
Reflect.setField (context, "SET_" + StringHelper.formatUppercaseVariable (key), value);
}
@@ -1078,13 +1078,13 @@ class HXProject {
compilerFlags.push ("-D " + key);
Reflect.setField (context, "DEFINE_" + key.toUpperCase (), true);
Reflect.setField (context, "DEFINE_" + StringHelper.formatUppercaseVariable (key), true);
} else {
compilerFlags.push ("-D " + key + "=" + value);
Reflect.setField (context, "DEFINE_" + key.toUpperCase (), value);
Reflect.setField (context, "DEFINE_" + StringHelper.formatUppercaseVariable (key), value);
}

View File

@@ -111,6 +111,7 @@ class StringHelper {
public static function formatUppercaseVariable (name:String):String {
var isAlpha = ~/[A-Z0-9]/i;
var variableName = "";
var lastWasUpperCase = false;
@@ -118,6 +119,13 @@ class StringHelper {
var char = name.charAt (i);
if (!isAlpha.match (char)) {
variableName += "_";
lastWasUpperCase = false;
} else {
if (char == char.toUpperCase () && i > 0) {
if (lastWasUpperCase) {
@@ -149,6 +157,8 @@ class StringHelper {
}
}
return variableName;
}