Skip to content

Commit

Permalink
Add some JS_PRIME experimental code. Drop linux32 and mac32 builds by…
Browse files Browse the repository at this point in the history
… default
  • Loading branch information
hughsando committed Mar 24, 2017
1 parent d210079 commit 2d7cd58
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"tags": [ "cpp", "neko", "nme", "opengl", "sdl", "android", "ios" ],
"description": "NME provides a backend for native iOS, Android, Windows, Mac and Linux applications, using a Flash inspired API",
"version": "6.0.0",
"binaryversion": "96",
"binaryversion": "97",
"releasenote": "see Changes.md",
"contributors": [ "gamehaxe" ],
"dependencies": {}
Expand Down
Binary file removed ndll/Emscripten/libfreetype.a
Binary file not shown.
9 changes: 7 additions & 2 deletions project/ToolkitBuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<set name="PLATFORM" value="android-21" if="HXCPP_ARM64" />
<set name="HXCPP_CPP11" value="1" />

<set name="exe_link" value="1" if="HXCPP_JS_PRIME" />

<include name="${HXCPP}/build-tool/BuildCommon.xml"/>
<!--
Expand Down Expand Up @@ -373,13 +374,13 @@

<set name="target-id" value="NDLL" unless="NME_STATIC_LINK" />
<set name="target-id" value="nme-target" if="NME_STATIC_LINK" />
<set name="target-id" value="exe" if="HXCPP_JS_PRIME" />

<set name="NME_SUFFIX" value="${HX_TARGET_SUFFIX}" if="HX_TARGET_SUFFIX" />
<set name="NME_SUFFIX" value="${LIBSUFFIX}" unless="HX_TARGET_SUFFIX" />

<set name="HXCPP_LINK_NO_ZLIB" value="1" />


<target id="${target-id}" output="${LIBPREFIX}nme${NME_SUFFIX}" tool="linker" toolid="${STD_MODULE_LINK}">
<outdir name="${OUT_DIR}/${BINDIR}" />

Expand Down Expand Up @@ -413,6 +414,7 @@
<section unless="static_link">
<ext value=".so" />
<ext value=".ndll" if="windows || mac || linux" />
<ext value=".js" if="HXCPP_JS_PRIME" />


<section if="NME_NATIVE_SDL_SYSTEM" >
Expand Down Expand Up @@ -492,9 +494,12 @@

</target>

<target id="default" unless="NME_STATIC_LINK" >
<target id="default" unless="NME_STATIC_LINK || exe_link" >
<target id="NDLL"/>
</target>

<target id="default" if="HXCPP_JS_PRIME" >
<target id="exe"/>
</target>

</xml>
18 changes: 10 additions & 8 deletions project/src/common/ExternalInterface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#ifndef STATIC_LINK
#define IMPLEMENT_API
#elif defined(HXCPP_JS_PRIME)
#define IMPLEMENT_API
#endif

#if defined(HX_WINDOWS) || defined(HX_MACOS) || defined(HX_LINUX)
Expand All @@ -9,6 +11,7 @@




#ifdef ANDROID
#include <android/log.h>
#endif
Expand Down Expand Up @@ -746,16 +749,16 @@ DEFINE_PRIM(nme_set_resource_factory,1);



ByteArray::ByteArray(int inSize)
ByteArray::ByteArray(int inSize) :
mValue(val_call1(gByteArrayCreate->get(), alloc_int(inSize) ))
{
mValue = val_call1(gByteArrayCreate->get(), alloc_int(inSize) );
}

ByteArray::ByteArray() : mValue(0) { }

ByteArray::ByteArray(const QuickVec<uint8> &inData)
: mValue(val_call1(gByteArrayCreate->get(), alloc_int(inData.size()) ))
{
mValue = val_call1(gByteArrayCreate->get(), alloc_int(inData.size()) );
uint8 *bytes = Bytes();
if (bytes)
memcpy(bytes, &inData[0], inData.size() );
Expand Down Expand Up @@ -818,14 +821,11 @@ bool ByteArray::LittleEndian()
}


ByteArray::ByteArray(const char *inResourceName)
ByteArray::ByteArray(const char *inResourceName) : mValue(val_null)
{
mValue = val_null;
if (gResourceFactory)
{
mValue = val_call1(gResourceFactory->get(),alloc_string(inResourceName));
if (val_is_null(mValue))
mValue = 0;
}
}

Expand Down Expand Up @@ -1760,11 +1760,12 @@ DEFINE_PRIM(nme_stage_get_normal_orientation, 0);

// --- StageVideo ----------------------------------------------------------------------

StageVideo::StageVideo() : mOwner(0) { }
StageVideo::StageVideo() : mOwner(val_null) { }
void StageVideo::setOwner(value inOwner) { mOwner.set(inOwner); }

value nme_sv_create(value inStage, value inOwner)
{
#ifndef HXCPP_JS_PRIME
Stage *stage;
if (AbstractToObject(inStage,stage))
{
Expand All @@ -1774,6 +1775,7 @@ value nme_sv_create(value inStage, value inOwner)
return ObjectToAbstract(video);
}
}
#endif
return alloc_null();
}
DEFINE_PRIM(nme_sv_create, 2);
Expand Down

0 comments on commit 2d7cd58

Please sign in to comment.