Merge pull request #162 from tangziwen/v3

use dummy texture even if in release mode
This commit is contained in:
XiaoYang 2014-11-19 17:19:15 +08:00
commit 17e45981f6
1 changed files with 7 additions and 5 deletions

View File

@ -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())