From 747f247745756869f79de460509236c0b36c8d3e Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 24 Jul 2001 23:55:10 +0000 Subject: [PATCH] keep attrib and trans separate --- panda/src/pgui/pgEntry.cxx | 7 ++++--- panda/src/pgui/pgEntry.h | 3 ++- panda/src/pgui/pgItem.cxx | 7 ++++--- panda/src/pgui/pgItem.h | 3 ++- panda/src/pgui/pgTop.cxx | 4 +--- panda/src/pgui/pgWaitBar.cxx | 5 +++-- panda/src/pgui/pgWaitBar.h | 3 ++- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/panda/src/pgui/pgEntry.cxx b/panda/src/pgui/pgEntry.cxx index 894d84bd8c..4fd0fbd49d 100644 --- a/panda/src/pgui/pgEntry.cxx +++ b/panda/src/pgui/pgEntry.cxx @@ -132,8 +132,9 @@ make_copy() const { //////////////////////////////////////////////////////////////////// void PGEntry:: draw_item(PGTop *top, GraphicsStateGuardian *gsg, - const AllAttributesWrapper &attrib) { - PGItem::draw_item(top, gsg, attrib); + const AllAttributesWrapper &attrib, + const AllTransitionsWrapper &trans) { + PGItem::draw_item(top, gsg, attrib, trans); update_text(); update_cursor(); @@ -143,7 +144,7 @@ draw_item(PGTop *top, GraphicsStateGuardian *gsg, // of the text. DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); drt.set_view_frustum_cull(false); - drt.traverse(_text_render_root, attrib, AllTransitionsWrapper()); + drt.traverse(_text_render_root, attrib, trans); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgui/pgEntry.h b/panda/src/pgui/pgEntry.h index e4d4de9101..3e7bbeed1c 100644 --- a/panda/src/pgui/pgEntry.h +++ b/panda/src/pgui/pgEntry.h @@ -46,7 +46,8 @@ public: virtual Node *make_copy() const; virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, - const AllAttributesWrapper &attrib); + const AllAttributesWrapper &attrib, + const AllTransitionsWrapper &trans); virtual void press(const MouseWatcherParameter ¶m); diff --git a/panda/src/pgui/pgItem.cxx b/panda/src/pgui/pgItem.cxx index 233d9d557a..c99a0dda51 100644 --- a/panda/src/pgui/pgItem.cxx +++ b/panda/src/pgui/pgItem.cxx @@ -200,7 +200,8 @@ activate_region(PGTop *, const LMatrix4f &transform, int sort) { //////////////////////////////////////////////////////////////////// void PGItem:: draw_item(PGTop *top, GraphicsStateGuardian *gsg, - const AllAttributesWrapper &attrib) { + const AllAttributesWrapper &attrib, + const AllTransitionsWrapper &trans) { if (has_state_def(get_state())) { // This item has a current state definition that we should use // to render the item. @@ -211,11 +212,11 @@ draw_item(PGTop *top, GraphicsStateGuardian *gsg, // of the subgraph. DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); drt.set_view_frustum_cull(false); - drt.traverse(def, attrib, AllTransitionsWrapper()); + drt.traverse(def, attrib, trans); } else { QuickRenderTraverser qrt(gsg, RenderRelation::get_class_type()); - qrt.traverse(def, attrib, AllTransitionsWrapper()); + qrt.traverse(def, attrib, trans); } } } diff --git a/panda/src/pgui/pgItem.h b/panda/src/pgui/pgItem.h index 8e80d2a81b..be1ad1159f 100644 --- a/panda/src/pgui/pgItem.h +++ b/panda/src/pgui/pgItem.h @@ -72,7 +72,8 @@ public: INLINE PGMouseWatcherRegion *get_region() const; virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, - const AllAttributesWrapper &attrib); + const AllAttributesWrapper &attrib, + const AllTransitionsWrapper &trans); virtual void enter(const MouseWatcherParameter ¶m); virtual void exit(const MouseWatcherParameter ¶m); diff --git a/panda/src/pgui/pgTop.cxx b/panda/src/pgui/pgTop.cxx index a86d4b876b..42825c6640 100644 --- a/panda/src/pgui/pgTop.cxx +++ b/panda/src/pgui/pgTop.cxx @@ -206,9 +206,7 @@ r_traverse(Node *node, const ArcChain &chain) { AllTransitionsWrapper complete_trans; wrt(pgi, chain.begin(), chain.end(), this, complete_trans, RenderRelation::get_class_type()); - AllAttributesWrapper render_state; - render_state.apply_from(_attrib, complete_trans); - pgi->draw_item(this, _gsg, render_state); + pgi->draw_item(this, _gsg, _attrib, complete_trans); } else if (node->is_of_type(GeomNode::get_class_type())) { _gsg->_geom_nodes_pcollector.add_level(1); diff --git a/panda/src/pgui/pgWaitBar.cxx b/panda/src/pgui/pgWaitBar.cxx index dda2dc899b..33e351fffe 100644 --- a/panda/src/pgui/pgWaitBar.cxx +++ b/panda/src/pgui/pgWaitBar.cxx @@ -96,9 +96,10 @@ make_copy() const { //////////////////////////////////////////////////////////////////// void PGWaitBar:: draw_item(PGTop *top, GraphicsStateGuardian *gsg, - const AllAttributesWrapper &attrib) { + const AllAttributesWrapper &attrib, + const AllTransitionsWrapper &trans) { update(); - PGItem::draw_item(top, gsg, attrib); + PGItem::draw_item(top, gsg, attrib, trans); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgui/pgWaitBar.h b/panda/src/pgui/pgWaitBar.h index a48d3258b0..4bc6b767d0 100644 --- a/panda/src/pgui/pgWaitBar.h +++ b/panda/src/pgui/pgWaitBar.h @@ -42,7 +42,8 @@ public: virtual Node *make_copy() const; virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, - const AllAttributesWrapper &attrib); + const AllAttributesWrapper &attrib, + const AllTransitionsWrapper &trans); PUBLISHED: void setup(float width, float height, float range);