Skip to content

Commit

Permalink
[android] HelloWorld supports cocosdenshion
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Mar 18, 2011
1 parent 5a9e12d commit 757d471
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions HelloWorld/android/jni/Android.mk
Expand Up @@ -3,6 +3,7 @@ include $(CLEAR_VARS)

subdirs := $(addprefix $(LOCAL_PATH)/../../../,$(addsuffix /Android.mk, \
cocos2dx \
CocosDenshion/android \
))
subdirs += $(LOCAL_PATH)/helloworld/Android.mk

Expand Down
4 changes: 2 additions & 2 deletions HelloWorld/android/jni/helloworld/Android.mk
Expand Up @@ -11,12 +11,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
$(LOCAL_PATH)/../../../../cocos2dx/include \
$(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
# because the new Windows toolchain doesn't support Cygwin's drive
# mapping (i.e /cygdrive/c/ instead of C:/)
# LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \
# -lcocos2d -llog
# -lcocos2d -llog -lcocosdenshion

include $(BUILD_SHARED_LIBRARY)
Expand Up @@ -34,6 +34,7 @@ protected void onResume() {

static {
System.loadLibrary("cocos2d");
System.loadLibrary("cocosdenshion");
System.loadLibrary("helloworld");
}
}
6 changes: 6 additions & 0 deletions HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxActivity.java
Expand Up @@ -153,6 +153,9 @@ protected void onResume() {
if (accelerometerEnabled) {
accelerometer.enable();
}

// resume background music
resumeBackgroundMusic();
}

@Override
Expand All @@ -161,6 +164,9 @@ protected void onPause() {
if (accelerometerEnabled) {
accelerometer.disable();
}

// pause background music
pauseBackgroundMusic();
}

protected void setPackgeName(String packageName) {
Expand Down

0 comments on commit 757d471

Please sign in to comment.