mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Merge remote-tracking branch 'youyou/v2.3.0' into v2.3.0
This commit is contained in:
@@ -35,7 +35,6 @@ void CCSlot::_onClear()
|
||||
_localMatrix.setIdentity();
|
||||
worldMatrix.setIdentity();
|
||||
_worldMatDirty = true;
|
||||
_textureScale = 1.0f;
|
||||
}
|
||||
|
||||
void CCSlot::disposeTriangles()
|
||||
@@ -109,7 +108,7 @@ void CCSlot::_addDisplay()
|
||||
|
||||
void CCSlot::_replaceDisplay(void* value, bool isArmatureDisplay)
|
||||
{
|
||||
_textureScale = 1.0f;
|
||||
|
||||
}
|
||||
|
||||
void CCSlot::_removeDisplay()
|
||||
@@ -224,8 +223,6 @@ void CCSlot::_updateFrame()
|
||||
vertexIndices[i] = intArray[currentVerticesData->offset + (unsigned)BinaryOffset::MeshVertexIndices + i];
|
||||
}
|
||||
|
||||
_textureScale = 1.0f;
|
||||
|
||||
const auto isSkinned = currentVerticesData->weight != nullptr;
|
||||
if (isSkinned)
|
||||
{
|
||||
@@ -373,7 +370,7 @@ void CCSlot::_updateMesh()
|
||||
const auto intArray = data->intArray;
|
||||
const auto floatArray = data->floatArray;
|
||||
const auto vertexCount = (std::size_t)intArray[verticesData->offset + (unsigned)BinaryOffset::MeshVertexCount];
|
||||
int vertexOffset = (std::size_t)intArray[verticesData->offset + (unsigned)BinaryOffset::MeshFloatOffset];
|
||||
std::size_t vertexOffset = (std::size_t)intArray[verticesData->offset + (unsigned)BinaryOffset::MeshFloatOffset];
|
||||
|
||||
if (vertexCount > triangles.vertCount) {
|
||||
return;
|
||||
@@ -430,27 +427,19 @@ void CCSlot::_updateMesh()
|
||||
void CCSlot::_updateTransform()
|
||||
{
|
||||
_localMatrix.m[0] = globalTransformMatrix.a;
|
||||
_localMatrix.m[1] = -globalTransformMatrix.b;
|
||||
_localMatrix.m[1] = globalTransformMatrix.b;
|
||||
_localMatrix.m[4] = -globalTransformMatrix.c;
|
||||
_localMatrix.m[5] = globalTransformMatrix.d;
|
||||
_localMatrix.m[5] = -globalTransformMatrix.d;
|
||||
|
||||
if (_childArmature)
|
||||
{
|
||||
_localMatrix.m[12] = globalTransformMatrix.tx;
|
||||
_localMatrix.m[13] = -globalTransformMatrix.ty;
|
||||
_localMatrix.m[13] = globalTransformMatrix.ty;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_textureScale != 1.0f)
|
||||
{
|
||||
_localMatrix.m[0] *= _textureScale;
|
||||
_localMatrix.m[1] *= _textureScale;
|
||||
_localMatrix.m[4] *= _textureScale;
|
||||
_localMatrix.m[5] *= _textureScale;
|
||||
}
|
||||
|
||||
_localMatrix.m[12] = globalTransformMatrix.tx - (globalTransformMatrix.a * _pivotX - globalTransformMatrix.c * _pivotY);
|
||||
_localMatrix.m[13] = -(globalTransformMatrix.ty - (globalTransformMatrix.b * _pivotX - globalTransformMatrix.d * _pivotY));
|
||||
_localMatrix.m[13] = globalTransformMatrix.ty - (globalTransformMatrix.b * _pivotX - globalTransformMatrix.d * _pivotY);
|
||||
}
|
||||
|
||||
_worldMatDirty = true;
|
||||
@@ -501,8 +490,8 @@ void CCSlot::_identityTransform()
|
||||
{
|
||||
_localMatrix.m[0] = 1.0f;
|
||||
_localMatrix.m[1] = 0.0f;
|
||||
_localMatrix.m[4] = 0.0f;
|
||||
_localMatrix.m[5] = 1.0f;
|
||||
_localMatrix.m[4] = -0.0f;
|
||||
_localMatrix.m[5] = -1.0f;
|
||||
_localMatrix.m[12] = 0.0f;
|
||||
_localMatrix.m[13] = 0.0f;
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ public:
|
||||
cocos2d::Color4B color;
|
||||
cocos2d::Rect boundsRect;
|
||||
private:
|
||||
float _textureScale = 1.0f;
|
||||
cocos2d::Mat4 _localMatrix;
|
||||
private:
|
||||
void disposeTriangles();
|
||||
|
||||
@@ -239,10 +239,10 @@ void Slot::_updateDisplayData()
|
||||
_pivotY += _helpPoint.y;
|
||||
}
|
||||
|
||||
//if (!DragonBones::yDown)
|
||||
//{
|
||||
if (!DragonBones::yDown)
|
||||
{
|
||||
_pivotY = (_textureData->rotated ? _textureData->region.width : _textureData->region.height) * scale - _pivotY;
|
||||
//}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ DRAGONBONES_NAMESPACE_BEGIN
|
||||
|
||||
const std::string DragonBones::VEISION = "5.6.300";
|
||||
|
||||
bool DragonBones::yDown = true;
|
||||
bool DragonBones::yDown = false;
|
||||
bool DragonBones::debug = false;
|
||||
bool DragonBones::debugDraw = false;
|
||||
bool DragonBones::webAssembly = false;
|
||||
|
||||
@@ -550,7 +550,7 @@ bool BaseFactory::replaceSlotDisplayList(const std::string& dragonBonesName, con
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BaseFactory::replaceSkin(Armature* armature, SkinData* skin, bool isOverride, const std::vector<std::string>* exclude) const
|
||||
bool BaseFactory::replaceSkin(Armature* armature, SkinData* skin, bool isOverride, const std::vector<std::string>& exclude) const
|
||||
{
|
||||
DRAGONBONES_ASSERT(armature && skin, "Arguments error.");
|
||||
|
||||
@@ -559,7 +559,7 @@ bool BaseFactory::replaceSkin(Armature* armature, SkinData* skin, bool isOverrid
|
||||
|
||||
for (const auto slot : armature->getSlots())
|
||||
{
|
||||
if (exclude != nullptr && std::find(exclude->cbegin(), exclude->cend(), slot->getName()) != exclude->cend())
|
||||
if (std::find(exclude.cbegin(), exclude.cend(), slot->getName()) != exclude.cend())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ public:
|
||||
* @version DragonBones 5.6
|
||||
* @language zh_CN
|
||||
*/
|
||||
virtual bool replaceSkin(Armature* armature, SkinData* skin, bool isOverride = false, const std::vector<std::string>* exclude = nullptr) const;
|
||||
virtual bool replaceSkin(Armature* armature, SkinData* skin, bool isOverride, const std::vector<std::string>& exclude) const;
|
||||
/**
|
||||
* - Replaces the existing animation data for a specific armature with the animation data for the specific armature data.
|
||||
* This enables you to make a armature template so that other armature without animations can share it's animations.
|
||||
@@ -559,7 +559,7 @@ public:
|
||||
* @deprecated
|
||||
* @language zh_CN
|
||||
*/
|
||||
inline bool changeSkin(Armature* armature, SkinData* skin, const std::vector<std::string>* exclude = nullptr) const
|
||||
inline bool changeSkin(Armature* armature, SkinData* skin, const std::vector<std::string>& exclude) const
|
||||
{
|
||||
return replaceSkin(armature, skin, false, exclude);
|
||||
}
|
||||
|
||||
@@ -5575,39 +5575,15 @@ static bool js_cocos2dx_dragonbones_BaseFactory_replaceSkin(se::State& s)
|
||||
const auto& args = s.args();
|
||||
size_t argc = args.size();
|
||||
CC_UNUSED bool ok = true;
|
||||
if (argc == 2) {
|
||||
dragonBones::Armature* arg0 = nullptr;
|
||||
dragonBones::SkinData* arg1 = nullptr;
|
||||
ok &= seval_to_native_ptr(args[0], &arg0);
|
||||
ok &= seval_to_native_ptr(args[1], &arg1);
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_replaceSkin : Error processing arguments");
|
||||
bool result = cobj->replaceSkin(arg0, arg1);
|
||||
ok &= boolean_to_seval(result, &s.rval());
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_replaceSkin : Error processing arguments");
|
||||
return true;
|
||||
}
|
||||
if (argc == 3) {
|
||||
dragonBones::Armature* arg0 = nullptr;
|
||||
dragonBones::SkinData* arg1 = nullptr;
|
||||
bool arg2;
|
||||
ok &= seval_to_native_ptr(args[0], &arg0);
|
||||
ok &= seval_to_native_ptr(args[1], &arg1);
|
||||
ok &= seval_to_boolean(args[2], &arg2);
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_replaceSkin : Error processing arguments");
|
||||
bool result = cobj->replaceSkin(arg0, arg1, arg2);
|
||||
ok &= boolean_to_seval(result, &s.rval());
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_replaceSkin : Error processing arguments");
|
||||
return true;
|
||||
}
|
||||
if (argc == 4) {
|
||||
dragonBones::Armature* arg0 = nullptr;
|
||||
dragonBones::SkinData* arg1 = nullptr;
|
||||
bool arg2;
|
||||
const std::vector<std::string>* arg3 = nullptr;
|
||||
std::vector<std::string> arg3;
|
||||
ok &= seval_to_native_ptr(args[0], &arg0);
|
||||
ok &= seval_to_native_ptr(args[1], &arg1);
|
||||
ok &= seval_to_boolean(args[2], &arg2);
|
||||
ok &= seval_to_native_ptr(args[3], &arg3);
|
||||
ok &= seval_to_std_vector_string(args[3], &arg3);
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_replaceSkin : Error processing arguments");
|
||||
bool result = cobj->replaceSkin(arg0, arg1, arg2, arg3);
|
||||
ok &= boolean_to_seval(result, &s.rval());
|
||||
@@ -6000,24 +5976,13 @@ static bool js_cocos2dx_dragonbones_BaseFactory_changeSkin(se::State& s)
|
||||
const auto& args = s.args();
|
||||
size_t argc = args.size();
|
||||
CC_UNUSED bool ok = true;
|
||||
if (argc == 2) {
|
||||
dragonBones::Armature* arg0 = nullptr;
|
||||
dragonBones::SkinData* arg1 = nullptr;
|
||||
ok &= seval_to_native_ptr(args[0], &arg0);
|
||||
ok &= seval_to_native_ptr(args[1], &arg1);
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_changeSkin : Error processing arguments");
|
||||
bool result = cobj->changeSkin(arg0, arg1);
|
||||
ok &= boolean_to_seval(result, &s.rval());
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_changeSkin : Error processing arguments");
|
||||
return true;
|
||||
}
|
||||
if (argc == 3) {
|
||||
dragonBones::Armature* arg0 = nullptr;
|
||||
dragonBones::SkinData* arg1 = nullptr;
|
||||
const std::vector<std::string>* arg2 = nullptr;
|
||||
std::vector<std::string> arg2;
|
||||
ok &= seval_to_native_ptr(args[0], &arg0);
|
||||
ok &= seval_to_native_ptr(args[1], &arg1);
|
||||
ok &= seval_to_native_ptr(args[2], &arg2);
|
||||
ok &= seval_to_std_vector_string(args[2], &arg2);
|
||||
SE_PRECONDITION2(ok, false, "js_cocos2dx_dragonbones_BaseFactory_changeSkin : Error processing arguments");
|
||||
bool result = cobj->changeSkin(arg0, arg1, arg2);
|
||||
ok &= boolean_to_seval(result, &s.rval());
|
||||
|
||||
Reference in New Issue
Block a user