| 220 | } |
| 221 | |
| 222 | void ParticleSystemQuad::setTextureWithRect(Texture2D* texture, const Rect& rect) |
| 223 | { |
| 224 | // Only update the texture if is different from the current one |
| 225 | if (!_texture || texture->getBackendTexture() != _texture->getBackendTexture()) |
| 226 | { |
| 227 | ParticleSystem::setTexture(texture); |
| 228 | |
| 229 | auto programState = _quadCommand.getPipelineDescriptor().programState; |
| 230 | programState->setTexture(_texture->getBackendTexture()); |
| 231 | } |
| 232 | |
| 233 | this->initTexCoordsWithRect(rect); |
| 234 | } |
| 235 | |
| 236 | void ParticleSystemQuad::setTexture(Texture2D* texture) |
| 237 | { |