[android] HelloWorld supports cocosdenshion

This commit is contained in:
minggo 2011-03-18 11:01:27 +08:00
parent 724ac1d0a9
commit 4893de18f3
4 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,7 @@ include $(CLEAR_VARS)
subdirs := $(addprefix $(LOCAL_PATH)/../../../,$(addsuffix /Android.mk, \ subdirs := $(addprefix $(LOCAL_PATH)/../../../,$(addsuffix /Android.mk, \
cocos2dx \ cocos2dx \
CocosDenshion/android \
)) ))
subdirs += $(LOCAL_PATH)/helloworld/Android.mk subdirs += $(LOCAL_PATH)/helloworld/Android.mk

View File

@ -11,12 +11,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
$(LOCAL_PATH)/../../../../cocos2dx/include \ $(LOCAL_PATH)/../../../../cocos2dx/include \
$(LOCAL_PATH)/../../.. $(LOCAL_PATH)/../../..
LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi -lcocos2d -llog LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi -lcocos2d -llog -lcocosdenshion
# it is used for ndk-r5 # it is used for ndk-r5
# because the new Windows toolchain doesn't support Cygwin's drive # because the new Windows toolchain doesn't support Cygwin's drive
# mapping (i.e /cygdrive/c/ instead of C:/) # mapping (i.e /cygdrive/c/ instead of C:/)
# LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \ # LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \
# -lcocos2d -llog # -lcocos2d -llog -lcocosdenshion
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)

View File

@ -34,6 +34,7 @@ public class ApplicationDemo extends Cocos2dxActivity{
static { static {
System.loadLibrary("cocos2d"); System.loadLibrary("cocos2d");
System.loadLibrary("cocosdenshion");
System.loadLibrary("helloworld"); System.loadLibrary("helloworld");
} }
} }

View File

@ -153,6 +153,9 @@ public class Cocos2dxActivity extends Activity{
if (accelerometerEnabled) { if (accelerometerEnabled) {
accelerometer.enable(); accelerometer.enable();
} }
// resume background music
resumeBackgroundMusic();
} }
@Override @Override
@ -161,6 +164,9 @@ public class Cocos2dxActivity extends Activity{
if (accelerometerEnabled) { if (accelerometerEnabled) {
accelerometer.disable(); accelerometer.disable();
} }
// pause background music
pauseBackgroundMusic();
} }
protected void setPackgeName(String packageName) { protected void setPackgeName(String packageName) {