tmp save
This commit is contained in:
parent
ab934e73ca
commit
9a45d6938c
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1320"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A07A4C241783777C0073F6A7"
|
||||
BuildableName = "libcocos2d iOS.a"
|
||||
BlueprintName = "libcocos2d"
|
||||
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A07A4C241783777C0073F6A7"
|
||||
BuildableName = "libcocos2d iOS.a"
|
||||
BlueprintName = "libcocos2d"
|
||||
ReferencedContainer = "container:cocos2d_libs.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
@ -1,158 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := editor_support_static
|
||||
|
||||
LOCAL_MODULE_FILENAME := libeditorsupport
|
||||
|
||||
LOCAL_ARM_MODE := arm
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
../scripting/js-bindings/manual/jsb_helper.cpp \
|
||||
IOBuffer.cpp \
|
||||
MeshBuffer.cpp \
|
||||
middleware-adapter.cpp \
|
||||
TypedArrayPool.cpp \
|
||||
IOTypedArray.cpp \
|
||||
MiddlewareManager.cpp \
|
||||
../scripting/js-bindings/auto/jsb_cocos2dx_editor_support_auto.cpp
|
||||
|
||||
ifeq ($(USE_PARTICLE),1)
|
||||
LOCAL_SRC_FILES += \
|
||||
particle/ParticleSimulator.cpp \
|
||||
../scripting/js-bindings/auto/jsb_cocos2dx_particle_auto.cpp
|
||||
endif # USE_PARTICLE
|
||||
|
||||
ifeq ($(USE_SPINE),1)
|
||||
LOCAL_SRC_FILES += \
|
||||
spine/Animation.cpp \
|
||||
spine/AnimationState.cpp \
|
||||
spine/AnimationStateData.cpp \
|
||||
spine/Atlas.cpp \
|
||||
spine/AtlasAttachmentLoader.cpp \
|
||||
spine/Attachment.cpp \
|
||||
spine/AttachmentLoader.cpp \
|
||||
spine/AttachmentTimeline.cpp \
|
||||
spine/Bone.cpp \
|
||||
spine/BoneData.cpp \
|
||||
spine/BoundingBoxAttachment.cpp \
|
||||
spine/ClippingAttachment.cpp \
|
||||
spine/ColorTimeline.cpp \
|
||||
spine/Constraint.cpp \
|
||||
spine/ConstraintData.cpp \
|
||||
spine/CurveTimeline.cpp \
|
||||
spine/DeformTimeline.cpp \
|
||||
spine/DrawOrderTimeline.cpp \
|
||||
spine/Event.cpp \
|
||||
spine/EventData.cpp \
|
||||
spine/EventTimeline.cpp \
|
||||
spine/Extension.cpp \
|
||||
spine/IkConstraint.cpp \
|
||||
spine/IkConstraintData.cpp \
|
||||
spine/IkConstraintTimeline.cpp \
|
||||
spine/Json.cpp \
|
||||
spine/LinkedMesh.cpp \
|
||||
spine/MathUtil.cpp \
|
||||
spine/MeshAttachment.cpp \
|
||||
spine/PathAttachment.cpp \
|
||||
spine/PathConstraint.cpp \
|
||||
spine/PathConstraintData.cpp \
|
||||
spine/PathConstraintMixTimeline.cpp \
|
||||
spine/PathConstraintPositionTimeline.cpp \
|
||||
spine/PathConstraintSpacingTimeline.cpp \
|
||||
spine/PointAttachment.cpp \
|
||||
spine/RegionAttachment.cpp \
|
||||
spine/RotateTimeline.cpp \
|
||||
spine/RTTI.cpp \
|
||||
spine/ScaleTimeline.cpp \
|
||||
spine/ShearTimeline.cpp \
|
||||
spine/Skeleton.cpp \
|
||||
spine/SkeletonBinary.cpp \
|
||||
spine/SkeletonBounds.cpp \
|
||||
spine/SkeletonClipping.cpp \
|
||||
spine/SkeletonData.cpp \
|
||||
spine/SkeletonJson.cpp \
|
||||
spine/Skin.cpp \
|
||||
spine/Slot.cpp \
|
||||
spine/SlotData.cpp \
|
||||
spine/SpineObject.cpp \
|
||||
spine/TextureLoader.cpp \
|
||||
spine/Timeline.cpp \
|
||||
spine/TransformConstraint.cpp \
|
||||
spine/TransformConstraintData.cpp \
|
||||
spine/TransformConstraintTimeline.cpp \
|
||||
spine/TranslateTimeline.cpp \
|
||||
spine/Triangulator.cpp \
|
||||
spine/TwoColorTimeline.cpp \
|
||||
spine/Updatable.cpp \
|
||||
spine/VertexAttachment.cpp \
|
||||
spine/VertexEffect.cpp \
|
||||
spine-creator-support/AttachmentVertices.cpp \
|
||||
spine-creator-support/SkeletonAnimation.cpp \
|
||||
spine-creator-support/SkeletonDataMgr.cpp \
|
||||
spine-creator-support/SkeletonRenderer.cpp \
|
||||
spine-creator-support/spine-cocos2dx.cpp \
|
||||
spine-creator-support/VertexEffectDelegate.cpp \
|
||||
spine-creator-support/SkeletonCacheMgr.cpp \
|
||||
spine-creator-support/SkeletonCache.cpp \
|
||||
spine-creator-support/SkeletonCacheAnimation.cpp \
|
||||
spine-creator-support/AttachUtil.cpp \
|
||||
../scripting/js-bindings/manual/jsb_spine_manual.cpp \
|
||||
../scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp
|
||||
endif # USE_SPINE
|
||||
|
||||
ifeq ($(USE_DRAGONBONES),1)
|
||||
LOCAL_SRC_FILES += \
|
||||
dragonbones/animation/Animation.cpp \
|
||||
dragonbones/animation/AnimationState.cpp \
|
||||
dragonbones/animation/BaseTimelineState.cpp \
|
||||
dragonbones/animation/TimelineState.cpp \
|
||||
dragonbones/animation/WorldClock.cpp \
|
||||
dragonbones/armature/Armature.cpp \
|
||||
dragonbones/armature/Bone.cpp \
|
||||
dragonbones/armature/Constraint.cpp \
|
||||
dragonbones/armature/DeformVertices.cpp \
|
||||
dragonbones/armature/Slot.cpp \
|
||||
dragonbones/armature/TransformObject.cpp \
|
||||
dragonbones/core/BaseObject.cpp \
|
||||
dragonbones/core/DragonBones.cpp \
|
||||
dragonbones/event/EventObject.cpp \
|
||||
dragonbones/factory/BaseFactory.cpp \
|
||||
dragonbones/geom/Point.cpp \
|
||||
dragonbones/geom/Transform.cpp \
|
||||
dragonbones/model/AnimationConfig.cpp \
|
||||
dragonbones/model/AnimationData.cpp \
|
||||
dragonbones/model/ArmatureData.cpp \
|
||||
dragonbones/model/BoundingBoxData.cpp \
|
||||
dragonbones/model/CanvasData.cpp \
|
||||
dragonbones/model/ConstraintData.cpp \
|
||||
dragonbones/model/DisplayData.cpp \
|
||||
dragonbones/model/DragonBonesData.cpp \
|
||||
dragonbones/model/SkinData.cpp \
|
||||
dragonbones/model/TextureAtlasData.cpp \
|
||||
dragonbones/model/UserData.cpp \
|
||||
dragonbones/parser/DataParser.cpp \
|
||||
dragonbones/parser/BinaryDataParser.cpp \
|
||||
dragonbones/parser/JSONDataParser.cpp \
|
||||
dragonbones-creator-support/CCArmatureDisplay.cpp \
|
||||
dragonbones-creator-support/CCFactory.cpp \
|
||||
dragonbones-creator-support/CCSlot.cpp \
|
||||
dragonbones-creator-support/CCTextureAtlasData.cpp \
|
||||
dragonbones-creator-support/ArmatureCache.cpp \
|
||||
dragonbones-creator-support/ArmatureCacheMgr.cpp \
|
||||
dragonbones-creator-support/CCArmatureCacheDisplay.cpp \
|
||||
dragonbones-creator-support/AttachUtil.cpp \
|
||||
../scripting/js-bindings/manual/jsb_dragonbones_manual.cpp \
|
||||
../scripting/js-bindings/auto/jsb_cocos2dx_dragonbones_auto.cpp
|
||||
endif # USE_DRAGONBONES
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
|
||||
$(LOCAL_PATH)/.. \
|
||||
$(LOCAL_PATH)/../..
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \
|
||||
$(LOCAL_PATH)/../.. \
|
||||
$(LOCAL_PATH)/../../external/android/$(TARGET_ARCH_ABI)/include/v8 \
|
||||
$(LOCAL_PATH)/../../external/sources/
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
@ -64,14 +64,15 @@ void Application::updateViewSize(int width, int height)
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
void Java_org_cocos2dx_lib_Cocos2dxGLSurfaceView_nativeOnSizeChanged(JNIEnv * env, jobject obj, jint width, jint height) {
|
||||
void Java_org_cocos2dx_lib_Cocos2dxGLSurfaceView_nativeOnSizeChanged(JNIEnv * env, jclass obj, jint width, jint height) {
|
||||
auto inst = Application::getInstance();
|
||||
// nativeOnSizeChanged is firstly called before Application initiating.
|
||||
if (inst != nullptr) {
|
||||
inst->updateViewSize(width, height);
|
||||
}
|
||||
}
|
||||
void Java_org_cocos2dx_lib_Cocos2dxOrientationHelper_nativeOnOrientationChanged(JNIEnv * env, jobject obj, jint rotation) {
|
||||
void Java_org_cocos2dx_lib_Cocos2dxOrientationHelper_nativeOnOrientationChanged(JNIEnv * env,
|
||||
jclass obj, jint rotation) {
|
||||
auto inst = Application::getInstance();
|
||||
// nativeOnSizeChanged is firstly called before Application initiating.
|
||||
if (inst != nullptr) {
|
||||
|
@ -7,10 +7,16 @@ public class CocosJSHelper {
|
||||
private static Context sContext;
|
||||
// Create JNI Function for this
|
||||
private static native void nativeJSInit(final String resourcePath);
|
||||
private static native void initNativeWallet(final String password);
|
||||
|
||||
public static void initJSEnv(Context context) {
|
||||
sContext = context;
|
||||
CocosJSHelper.nativeJSInit("");
|
||||
// 如果要从java代码启动js引擎, 则使用下面代码
|
||||
// CocosJSHelper.nativeJSInit("");
|
||||
}
|
||||
|
||||
public static void initWallet(String password) {
|
||||
CocosJSHelper.initNativeWallet(password);
|
||||
}
|
||||
|
||||
public static Context getContext() {
|
||||
|
@ -130,7 +130,7 @@ namespace
|
||||
|
||||
void cocos_jni_env_init (JNIEnv* env);
|
||||
|
||||
Application* cocos_android_app_init(JNIEnv* env, int width, int height);
|
||||
Application* cocos_android_app_init(int width, int height);
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@ -184,7 +184,7 @@ extern "C"
|
||||
g_width = w;
|
||||
g_height = h;
|
||||
|
||||
g_app = cocos_android_app_init(env, w, h);
|
||||
g_app = cocos_android_app_init(w, h);
|
||||
|
||||
g_isGameFinished = false;
|
||||
ccInvalidateStateCache();
|
||||
@ -523,7 +523,7 @@ extern "C"
|
||||
* CocosJSHelper native functions implementation.
|
||||
***********************************************************/
|
||||
JNIEXPORT void JNICALL JNI_JS_HELPER(nativeJSInit)(JNIEnv *env, jclass clazz, jstring resource_path) {
|
||||
g_app = cocos_android_app_init(env, 1, 1);
|
||||
g_app = cocos_android_app_init(1, 1);
|
||||
se::ScriptEngine* se = se::ScriptEngine::getInstance();
|
||||
// se->addRegisterCallback(setCanvasCallback);
|
||||
|
||||
@ -531,6 +531,15 @@ extern "C"
|
||||
|
||||
g_app->start();
|
||||
}
|
||||
JNIEXPORT void JNICALL JNI_JS_HELPER(initNativeWallet)(JNIEnv *env, jclass clazz, jstring resource_path) {
|
||||
se::Value rval;
|
||||
se::ScriptEngine* se = se::ScriptEngine::getInstance();
|
||||
se::AutoHandleScope hs;
|
||||
std::string coder = "jc.wallet.currentAccount().address";
|
||||
se::ScriptEngine::getInstance()->evalString(coder.c_str(), coder.size(), &rval);
|
||||
// jsb_run_code("jc.wallet.currentAccount().address", &rval);
|
||||
cocos2d::log("\n cpp init wallet: %s \n", &rval);
|
||||
}
|
||||
} // end of extern "C"
|
||||
|
||||
void restartJSVM()
|
||||
|
@ -1001,6 +1001,19 @@ static bool XMLHttpRequest_getResponse(se::State& s)
|
||||
s.rval().setNull();
|
||||
}
|
||||
}
|
||||
else if (xhr->getResponseType() == XMLHttpRequest::ResponseType::BLOB)
|
||||
{
|
||||
const Data& data = xhr->getResponseData();
|
||||
se::HandleObject seObj(se::Object::createArrayBufferObject(data.getBytes(), data.getSize()));
|
||||
if (!seObj.isEmpty())
|
||||
{
|
||||
s.rval().setObject(seObj);
|
||||
}
|
||||
else
|
||||
{
|
||||
s.rval().setNull();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SE_PRECONDITION2(false, false, "Invalid response type");
|
||||
@ -1056,6 +1069,9 @@ static bool XMLHttpRequest_getResponseType(se::State& s)
|
||||
case XMLHttpRequest::ResponseType::JSON:
|
||||
s.rval().setString("json");
|
||||
break;
|
||||
case XMLHttpRequest::ResponseType::BLOB:
|
||||
s.rval().setString("blob");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1091,6 +1107,10 @@ static bool XMLHttpRequest_setResponseType(se::State& s)
|
||||
{
|
||||
xhr->setResponseType(XMLHttpRequest::ResponseType::DOCUMENT);
|
||||
}
|
||||
else if (type == "blob")
|
||||
{
|
||||
xhr->setResponseType(XMLHttpRequest::ResponseType::BLOB);
|
||||
}
|
||||
else
|
||||
{
|
||||
SE_PRECONDITION2(false, false, "The response type isn't supported!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user