Refine code

This commit is contained in:
halx99 2020-08-19 12:10:29 +08:00
parent 82ceee2fdb
commit e9ba5420ef
1 changed files with 3 additions and 4 deletions

View File

@ -1911,8 +1911,7 @@ void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
continue;
auto &batch = _batchCommands[i++];
auto &&commands = batch.getCommandArray();
for (auto command : commands)
for (auto command : batch.getCommandArray())
{
auto *programState = command->getPipelineDescriptor().programState;
Vec4 textColor(_textColorF.r, _textColorF.g, _textColorF.b, _textColorF.a);
@ -1932,7 +1931,7 @@ void Label::updateBlendState()
setOpacityModifyRGB(_blendFunc != BlendFunc::ALPHA_NON_PREMULTIPLIED);
for(auto &batch: _batchCommands)
{
for(auto *command : batch.getCommandArray()) {
for(auto command : batch.getCommandArray()) {
auto & blendDescriptor = command->getPipelineDescriptor().blendDescriptor;
updateBlend(blendDescriptor, _blendFunc);
}