Skip to content

Commit 51e5cf7

Browse files
committed
fixed particle system being rendered more than once
1 parent 8a21648 commit 51e5cf7

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/Audio.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
#include "Audio.h"
2-
3-
// this is a test

src/Indicator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ void Indicator :: renderSelf(IPartitioner* partitioner, unsigned int flags) cons
3838
glEnd();
3939

4040
//glDisable(GL_POINT_SPRITE);
41+
4142
glDisable(GL_BLEND);
42-
4343
glDepthMask(GL_TRUE);
4444

4545
Renderer::get().lighting(Renderer::BIND_LIGHTING);

src/Node.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,12 @@ Node* Node ::add(Node* n)
426426
Node* Node ::add(shared_ptr<Node> n)
427427
{
428428
ASSERT(n);
429-
ASSERT(this != n.get());
430-
//ASSERT(n->getParent() == NULL); // node we're trying to add has no existing parent
429+
ASSERT(this != n.get()); // can't add to self
430+
ASSERT(n->getParent() == NULL); // node we're trying to add has no existing parent
431431

432432
// do similar checks in case assertions are disabled
433-
if(this == n.get())
434-
return NULL; // can't add node to self
433+
//if(this == n.get())
434+
// return NULL; // can't add node to self
435435
//if(find(n))
436436
// return false; // node already connected
437437
//if(m_pParent != NULL)

src/ParticleSystem.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ void ParticleSystem :: logicSelf(unsigned int advance)
169169

170170
void ParticleSystem :: renderSelf(IPartitioner* partitioner, unsigned int flags) const
171171
{
172+
if(!(flags & RENDER_AMBIENT_PASS))
173+
return;
174+
172175
Renderer::get().shaders(Renderer::UNBIND_SHADERS);
173176
Renderer::get().lighting(Renderer::UNBIND_LIGHTING);
174177

src/Scene.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool Scene :: load(string fn)
8484
{
8585
clear();
8686

87-
if(stringEndsWith<string>(boost::to_upper_copy(fn), ".FML"))
87+
if(stringEndsWith<string>(boost::to_lower_copy(fn), ".fml"))
8888
return loadFML(fn);
8989
return loadAI(fn);
9090

0 commit comments

Comments
 (0)