mirror of https://github.com/axmolengine/axmol.git
Mesh* Sprite3D::getMesh() should return nullptr when _meshes.empty() is true (#16711)
This commit is contained in:
parent
c0e1e91373
commit
ed2dac1ba4
|
@ -920,6 +920,15 @@ std::vector<Mesh*> Sprite3D::getMeshArrayByName(const std::string& name) const
|
||||||
return meshes;
|
return meshes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Mesh* Sprite3D::getMesh() const
|
||||||
|
{
|
||||||
|
if(_meshes.empty())
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return _meshes.at(0);
|
||||||
|
}
|
||||||
|
|
||||||
MeshSkin* Sprite3D::getSkin() const
|
MeshSkin* Sprite3D::getSkin() const
|
||||||
{
|
{
|
||||||
for (const auto& it : _meshes) {
|
for (const auto& it : _meshes) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ public:
|
||||||
std::vector<Mesh*> getMeshArrayByName(const std::string& name) const;
|
std::vector<Mesh*> getMeshArrayByName(const std::string& name) const;
|
||||||
|
|
||||||
/**get mesh*/
|
/**get mesh*/
|
||||||
Mesh* getMesh() const { return _meshes.at(0); }
|
Mesh* getMesh() const;
|
||||||
|
|
||||||
/** get mesh count */
|
/** get mesh count */
|
||||||
ssize_t getMeshCount() const { return _meshes.size(); }
|
ssize_t getMeshCount() const { return _meshes.size(); }
|
||||||
|
|
Loading…
Reference in New Issue