void ParticleSystemQuad::updateTexCoords() { if (_texture) { const Size& s = _texture->getContentSize(); initTexCoordsWithRect(Rect(0, 0, s.width, s.height)); } }
void ParticleSystemQuad::setTexture(Texture2D *t, const fzRect& rect) { // Only update the texture if is different from the current one if( t->getName() != p_texture->getName() ) { ParticleSystem::setTexture(t); initTexCoordsWithRect(rect); } }
ParticleSystemQuad::ParticleSystemQuad(fzUInt number, Texture2D *texture) : ParticleSystem(number, texture) { // allo cating quads p_quads = new fzC4_T2_V2_Quad[getTotalParticles()]; // initialize only once the texCoords and the indices initTexCoordsWithRect(fzRect(FZPointZero, p_texture->getContentSize())); initIndices(); #if FZ_GL_SHADERS setGLProgram(kFZShader_mat_aC4_TEX); #endif }