mirror of https://github.com/axmolengine/axmol.git
Merge pull request #162 from tangziwen/v3
use dummy texture even if in release mode
This commit is contained in:
commit
17e45981f6
|
@ -518,8 +518,7 @@ void Sprite3D::removeAllAttachNode()
|
|||
}
|
||||
_attachments.clear();
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if (!defined NDEBUG) || (defined CC_MODEL_VIEWER)
|
||||
//Generate a dummy texture when the texture file is missing
|
||||
static Texture2D * getDummyTexture()
|
||||
{
|
||||
|
@ -564,9 +563,8 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
|
|||
}
|
||||
auto programstate = mesh->getGLProgramState();
|
||||
auto& meshCommand = mesh->getMeshCommand();
|
||||
#ifdef NDEBUG
|
||||
GLuint textureID = mesh->getTexture() ? mesh->getTexture()->getName() : 0;
|
||||
#else
|
||||
|
||||
#if (!defined NDEBUG) || (defined CC_MODEL_VIEWER)
|
||||
GLuint textureID = 0;
|
||||
if(mesh->getTexture())
|
||||
{
|
||||
|
@ -577,7 +575,11 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
|
|||
mesh->setTexture(texture);
|
||||
textureID = texture->getName();
|
||||
}
|
||||
|
||||
#else
|
||||
GLuint textureID = mesh->getTexture() ? mesh->getTexture()->getName() : 0;
|
||||
#endif
|
||||
|
||||
float globalZ = _globalZOrder;
|
||||
bool isTransparent = (mesh->_isTransparent || color.a < 1.f);
|
||||
if (isTransparent && Camera::getVisitingCamera())
|
||||
|
|
Loading…
Reference in New Issue