初始化

This commit is contained in:
SmallMain
2022-06-25 00:23:03 +08:00
commit ef0589e8e5
2264 changed files with 617829 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocos2d_simulator_static
LOCAL_MODULE_FILENAME := libsimulator
LOCAL_SRC_FILES := \
../lib/protobuf-lite/google/protobuf/io/coded_stream.cc \
../lib/protobuf-lite/google/protobuf/stubs/common.cc \
../lib/protobuf-lite/google/protobuf/extension_set.cc \
../lib/protobuf-lite/google/protobuf/generated_message_util.cc \
../lib/protobuf-lite/google/protobuf/message_lite.cc \
../lib/protobuf-lite/google/protobuf/stubs/once.cc \
../lib/protobuf-lite/google/protobuf/stubs/atomicops_internals_x86_gcc.cc \
../lib/protobuf-lite/google/protobuf/repeated_field.cc \
../lib/protobuf-lite/google/protobuf/wire_format_lite.cc \
../lib/protobuf-lite/google/protobuf/io/zero_copy_stream.cc \
../lib/protobuf-lite/google/protobuf/io/zero_copy_stream_impl_lite.cc \
../lib/protobuf-lite/google/protobuf/stubs/stringprintf.cc \
../lib/runtime/ConnectWaitLayer.cpp \
../lib/runtime/ConsoleCommand.cpp \
../lib/runtime/FileServer.cpp \
../lib/runtime/Landscape_png.cpp \
../lib/runtime/PlayDisable_png.cpp \
../lib/runtime/PlayEnable_png.cpp \
../lib/runtime/Portrait_png.cpp \
../lib/runtime/Protos.pb.cc \
../lib/runtime/Runtime.cpp \
../lib/runtime/RuntimeProtocol.cpp \
../lib/runtime/Shine_png.cpp \
../lib/runtime/ConfigParser.cpp \
../lib/runtime/VisibleRect.cpp \
../lib/ProjectConfig/ProjectConfig.cpp \
../lib/ProjectConfig/SimulatorConfig.cpp \
hellolua/Runtime_android.cpp
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../lib $(LOCAL_PATH)/../lib/protobuf-lite
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../lib $(LOCAL_PATH)/../lib/protobuf-lite
LOCAL_STATIC_LIBRARIES := cocos2dx_static
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,53 @@
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated engine source code (the "Software"), a limited,
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
to use Cocos Creator solely to develop games on your target platforms. You shall
not use Cocos Creator software for developing other software or tools that's
used for developing games. You are not granted to publish, distribute,
sublicense, and/or sell copies of Cocos Creator.
The software or tools in this License Agreement are licensed, not sold.
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include <jni.h>
#include <android/log.h>
#include "jni/JniHelper.h"
#include <string>
#include <vector>
using namespace std;
using namespace cocos2d;
static std::string ACTIVITY_PATH("org/cocos2dx/lua/AppActivity");
void setActivityPathForAndroid(const std::string& path)
{
ACTIVITY_PATH = path;
}
string getIPAddress()
{
JniMethodInfo t;
string IPAddress("");
if (JniHelper::getStaticMethodInfo(t, ACTIVITY_PATH.c_str(), "getLocalIpAddress", "()Ljava/lang/String;")) {
jstring str = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID);
t.env->DeleteLocalRef(t.classID);
IPAddress = JniHelper::jstring2string(str);
t.env->DeleteLocalRef(str);
}
return IPAddress;
}