mirror of https://github.com/axmolengine/axmol.git
Merge pull request #4326 from dabingnn/develop_hotFix
[ci skip]Develop hot fix
This commit is contained in:
commit
bd00e6fabb
|
@ -328,22 +328,22 @@ void ParticleSystemQuad::updateQuadWithParticle(tParticle* particle, const Point
|
|||
void ParticleSystemQuad::postStep()
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);
|
||||
|
||||
// Option 1: Sub Data
|
||||
|
||||
// Option 1: Sub Data
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(_quads[0])*_totalParticles, _quads);
|
||||
|
||||
// Option 2: Data
|
||||
// glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * particleCount, quads_, GL_DYNAMIC_DRAW);
|
||||
|
||||
// Option 3: Orphaning + glMapBuffer
|
||||
// glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0])*_totalParticles, NULL, GL_STREAM_DRAW);
|
||||
// void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
|
||||
// memcpy(buf, _quads, sizeof(_quads[0])*_totalParticles);
|
||||
// glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
// Option 2: Data
|
||||
// glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * particleCount, quads_, GL_DYNAMIC_DRAW);
|
||||
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
// Option 3: Orphaning + glMapBuffer
|
||||
// glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0])*_totalParticles, NULL, GL_STREAM_DRAW);
|
||||
// void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
|
||||
// memcpy(buf, _quads, sizeof(_quads[0])*_totalParticles);
|
||||
// glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
}
|
||||
|
||||
// overriding draw method
|
||||
|
|
|
@ -127,7 +127,11 @@ void ParticleSystemQuadLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pP
|
|||
|
||||
void ParticleSystemQuadLoader::onHandlePropTypeTexture(Node * pNode, Node * pParent, const char * pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader) {
|
||||
if(strcmp(pPropertyName, PROPERTY_TEXTURE) == 0) {
|
||||
((ParticleSystemQuad *)pNode)->setTexture(pTexture2D);
|
||||
static_cast<ParticleSystemQuad*>(pNode)->setTexture(pTexture2D);
|
||||
if(pTexture2D)
|
||||
{
|
||||
static_cast<ParticleSystemQuad*>(pNode)->setBlendAdditive(true);
|
||||
}
|
||||
} else {
|
||||
NodeLoader::onHandlePropTypeTexture(pNode, pParent, pPropertyName, pTexture2D, ccbReader);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue