mirror of https://github.com/axmolengine/axmol.git
Merge https://github.com/cocos2d/cocos2d-x into iss364
This commit is contained in:
commit
53eafa77ff
|
@ -1,29 +1,32 @@
|
||||||
# set params
|
# set params
|
||||||
ANDROID_NDK_ROOT=/cygdrive/e/android-ndk-r5
|
ANDROID_NDK_ROOT=/cygdrive/e/android-ndk-r5
|
||||||
COCOS2DX_ROOT=/cygdrive/d/Work7/cocos2d-x
|
COCOS2DX_ROOT=/cygdrive/d/Work7/cocos2d-x
|
||||||
GAME_ROOT=$COCOS2DX_ROOT/HelloLua
|
|
||||||
GAME_ANDROID_ROOT=$GAME_ROOT/android
|
GAME_ROOT=$COCOS2DX_ROOT/HelloLua
|
||||||
RESOURCE_ROOT=$GAME_ROOT/Resource
|
GAME_ANDROID_ROOT=$GAME_ROOT/android
|
||||||
|
GAME_RESOURCE_ROOT=$GAME_ROOT/Resource
|
||||||
# make sure assets is exist
|
|
||||||
if [ -d $GAME_ANDROID_ROOT/assets ]; then
|
# make sure assets is exist
|
||||||
rm -rf $GAME_ANDROID_ROOT/assets
|
if [ -d $GAME_ANDROID_ROOT/assets ]; then
|
||||||
fi
|
rm -rf $GAME_ANDROID_ROOT/assets
|
||||||
|
fi
|
||||||
mkdir $GAME_ANDROID_ROOT/assets
|
|
||||||
|
mkdir $GAME_ANDROID_ROOT/assets
|
||||||
# copy resources
|
|
||||||
for file in $RESOURCE_ROOT/*
|
# copy resources
|
||||||
do
|
for file in $GAME_RESOURCE_ROOT/*
|
||||||
if [ -d $file ]; then
|
do
|
||||||
cp -rf $file $GAME_ANDROID_ROOT/assets
|
if [ -d $file ]; then
|
||||||
fi
|
cp -rf $file $GAME_ANDROID_ROOT/assets
|
||||||
|
fi
|
||||||
if [ -f $file ]; then
|
|
||||||
cp $file $GAME_ANDROID_ROOT/assets
|
if [ -f $file ]; then
|
||||||
fi
|
cp $file $GAME_ANDROID_ROOT/assets
|
||||||
done
|
fi
|
||||||
|
done
|
||||||
# build
|
|
||||||
$ANDROID_NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT $*
|
# build
|
||||||
|
pushd $ANDROID_NDK_ROOT
|
||||||
|
./ndk-build -C $GAME_ANDROID_ROOT $*
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
|
||||||
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl \
|
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl \
|
||||||
# -lpng \
|
# -lpng \
|
||||||
# -lxml2 \
|
# -lxml2 \
|
||||||
# -ljpeg \
|
# -ljpeg
|
||||||
# -lskia
|
|
||||||
|
|
||||||
# it is used for ndk-r5
|
# it is used for ndk-r5
|
||||||
# if you build with ndk-r4, comment it
|
# if you build with ndk-r4, comment it
|
||||||
|
@ -35,8 +34,7 @@ LOCAL_LDLIBS := -llog -lGLESv1_CM -llog -lz \
|
||||||
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl \
|
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl \
|
||||||
-lpng \
|
-lpng \
|
||||||
-lxml2 \
|
-lxml2 \
|
||||||
-ljpeg \
|
-ljpeg
|
||||||
-lskia
|
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := libcocos2d libcocosdenshion liblua
|
LOCAL_STATIC_LIBRARIES := libcocos2d libcocosdenshion liblua
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package org.cocos2dx.lib;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.ByteOrder;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.Paint.FontMetricsInt;
|
||||||
|
|
||||||
|
public class Cocos2dxBitmap{
|
||||||
|
public static void createTextBitmap(String content, int fontSize){
|
||||||
|
Paint paint = new Paint();
|
||||||
|
paint.setColor(Color.WHITE);
|
||||||
|
paint.setTextSize(fontSize);
|
||||||
|
|
||||||
|
FontMetricsInt fm = paint.getFontMetricsInt();
|
||||||
|
int h = (int)Math.ceil(fm.descent - fm.ascent) + 2;
|
||||||
|
int w = (int)Math.ceil(paint.measureText(content, 0, content.length()));
|
||||||
|
|
||||||
|
Bitmap bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
|
||||||
|
Canvas canvas = new Canvas(bitmap);
|
||||||
|
canvas.drawText(content, 0, h, paint);
|
||||||
|
|
||||||
|
initNativeObject(bitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initNativeObject(Bitmap bitmap){
|
||||||
|
byte[] pixels = getPixels(bitmap);
|
||||||
|
if (pixels == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nativeInitBitmapDC(bitmap.getWidth(), bitmap.getHeight(), pixels);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static byte[] getPixels(Bitmap bitmap){
|
||||||
|
if (bitmap != null){
|
||||||
|
byte[] pixels = new byte[bitmap.getWidth() * bitmap.getHeight() * 4];
|
||||||
|
ByteBuffer buf = ByteBuffer.wrap(pixels);
|
||||||
|
buf.order(ByteOrder.nativeOrder());
|
||||||
|
bitmap.copyPixelsToBuffer(buf);
|
||||||
|
return pixels;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static native void nativeInitBitmapDC(int width, int height, byte[] pixels);
|
||||||
|
}
|
|
@ -9,14 +9,14 @@
|
||||||
Name="Debug|Win32"
|
Name="Debug|Win32"
|
||||||
>
|
>
|
||||||
<DebugSettings
|
<DebugSettings
|
||||||
WorkingDirectory="$(ProjectDir)Resource\"
|
WorkingDirectory="$(ProjectDir)..\Resource\"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Release|Win32"
|
Name="Release|Win32"
|
||||||
>
|
>
|
||||||
<DebugSettings
|
<DebugSettings
|
||||||
WorkingDirectory="$(ProjectDir)Resource\"
|
WorkingDirectory="$(ProjectDir)..\Resource\"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
</Configurations>
|
</Configurations>
|
||||||
|
|
|
@ -25,6 +25,7 @@ EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua\win32\HelloLua.win32.vcproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua\win32\HelloLua.win32.vcproj", "{13E55395-94A2-4CD9-BFC2-1A051F80C17D}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159}
|
{DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159}
|
||||||
|
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "lua\liblua.vcproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "lua\liblua.vcproj", "{DDC3E27F-004D-4DD4-9DD3-931A013D2159}"
|
||||||
|
|
|
@ -107,19 +107,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \
|
||||||
$(LOCAL_PATH)/platform/third_party/android/iconv \
|
$(LOCAL_PATH)/platform/third_party/android/iconv \
|
||||||
$(LOCAL_PATH)/platform/third_party/android/libpng \
|
$(LOCAL_PATH)/platform/third_party/android/libpng \
|
||||||
$(LOCAL_PATH)/platform/third_party/android/libxml2 \
|
$(LOCAL_PATH)/platform/third_party/android/libxml2 \
|
||||||
$(LOCAL_PATH)/platform/third_party/android/libjpeg \
|
$(LOCAL_PATH)/platform/third_party/android/libjpeg
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/core \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/animator \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/config \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/effects \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/images \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/pdf \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/ports \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/svg \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/text \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/utils \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/views \
|
|
||||||
$(LOCAL_PATH)/platform/third_party/android/skia/xml
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := -DUSE_FILE32API
|
LOCAL_CFLAGS := -DUSE_FILE32API
|
||||||
|
|
|
@ -115,7 +115,7 @@ typedef EGLNativeWindowType NativeWindowType;
|
||||||
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
|
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
|
||||||
* integer type.
|
* integer type.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN64) || __WORDSIZE == 64
|
#if defined(_WIN64) || __WORDSIZE == 64
|
||||||
typedef khronos_int64_t EGLint;
|
typedef khronos_int64_t EGLint;
|
||||||
#else
|
#else
|
||||||
typedef khronos_int32_t EGLint;
|
typedef khronos_int32_t EGLint;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
/* Khronos platform-specific types and definitions.
|
/* Khronos platform-specific types and definitions.
|
||||||
*
|
*
|
||||||
* $Revision: 1.4 $ on $Date: 2009/05/06 13:30:53 $
|
* $Revision: 1.5 $ on $Date: 2010/06/03 16:51:55 $
|
||||||
*
|
*
|
||||||
* Adopters may modify this file to suit their platform. Adopters are
|
* Adopters may modify this file to suit their platform. Adopters are
|
||||||
* encouraged to submit platform specific modifications to the Khronos
|
* encouraged to submit platform specific modifications to the Khronos
|
||||||
|
@ -97,8 +97,8 @@
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
* This precedes the return type of the function in the function prototype.
|
* This precedes the return type of the function in the function prototype.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (defined(_WIN32) || defined(__VC32__)) && !defined(__SCITECH_SNAP__)
|
#if (defined(_WIN32) || defined(__VC32__)) && !defined(__SCITECH_SNAP__) && !defined(__WINSCW__)
|
||||||
# if defined (_DLL_EXPORTS)
|
# if defined (_DLL_EXPORTS)
|
||||||
# define KHRONOS_APICALL __declspec(dllexport)
|
# define KHRONOS_APICALL __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
* This follows the return type of the function and precedes the function
|
* This follows the return type of the function and precedes the function
|
||||||
* name in the function prototype.
|
* name in the function prototype.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) && !defined(__WINSCW__)
|
||||||
/* Win32 but not WinCE */
|
/* Win32 but not WinCE */
|
||||||
# define KHRONOS_APIENTRY __stdcall
|
# define KHRONOS_APIENTRY __stdcall
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
d501b155a2f81592835224d5cbd4f348438b5d9d
|
b3c91670e8921218c2c6b169a95c5b9b5edae87c
|
|
@ -1 +1 @@
|
||||||
1672304b77b25dcb9c0dfdf8abb8e7d0ffe02427
|
9682d6c6192560740fbcc514f1700f431c02041d
|
|
@ -2,5 +2,5 @@ iconv 1.9.2
|
||||||
libjpeg 8b
|
libjpeg 8b
|
||||||
libpng 1.4.5beta04
|
libpng 1.4.5beta04
|
||||||
libxml2 2.7.7
|
libxml2 2.7.7
|
||||||
OGLES 2.07.27.0484
|
OGLES 2.08.28.0634
|
||||||
zlib 1.2.5
|
zlib 1.2.5
|
||||||
|
|
|
@ -6,16 +6,16 @@ defines
|
||||||
AIRPLAY = 1
|
AIRPLAY = 1
|
||||||
CC_UNDER_AIRPLAY = 1
|
CC_UNDER_AIRPLAY = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
options
|
options
|
||||||
{
|
{
|
||||||
module_path="../platform/third_party/airplay/"
|
module_path="../platform/third_party/airplay/"
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects
|
subprojects
|
||||||
{
|
{
|
||||||
zlib
|
zlib
|
||||||
expat
|
expat
|
||||||
}
|
}
|
||||||
includepaths
|
includepaths
|
||||||
{
|
{
|
||||||
|
@ -91,6 +91,10 @@ files
|
||||||
[platforms/airplay]
|
[platforms/airplay]
|
||||||
"*.h"
|
"*.h"
|
||||||
"*.cpp"
|
"*.cpp"
|
||||||
|
|
||||||
|
("../script_support")
|
||||||
|
[script_support]
|
||||||
|
"*.cpp"
|
||||||
|
|
||||||
("../sprite_nodes")
|
("../sprite_nodes")
|
||||||
[sprite_nodes]
|
[sprite_nodes]
|
||||||
|
@ -98,15 +102,15 @@ files
|
||||||
|
|
||||||
("../support")
|
("../support")
|
||||||
[support]
|
[support]
|
||||||
"base64.cpp"
|
"base64.cpp"
|
||||||
"base64.h"
|
"base64.h"
|
||||||
"CCArray.cpp"
|
"CCArray.cpp"
|
||||||
"CCPointExtension.cpp"
|
"CCPointExtension.cpp"
|
||||||
"CCProfiling.cpp"
|
"CCProfiling.cpp"
|
||||||
"CCProfiling.h"
|
"CCProfiling.h"
|
||||||
"ccUtils.cpp"
|
"ccUtils.cpp"
|
||||||
"ccUtils.h"
|
"ccUtils.h"
|
||||||
"TransformUtils.cpp"
|
"TransformUtils.cpp"
|
||||||
"TransformUtils.h"
|
"TransformUtils.h"
|
||||||
|
|
||||||
("../support/data_support")
|
("../support/data_support")
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
echo "generating libcocos2dx"
|
echo "generating libcocos2dx"
|
||||||
mkdir -p template/xcode4/lib_cocos2dx.xctemplate
|
mkdir -p template/xcode4/lib_cocos2dx.xctemplate
|
||||||
python ./template/xcode4/template_generator.py --directory cocos2dx --identifier libcocos2dx --prefix libs --exclude "android win32 airplay wophone third_party CCImage.cpp Android.mk" > ./template/xcode4/lib_cocos2dx.xctemplate/TemplateInfo.plist
|
python ./tools/template_generator.py --directory cocos2dx --identifier libcocos2dx --prefix libs --exclude "android win32 airplay wophone third_party CCImage.cpp CCFileUtils.cpp Android.mk" > ./template/xcode4/lib_cocos2dx.xctemplate/TemplateInfo.plist
|
||||||
|
|
||||||
echo "generating libcocosdenshion"
|
echo "generating libcocosdenshion"
|
||||||
mkdir -p template/xcode4/lib_cocosdenshion.xctemplate
|
mkdir -p template/xcode4/lib_cocosdenshion.xctemplate
|
||||||
python ./template/xcode4/template_generator.py --directory CocosDenshion --identifier libcocosdenshion --prefix libs --exclude "android win32 airplay wophone Android.mk" > ./template/xcode4/lib_cocosdenshion.xctemplate/TemplateInfo.plist
|
python ./tools/template_generator.py --directory CocosDenshion --identifier libcocosdenshion --prefix libs --exclude "android win32 airplay wophone Android.mk" > ./template/xcode4/lib_cocosdenshion.xctemplate/TemplateInfo.plist
|
||||||
|
|
||||||
echo "generating libbox2d"
|
echo "generating libbox2d"
|
||||||
mkdir -p template/xcode4/lib_box2d.xctemplate
|
mkdir -p template/xcode4/lib_box2d.xctemplate
|
||||||
python ./template/xcode4/template_generator.py --directory Box2D --identifier libbox2d --prefix libs --exclude "android win32 airplay wophone Android.mk" > ./template/xcode4/lib_box2d.xctemplate/TemplateInfo.plist
|
python ./tools/template_generator.py --directory Box2D --identifier libbox2d --prefix libs --exclude "android win32 airplay wophone Android.mk" > ./template/xcode4/lib_box2d.xctemplate/TemplateInfo.plist
|
||||||
|
|
||||||
echo "generating libchipmunk"
|
echo "generating libchipmunk"
|
||||||
mkdir -p template/xcode4/lib_chipmunk.xctemplate
|
mkdir -p template/xcode4/lib_chipmunk.xctemplate
|
||||||
python ./template/xcode4/template_generator.py --directory chipmunk --identifier libchipmunk --prefix libs --exclude "android win32 airplay wophone Android.mk" > ./template/xcode4/lib_chipmunk.xctemplate/TemplateInfo.plist
|
python ./tools/template_generator.py --directory chipmunk --identifier libchipmunk --prefix libs --exclude "android win32 airplay wophone Android.mk" > ./template/xcode4/lib_chipmunk.xctemplate/TemplateInfo.plist
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
|
@ -1 +1 @@
|
||||||
d1962bc646d8650f27302fd6c32dff2d9d4ab6a5
|
58728dc0be18955fcaabb9d6cd2ead3fdf389132
|
|
@ -1 +1 @@
|
||||||
6c636339fa5aff82bfca50d9da220b50af5c0053
|
f04508231e03751a17872c963c91f97e4335132a
|
|
@ -1 +1 @@
|
||||||
0a09e265a353ec809a147d63541176ab261026fd
|
62513e048519ce58a6a7b19d444f751b0e6ae9a4
|
Loading…
Reference in New Issue