From 78bc1e00c31dbf885c4e23cf4161e2160109affa Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 19 Jun 2001 00:35:36 +0000 Subject: [PATCH] export particle effects properly --- panda/src/graph/arcChain.h | 2 +- .../particlesystem/spriteParticleRenderer.cxx | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/panda/src/graph/arcChain.h b/panda/src/graph/arcChain.h index e0207cdd81..53c95d26ff 100644 --- a/panda/src/graph/arcChain.h +++ b/panda/src/graph/arcChain.h @@ -120,7 +120,7 @@ protected: // This is a supporting class for iterating through all the arcs via // begin() .. end(). - class ForwardIterator { + class EXPCL_PANDA ForwardIterator { public: INLINE_GRAPH ForwardIterator(ArcComponent *comp = NULL); INLINE_GRAPH NodeRelation *operator * () const; diff --git a/panda/src/particlesystem/spriteParticleRenderer.cxx b/panda/src/particlesystem/spriteParticleRenderer.cxx index 34e2f39a1d..83add609c9 100644 --- a/panda/src/particlesystem/spriteParticleRenderer.cxx +++ b/panda/src/particlesystem/spriteParticleRenderer.cxx @@ -118,7 +118,9 @@ set_from_node(const NodePath &node_path) { // Get the texture off the node. We use wrt() to determine the net // texture that's applied, based on all the arcs from the root; not // just the bottom arc. - Texture *tex; + Texture *tex = (Texture *)NULL; + + /* NodeTransitionWrapper ntw(TextureTransition::get_class_type()); wrt(gnode, geom_node_path.begin(), geom_node_path.end(), (Node *)NULL, ntw, RenderRelation::get_class_type()); @@ -128,6 +130,19 @@ set_from_node(const NodePath &node_path) { tex = tt->get_texture(); } } + */ + // Shoot, wrt() doesn't work across DLL's. Just walk through the + // arcs. + NodePath::iterator npi; + for (npi = geom_node_path.begin(); npi != geom_node_path.end(); ++npi) { + NodeRelation *arc = (*npi); + const TextureTransition *tt; + if (get_transition_into(tt, arc)) { + if (tt->is_on()) { + tex = tt->get_texture(); + } + } + } if (tex == (Texture *)NULL) { particlesystem_cat.error()