mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3_fix
This commit is contained in:
commit
3fddb798ea
|
@ -3,11 +3,13 @@ cocos2d-x-3.2 ???
|
|||
|
||||
[FIX] Application.mk: not output debug message in releae mode on Android
|
||||
[FIX] Android: 3d model will be black when coming from background
|
||||
[FIX] Android: don't trigger EVENT_COME_TO_BACKGROUND event when go to background
|
||||
[FIX] Cocos2dxGLSurfaceView.java: prevent flickering when opening another activity
|
||||
[FIX] Image: Set jpeg save quality to 90
|
||||
[FIX] Label: label is unsharp if it's created by smaller font
|
||||
[FIX] Others: Treat warning as error on iOS and Mac
|
||||
[FIX] Repeat: will run one more over in rare situations
|
||||
[FIX] Scale9Sprite: support culling
|
||||
[FIX] Schedule: schedulePerFrame() can not be called twice
|
||||
[FIX] SpriteFrameCache: fix memory leak
|
||||
|
||||
|
|
|
@ -7081,7 +7081,7 @@
|
|||
CC_TARGET_OS_MAC,
|
||||
CC_KEYBOARD_SUPPORT,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -7108,7 +7108,7 @@
|
|||
CC_KEYBOARD_SUPPORT,
|
||||
CC_TARGET_OS_MAC,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -7201,7 +7201,7 @@
|
|||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac";
|
||||
};
|
||||
|
@ -7212,7 +7212,7 @@
|
|||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac";
|
||||
};
|
||||
|
@ -7227,7 +7227,7 @@
|
|||
CC_TARGET_OS_MAC,
|
||||
CC_KEYBOARD_SUPPORT,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop $(SRCROOT)/../external/glfw3/include/mac";
|
||||
|
@ -7243,7 +7243,7 @@
|
|||
CC_TARGET_OS_MAC,
|
||||
CC_KEYBOARD_SUPPORT,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop $(SRCROOT)/../external/glfw3/include/mac";
|
||||
|
@ -7261,7 +7261,7 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
|
@ -7300,7 +7300,7 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
|
@ -7357,7 +7357,7 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
|
@ -7376,7 +7376,7 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
|
@ -7455,7 +7455,7 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
SDKROOT = iphoneos;
|
||||
|
@ -7473,7 +7473,7 @@
|
|||
"$(inherited)",
|
||||
CC_TARGET_OS_IPHONE,
|
||||
);
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
|
||||
SDKROOT = iphoneos;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "base/CCIMEDispatcher.h"
|
||||
#include "base/CCDirector.h"
|
||||
#include "base/CCEventType.h"
|
||||
#include "base/CCEventCustom.h"
|
||||
#include "../CCApplication.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
#include "JniHelper.h"
|
||||
|
@ -16,6 +17,8 @@ extern "C" {
|
|||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnPause() {
|
||||
Application::getInstance()->applicationDidEnterBackground();
|
||||
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
|
||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume() {
|
||||
|
|
|
@ -250,48 +250,48 @@ bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& o
|
|||
// Centre
|
||||
_centre = Sprite::createWithTexture(_scale9Image->getTexture(), centerbounds);
|
||||
_centre->retain();
|
||||
_scale9Image->addChild(_centre, 0, pCentre);
|
||||
this->addChild(_centre, 0, pCentre);
|
||||
|
||||
|
||||
// Top
|
||||
_top = Sprite::createWithTexture(_scale9Image->getTexture(), centertopbounds);
|
||||
_top->retain();
|
||||
_scale9Image->addChild(_top, 1, pTop);
|
||||
this->addChild(_top, 1, pTop);
|
||||
|
||||
// Bottom
|
||||
_bottom = Sprite::createWithTexture(_scale9Image->getTexture(), centerbottombounds);
|
||||
_bottom->retain();
|
||||
_scale9Image->addChild(_bottom, 1, pBottom);
|
||||
this->addChild(_bottom, 1, pBottom);
|
||||
|
||||
// Left
|
||||
_left = Sprite::createWithTexture(_scale9Image->getTexture(), leftcenterbounds);
|
||||
_left->retain();
|
||||
_scale9Image->addChild(_left, 1, pLeft);
|
||||
this->addChild(_left, 1, pLeft);
|
||||
|
||||
// Right
|
||||
_right = Sprite::createWithTexture(_scale9Image->getTexture(), rightcenterbounds);
|
||||
_right->retain();
|
||||
_scale9Image->addChild(_right, 1, pRight);
|
||||
this->addChild(_right, 1, pRight);
|
||||
|
||||
// Top left
|
||||
_topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), lefttopbounds);
|
||||
_topLeft->retain();
|
||||
_scale9Image->addChild(_topLeft, 2, pTopLeft);
|
||||
this->addChild(_topLeft, 2, pTopLeft);
|
||||
|
||||
// Top right
|
||||
_topRight = Sprite::createWithTexture(_scale9Image->getTexture(), righttopbounds);
|
||||
_topRight->retain();
|
||||
_scale9Image->addChild(_topRight, 2, pTopRight);
|
||||
this->addChild(_topRight, 2, pTopRight);
|
||||
|
||||
// Bottom left
|
||||
_bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), leftbottombounds);
|
||||
_bottomLeft->retain();
|
||||
_scale9Image->addChild(_bottomLeft, 2, pBottomLeft);
|
||||
this->addChild(_bottomLeft, 2, pBottomLeft);
|
||||
|
||||
// Bottom right
|
||||
_bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rightbottombounds);
|
||||
_bottomRight->retain();
|
||||
_scale9Image->addChild(_bottomRight, 2, pBottomRight);
|
||||
this->addChild(_bottomRight, 2, pBottomRight);
|
||||
} else {
|
||||
// set up transformation of coordinates
|
||||
// to handle the case where the sprite is stored rotated
|
||||
|
@ -336,47 +336,47 @@ bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& o
|
|||
// Centre
|
||||
_centre = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbounds, true);
|
||||
_centre->retain();
|
||||
_scale9Image->addChild(_centre, 0, pCentre);
|
||||
this->addChild(_centre, 0, pCentre);
|
||||
|
||||
// Top
|
||||
_top = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcentertopbounds, true);
|
||||
_top->retain();
|
||||
_scale9Image->addChild(_top, 1, pTop);
|
||||
this->addChild(_top, 1, pTop);
|
||||
|
||||
// Bottom
|
||||
_bottom = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbottombounds, true);
|
||||
_bottom->retain();
|
||||
_scale9Image->addChild(_bottom, 1, pBottom);
|
||||
this->addChild(_bottom, 1, pBottom);
|
||||
|
||||
// Left
|
||||
_left = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftcenterbounds, true);
|
||||
_left->retain();
|
||||
_scale9Image->addChild(_left, 1, pLeft);
|
||||
this->addChild(_left, 1, pLeft);
|
||||
|
||||
// Right
|
||||
_right = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightcenterbounds, true);
|
||||
_right->retain();
|
||||
_scale9Image->addChild(_right, 1, pRight);
|
||||
this->addChild(_right, 1, pRight);
|
||||
|
||||
// Top left
|
||||
_topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedlefttopbounds, true);
|
||||
_topLeft->retain();
|
||||
_scale9Image->addChild(_topLeft, 2, pTopLeft);
|
||||
this->addChild(_topLeft, 2, pTopLeft);
|
||||
|
||||
// Top right
|
||||
_topRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrighttopbounds, true);
|
||||
_topRight->retain();
|
||||
_scale9Image->addChild(_topRight, 2, pTopRight);
|
||||
this->addChild(_topRight, 2, pTopRight);
|
||||
|
||||
// Bottom left
|
||||
_bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftbottombounds, true);
|
||||
_bottomLeft->retain();
|
||||
_scale9Image->addChild(_bottomLeft, 2, pBottomLeft);
|
||||
this->addChild(_bottomLeft, 2, pBottomLeft);
|
||||
|
||||
// Bottom right
|
||||
_bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightbottombounds, true);
|
||||
_bottomRight->retain();
|
||||
_scale9Image->addChild(_bottomRight, 2, pBottomRight);
|
||||
this->addChild(_bottomRight, 2, pBottomRight);
|
||||
}
|
||||
|
||||
this->setContentSize(rect.size);
|
||||
|
|
Loading…
Reference in New Issue