Skip to content

Commit

Permalink
Merge branch 'master' into add_physics_world
Browse files Browse the repository at this point in the history
  • Loading branch information
dualface committed May 9, 2013
2 parents 26d7f7f + 0b773d1 commit fa31b55
Show file tree
Hide file tree
Showing 35 changed files with 1,637 additions and 15 deletions.
19 changes: 12 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,17 @@ sample/Benchmark/proj.android/obj/
sample/Benchmark/proj.android/assets/
sample/Benchmark/proj.android/libs/

sample/Physics/proj.android/bin/
sample/Physics/proj.android/gen/
sample/Physics/proj.android/lint.xml
sample/Physics/proj.android/obj/
sample/Physics/proj.android/assets/
sample/Physics/proj.android/libs/
sample/Physics/proj.win32/Debug/
sample/physics/proj.android/bin/
sample/physics/proj.android/gen/
sample/physics/proj.android/lint.xml
sample/physics/proj.android/obj/
sample/physics/proj.android/assets/
sample/physics/proj.android/libs/

sample/network/proj.android/bin/
sample/network/proj.android/gen/
sample/network/proj.android/lint.xml
sample/network/proj.android/obj/
sample/network/proj.android/assets/
sample/network/proj.android/libs/

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ CODE LESS, PLAY MORE !

#### DOWNLOADS

- **LATEST**: [quick-cocos2d-x-20130508.zip](http://quick-x.com/downloads/quick-cocos2d-x-20130508.zip)
- **CHINA DOWNLOAD LINK**: [quick-cocos2d-x-20130508.zip](http://17wanapp.cn/quickx/quick-cocos2d-x-20130508.zip)
- **LATEST**: [quick-cocos2d-x-20130509.zip](http://quick-x.com/downloads/quick-cocos2d-x-20130509.zip)
- **CHINA DOWNLOAD LINK**: [quick-cocos2d-x-20130509.zip](http://17wanapp.cn/quickx/quick-cocos2d-x-20130509.zip)


#### RUN SIMULATOR
Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ CODE LESS, PLAY MORE !

### 下载

- **最新版本**: [quick-cocos2d-x-20130508.zip](http://quick-x.com/downloads/quick-cocos2d-x-20130508.zip)
- **中国大陆下载地址**: [quick-cocos2d-x-20130508.zip](http://17wanapp.cn/quickx/quick-cocos2d-x-20130508.zip)
- **最新版本**: [quick-cocos2d-x-20130509.zip](http://quick-x.com/downloads/quick-cocos2d-x-20130509.zip)
- **中国大陆下载地址**: [quick-cocos2d-x-20130509.zip](http://17wanapp.cn/quickx/quick-cocos2d-x-20130509.zip)


### 运行模拟器
Expand Down
32 changes: 32 additions & 0 deletions sample/network/proj.android/AndroidManifest.xml
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>
42 changes: 42 additions & 0 deletions sample/network/proj.android/build_native.sh
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"
6 changes: 6 additions & 0 deletions sample/network/proj.android/clean.sh
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/*

20 changes: 20 additions & 0 deletions sample/network/proj.android/jni/Android.mk
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)
2 changes: 2 additions & 0 deletions sample/network/proj.android/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti
44 changes: 44 additions & 0 deletions sample/network/proj.android/jni/hellocpp/main.cpp
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();
}
}

}
23 changes: 23 additions & 0 deletions sample/network/proj.android/jni/list.sh
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
15 changes: 15 additions & 0 deletions sample/network/proj.android/project.properties
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.
4 changes: 4 additions & 0 deletions sample/network/proj.android/res/values/strings.xml
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>
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");
}
}
Loading

0 comments on commit fa31b55

Please sign in to comment.