diff --git a/CHANGELOG b/CHANGELOG index 374d27fd3e..6e41066be9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -25,6 +25,7 @@ cocos2d-x-3.3-beta1 [FIX] Node: unscheduleAllSelectors() deprecated in favor of unscheudleAllCallbacks() [FIX] Node: crashed if remove/add child too quickly when using integrated physics [FIX] TextFieldTTF: will get wrong characters if using Chinese input method on WP8 + [FIX] UI: Button: button remains gray when releasing it, this issue only happened if enable scale9 and only has one texture cocos2d-x-3.3-beta0 Sep.20 2014 [NEW] 3d: added `BillBoard` diff --git a/cocos/3d/CCBundle3D.cpp b/cocos/3d/CCBundle3D.cpp index f1739a3113..427802b40d 100644 --- a/cocos/3d/CCBundle3D.cpp +++ b/cocos/3d/CCBundle3D.cpp @@ -1775,7 +1775,6 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue) if (modelnodedata->subMeshId == "" || modelnodedata->matrialId == "") { - std::string err = "Node " + nodedata->id + " part is missing meshPartId or materialId"; CCLOG("warning: Node %s part is missing meshPartId or materialId", nodedata->id.c_str()); return nullptr; } diff --git a/cocos/base/CCLight.cpp b/cocos/base/CCLight.cpp index 767250d896..904082f5b7 100644 --- a/cocos/base/CCLight.cpp +++ b/cocos/base/CCLight.cpp @@ -69,19 +69,15 @@ void DirectionLight::setDirection(const Vec3 &dir) { setRotationFromDirection(dir); } -const Vec3& DirectionLight::getDirection() const +Vec3 DirectionLight::getDirection() const { - static Vec3 dir; Mat4 mat = getNodeToParentTransform(); - dir.set(-mat.m[8], -mat.m[9], -mat.m[10]); - return dir; + return Vec3(-mat.m[8], -mat.m[9], -mat.m[10]); } -const Vec3& DirectionLight::getDirectionInWorld() const +Vec3 DirectionLight::getDirectionInWorld() const { - static Vec3 dir; Mat4 mat = getNodeToWorldTransform(); - dir.set(-mat.m[8], -mat.m[9], -mat.m[10]); - return dir; + return Vec3(-mat.m[8], -mat.m[9], -mat.m[10]); } DirectionLight::DirectionLight() { @@ -131,20 +127,16 @@ void SpotLight::setDirection(const Vec3 &dir) setRotationFromDirection(dir); } -const Vec3& SpotLight::getDirection() const +Vec3 SpotLight::getDirection() const { - static Vec3 dir; Mat4 mat = getNodeToParentTransform(); - dir.set(-mat.m[8], -mat.m[9], -mat.m[10]); - return dir; + return Vec3(-mat.m[8], -mat.m[9], -mat.m[10]); } -const Vec3& SpotLight::getDirectionInWorld() const +Vec3 SpotLight::getDirectionInWorld() const { - static Vec3 dir; Mat4 mat = getNodeToWorldTransform(); - dir.set(-mat.m[8], -mat.m[9], -mat.m[10]); - return dir; + return Vec3(-mat.m[8], -mat.m[9], -mat.m[10]); } void SpotLight::setInnerAngle(float angle) @@ -156,7 +148,7 @@ void SpotLight::setInnerAngle(float angle) void SpotLight::setOuterAngle(float angle) { _outerAngle = angle; - _cosInnerAngle = cosf(angle); + _cosOuterAngle = cosf(angle); } SpotLight::SpotLight() diff --git a/cocos/base/CCLight.h b/cocos/base/CCLight.h index 44a5aa564e..d884cf477d 100644 --- a/cocos/base/CCLight.h +++ b/cocos/base/CCLight.h @@ -120,12 +120,12 @@ public: /** * Returns the Direction in parent. */ - const Vec3& getDirection() const; + Vec3 getDirection() const; /** * Returns direction in world. */ - const Vec3& getDirectionInWorld() const; + Vec3 getDirectionInWorld() const; CC_CONSTRUCTOR_ACCESS: DirectionLight(); @@ -190,12 +190,12 @@ public: /** * Returns the Direction in parent. */ - const Vec3& getDirection() const; + Vec3 getDirection() const; /** * Returns direction in world. */ - const Vec3& getDirectionInWorld() const; + Vec3 getDirectionInWorld() const; /** * Sets the range of point or spot light. @@ -238,7 +238,7 @@ public: float getOuterAngle() const { return _outerAngle; } /** get cos outAngle */ - float getCosOuterAngle() const { return _cosInnerAngle; } + float getCosOuterAngle() const { return _cosOuterAngle; } CC_CONSTRUCTOR_ACCESS: SpotLight(); diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp index 9281c92e1f..d805005bea 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -115,7 +115,11 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V ActionObject* ActionManagerEx::getActionByName(const char* jsonName,const char* actionName) { - auto iterator = _actionDic.find(jsonName); + std::string path = jsonName; + ssize_t pos = path.find_last_of("/"); + std::string fileName = path.substr(pos+1,path.length()); + CCLOG("find filename == %s",fileName.c_str()); + auto iterator = _actionDic.find(fileName); if (iterator == _actionDic.end()) { return nullptr; diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index a4c6bf7b0f..8e938366c4 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -374,11 +374,19 @@ void Button::onPressStateChangedToNormal() } else { - _buttonNormalRenderer->stopAllActions(); - _buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize); - _titleRenderer->stopAllActions(); - _titleRenderer->setScaleX(_normalTextureScaleXInSize); - _titleRenderer->setScaleY(_normalTextureScaleYInSize); + if (_scale9Enabled) + { + _buttonNormalRenderer->setColor(Color3B::WHITE); + } + else + { + _buttonNormalRenderer->stopAllActions(); + _buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize); + + _titleRenderer->stopAllActions(); + _titleRenderer->setScaleX(_normalTextureScaleXInSize); + _titleRenderer->setScaleY(_normalTextureScaleYInSize); + } } } diff --git a/templates/cpp-template-default/proj.android/project.properties b/templates/cpp-template-default/proj.android/project.properties index 572f7c30de..dc57659a70 100644 --- a/templates/cpp-template-default/proj.android/project.properties +++ b/templates/cpp-template-default/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../../cocos/platform/android/java +android.library.reference.1=../cocos2d/cocos/platform/android/java