forked from chukong/quick-cocos2d-x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add_physics_world
- Loading branch information
Showing
35 changed files
with
1,637 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.quickx.sample.network" | ||
android:versionCode="1" | ||
android:versionName="1.0"> | ||
|
||
<uses-sdk android:minSdkVersion="8" /> | ||
|
||
<supports-screens android:largeScreens="true" | ||
android:smallScreens="true" | ||
android:anyDensity="true" | ||
android:normalScreens="true"/> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
|
||
<application android:label="@string/app_name" | ||
android:allowBackup="true" | ||
android:icon="@drawable/icon" android:debuggable="true"> | ||
|
||
<activity android:name=".Network" | ||
android:label="@string/app_name" | ||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" | ||
android:screenOrientation="landscape"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
|
||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
APP_ROOT="$DIR/.." | ||
APP_ANDROID_ROOT="$DIR" | ||
|
||
if [ -d "/cygdrive/" ]; then | ||
ANDROID_NDK_ROOT=`cygpath "$ANDROID_NDK_ROOT"` | ||
QUICK_COCOS2DX_ROOT=`cygpath "$QUICK_COCOS2DX_ROOT"` | ||
COCOS2DX_ROOT=`cygpath "$COCOS2DX_ROOT"` | ||
fi | ||
|
||
echo "- config:" | ||
echo " ANDROID_NDK_ROOT = $ANDROID_NDK_ROOT" | ||
echo " QUICK_COCOS2DX_ROOT = $QUICK_COCOS2DX_ROOT" | ||
echo " COCOS2DX_ROOT = $COCOS2DX_ROOT" | ||
echo " APP_ROOT = $APP_ROOT" | ||
echo " APP_ANDROID_ROOT = $APP_ANDROID_ROOT" | ||
|
||
echo "- cleanup" | ||
chmod -R 755 "$APP_ANDROID_ROOT" | ||
if [ -d "$APP_ANDROID_ROOT"/bin ]; then | ||
rm -rf "$APP_ANDROID_ROOT"/bin/*.apk | ||
fi | ||
mkdir -p "$APP_ANDROID_ROOT"/bin | ||
chmod 755 "$APP_ANDROID_ROOT"/bin | ||
|
||
if [ -d "$APP_ANDROID_ROOT"/assets ]; then | ||
rm -rf "$APP_ANDROID_ROOT"/assets/* | ||
fi | ||
mkdir -p "$APP_ANDROID_ROOT"/assets | ||
chmod 755 "$APP_ANDROID_ROOT"/assets | ||
|
||
echo "- copy scripts" | ||
cp -rf "$APP_ROOT"/scripts "$APP_ANDROID_ROOT"/assets/ | ||
echo "- copy resources" | ||
cp -rf "$APP_ROOT"/res "$APP_ANDROID_ROOT"/assets/ | ||
|
||
# build | ||
echo "Using prebuilt externals" | ||
"$ANDROID_NDK_ROOT"/ndk-build -j -C "$APP_ANDROID_ROOT" $* \ | ||
"NDK_MODULE_PATH=${QUICK_COCOS2DX_ROOT}:${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
rm -fr $DIR/obj/* | ||
rm -fr $DIR/libs/armeabi/*.so | ||
rm -fr $DIR/assets/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := game_shared | ||
|
||
LOCAL_MODULE_FILENAME := libgame | ||
|
||
LOCAL_SRC_FILES := hellocpp/main.cpp \ | ||
../../sources/AppDelegate.cpp | ||
|
||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../sources | ||
|
||
LOCAL_CFLAGS += -Wno-psabi -DCC_LUA_ENGINE_ENABLED=1 -DDEBUG=1 -DCOCOS2D_DEBUG=1 | ||
|
||
LOCAL_WHOLE_STATIC_LIBRARIES := libquickcocos2dx | ||
|
||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
$(call import-module,lib/proj.android) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_STL := gnustl_static | ||
APP_CPPFLAGS := -frtti |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
#include "cocos2d.h" | ||
#include "AppDelegate.h" | ||
#include "platform/android/jni/JniHelper.h" | ||
#include <jni.h> | ||
#include <android/log.h> | ||
|
||
#define LOG_TAG "main" | ||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) | ||
|
||
using namespace cocos2d; | ||
|
||
extern "C" | ||
{ | ||
|
||
jint JNI_OnLoad(JavaVM *vm, void *reserved) | ||
{ | ||
JniHelper::setJavaVM(vm); | ||
return JNI_VERSION_1_4; | ||
} | ||
|
||
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h) | ||
{ | ||
if (!CCDirector::sharedDirector()->getOpenGLView()) | ||
{ | ||
CCEGLView *view = CCEGLView::sharedOpenGLView(); | ||
view->setFrameSize(w, h); | ||
|
||
AppDelegate *pAppDelegate = new AppDelegate(); | ||
CCApplication::sharedApplication()->run(); | ||
} | ||
else | ||
{ | ||
ccDrawInit(); | ||
ccGLInvalidateStateCache(); | ||
|
||
CCShaderCache::sharedShaderCache()->reloadDefaultShaders(); | ||
CCTextureCache::reloadAllTextures(); | ||
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); | ||
CCDirector::sharedDirector()->setGLDefaultValues(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
append_str=' \' | ||
|
||
list_alldir() | ||
{ | ||
for file in $1/* | ||
do | ||
if [ -f $file ]; then | ||
echo $file$append_str | grep .cpp | ||
fi | ||
|
||
if [ -d $file ]; then | ||
list_alldir $file | ||
fi | ||
done | ||
} | ||
|
||
if [ $# -gt 0 ]; then | ||
list_alldir "$1" | ||
else | ||
list_alldir "." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system edit | ||
# "ant.properties", and override values to adapt the script to your | ||
# project structure. | ||
# | ||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): | ||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | ||
|
||
# Project target. | ||
target=android-8 | ||
android.library=false |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">network</string> | ||
</resources> |
40 changes: 40 additions & 0 deletions
40
sample/network/proj.android/src/com/quickx/sample/network/Network.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2010-2012 cocos2d-x.org | ||
http://www.cocos2d-x.org | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
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. | ||
****************************************************************************/ | ||
package com.quickx.sample.network; | ||
|
||
import org.cocos2dx.lib.Cocos2dxActivity; | ||
|
||
import android.os.Bundle; | ||
|
||
public class Network extends Cocos2dxActivity { | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
} | ||
|
||
static { | ||
System.loadLibrary("game"); | ||
} | ||
} |
Oops, something went wrong.