Merge pull request #14674 from super626/tilemap

fix fast tilemap blend function
This commit is contained in:
XiaoYang 2015-12-15 17:23:53 +08:00
commit 727d857c88
1 changed files with 2 additions and 1 deletions

View File

@ -177,7 +177,8 @@ void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
if(iter.second->getCount() > 0)
{
auto& cmd = _renderCommands[index++];
cmd.init(iter.first, _texture->getName(), getGLProgramState(), BlendFunc::ALPHA_NON_PREMULTIPLIED, iter.second, _modelViewTransform, flags);
auto blendfunc = _texture->hasPremultipliedAlpha() ? BlendFunc::ALPHA_PREMULTIPLIED : BlendFunc::ALPHA_NON_PREMULTIPLIED;
cmd.init(iter.first, _texture->getName(), getGLProgramState(), blendfunc, iter.second, _modelViewTransform, flags);
renderer->addCommand(&cmd);
}
}