mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3_VideoPlayer
This commit is contained in:
commit
acc1004e28
1
AUTHORS
1
AUTHORS
|
@ -657,6 +657,7 @@ Developers:
|
|||
lite3
|
||||
Fixed a bug that Node's anchor point was changed after being added to ScrollView.
|
||||
Added HttpClient::sendImmediate()
|
||||
Added operator == != for Value
|
||||
|
||||
superrad
|
||||
Clear NoSuchMethodError Exception when JniHelper fails to find methodID
|
||||
|
|
|
@ -8,6 +8,7 @@ cocos2d-x-3.2 ???
|
|||
and addChild(Node* node, int localZOrder, const std::string &name)
|
||||
[NEW] Node: physical body supports rotation
|
||||
[NEW] utils: added findChildren() to find all children by name
|
||||
[NEW] Value: added operator == !=
|
||||
|
||||
|
||||
[FIX] FileUtils: getStringFromFile may return a unterminated string
|
||||
|
|
|
@ -4,7 +4,6 @@ NS_CC_BEGIN
|
|||
template <int componentSize>
|
||||
void AnimationCurve<componentSize>::evaluate(float time, float* dst, EvaluateType type) const
|
||||
{
|
||||
int floatSize = sizeof(float);
|
||||
if (_count == 1 || time <= _keytime[0])
|
||||
{
|
||||
memcpy(dst, _value, _componentSizeByte);
|
||||
|
|
|
@ -247,7 +247,6 @@ bool Bundle3D::loadAnimationData(const std::string& id, Animation3DData* animati
|
|||
if ( bone.HasMember("keyframes"))
|
||||
{
|
||||
const rapidjson::Value& bone_keyframes = bone["keyframes"];
|
||||
rapidjson::SizeType keyframe_size = bone_keyframes.Size();
|
||||
for (rapidjson::SizeType j = 0; j < bone_keyframes.Size(); j++)
|
||||
{
|
||||
const rapidjson::Value& bone_keyframe = bone_keyframes[j];
|
||||
|
|
|
@ -339,6 +339,82 @@ Value& Value::operator= (ValueMapIntKey&& v)
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool Value::operator!= (const Value& v)
|
||||
{
|
||||
return !(*this == v);
|
||||
}
|
||||
bool Value::operator!= (const Value& v) const
|
||||
{
|
||||
return !(*this == v);
|
||||
}
|
||||
|
||||
bool Value::operator== (const Value& v)
|
||||
{
|
||||
const auto &t = *this;
|
||||
return t == v;
|
||||
}
|
||||
bool Value::operator== (const Value& v) const
|
||||
{
|
||||
if (this == &v) return true;
|
||||
if (v._type != this->_type) return false;
|
||||
if (this->isNull()) return true;
|
||||
switch (_type)
|
||||
{
|
||||
case Type::BYTE: return v._field.byteVal == this->_field.byteVal;
|
||||
case Type::INTEGER: return v._field.intVal == this->_field.intVal;
|
||||
case Type::BOOLEAN: return v._field.boolVal == this->_field.boolVal;
|
||||
case Type::STRING: return *v._field.strVal == *this->_field.strVal;
|
||||
case Type::FLOAT: return fabs(v._field.floatVal - this->_field.floatVal) <= FLT_EPSILON;
|
||||
case Type::DOUBLE: return fabs(v._field.doubleVal - this->_field.doubleVal) <= FLT_EPSILON;
|
||||
case Type::VECTOR:
|
||||
{
|
||||
const auto &v1 = *(this->_field.vectorVal);
|
||||
const auto &v2 = *(v._field.vectorVal);
|
||||
const auto size = v1.size();
|
||||
if (size == v2.size())
|
||||
{
|
||||
for (size_t i = 0; i < size; i++)
|
||||
{
|
||||
if (v1[i] != v2[i]) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case Type::MAP:
|
||||
{
|
||||
const auto &map1 = *(this->_field.mapVal);
|
||||
const auto &map2 = *(v._field.mapVal);
|
||||
for (const auto &kvp : map1)
|
||||
{
|
||||
auto it = map2.find(kvp.first);
|
||||
if (it == map2.end() || it->second != kvp.second)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case Type::INT_KEY_MAP:
|
||||
{
|
||||
const auto &map1 = *(this->_field.intKeyMapVal);
|
||||
const auto &map2 = *(v._field.intKeyMapVal);
|
||||
for (const auto &kvp : map1)
|
||||
{
|
||||
auto it = map2.find(kvp.first);
|
||||
if (it == map2.end() || it->second != kvp.second)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Convert value to a specified type
|
||||
unsigned char Value::asByte() const
|
||||
{
|
||||
|
|
|
@ -91,6 +91,12 @@ public:
|
|||
Value& operator= (const ValueMapIntKey& v);
|
||||
Value& operator= (ValueMapIntKey&& v);
|
||||
|
||||
// equal operator
|
||||
bool operator!= (const Value& v);
|
||||
bool operator!= (const Value& v) const;
|
||||
bool operator== (const Value& v);
|
||||
bool operator== (const Value& v) const;
|
||||
|
||||
unsigned char asByte() const;
|
||||
int asInt() const;
|
||||
float asFloat() const;
|
||||
|
|
|
@ -260,14 +260,6 @@ std::string WidgetPropertiesReader::getWidgetReaderClassName(Widget* widget)
|
|||
{
|
||||
readerName = "TextFieldReader";
|
||||
}
|
||||
else if (dynamic_cast<Layout*>(widget))
|
||||
{
|
||||
readerName = "LayoutReader";
|
||||
}
|
||||
else if (dynamic_cast<ScrollView*>(widget))
|
||||
{
|
||||
readerName = "ScrollViewReader";
|
||||
}
|
||||
else if (dynamic_cast<ListView*>(widget))
|
||||
{
|
||||
readerName = "ListViewReader";
|
||||
|
@ -276,6 +268,15 @@ std::string WidgetPropertiesReader::getWidgetReaderClassName(Widget* widget)
|
|||
{
|
||||
readerName = "PageViewReader";
|
||||
}
|
||||
else if (dynamic_cast<ScrollView*>(widget))
|
||||
{
|
||||
readerName = "ScrollViewReader";
|
||||
}
|
||||
|
||||
else if (dynamic_cast<Layout*>(widget))
|
||||
{
|
||||
readerName = "LayoutReader";
|
||||
}
|
||||
else if (dynamic_cast<Widget*>(widget))
|
||||
{
|
||||
readerName = "WidgetReader";
|
||||
|
|
|
@ -354,7 +354,7 @@ void Text::copySpecialProperties(Widget *widget)
|
|||
if (label)
|
||||
{
|
||||
setFontName(label->_fontName);
|
||||
setFontSize(label->_labelRenderer->getSystemFontSize());
|
||||
setFontSize(label->getFontSize());
|
||||
setString(label->getString());
|
||||
setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled);
|
||||
setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment());
|
||||
|
|
|
@ -111,8 +111,8 @@ void ActionTimelineTestLayer::onEnter()
|
|||
|
||||
// add title and subtitle
|
||||
std::string str = title();
|
||||
const char *pTitle = str.c_str();
|
||||
LabelTTF *label = LabelTTF::create(pTitle, "Arial", 18);
|
||||
const char *title = str.c_str();
|
||||
auto label = Label::createWithSystemFont(title, "Arial", 18);
|
||||
label->setColor(Color3B(0, 0, 0));
|
||||
addChild(label, 1, 10000);
|
||||
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 30) );
|
||||
|
@ -120,7 +120,7 @@ void ActionTimelineTestLayer::onEnter()
|
|||
std::string strSubtitle = subtitle();
|
||||
if( ! strSubtitle.empty() )
|
||||
{
|
||||
LabelTTF *l = LabelTTF::create(strSubtitle.c_str(), "Arial", 18);
|
||||
auto l = Label::createWithSystemFont(strSubtitle.c_str(), "Arial", 18);
|
||||
l->setColor(Color3B(0, 0, 0));
|
||||
addChild(l, 1, 10001);
|
||||
l->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 60) );
|
||||
|
@ -140,7 +140,7 @@ void ActionTimelineTestLayer::onEnter()
|
|||
|
||||
addChild(menu, 100);
|
||||
|
||||
setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
||||
setGLProgram(ShaderCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
||||
|
||||
}
|
||||
void ActionTimelineTestLayer::onExit()
|
||||
|
|
Loading…
Reference in New Issue