From 3172d9916b9a7a2b95383cc6d4354f6be920fa56 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 12 Aug 2005 18:47:04 +0000 Subject: [PATCH] fix edge condition when there are no transforms in the scene graph --- panda/src/display/graphicsStateGuardian.cxx | 2 ++ panda/src/display/graphicsStateGuardian.h | 2 +- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 1 - panda/src/dxgsg8/dxGraphicsStateGuardian8.h | 1 - panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 1 - panda/src/glstuff/glGraphicsStateGuardian_src.h | 1 - 6 files changed, 3 insertions(+), 5 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 5dee2ef839..25f76ab0f5 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -232,6 +232,7 @@ set_coordinate_system(CoordinateSystem cs) { _coordinate_system)); } _internal_transform = _cs_transform->compose(_external_transform); + _transform_stale = true; } //////////////////////////////////////////////////////////////////// @@ -280,6 +281,7 @@ reset() { _has_scene_graph_color = false; _scene_graph_color_stale = false; + _transform_stale = true; _color_blend_involves_color_scale = false; _texture_involves_color_scale = false; _vertex_colors_enabled = true; diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index c3c27e7a9b..3182295fc6 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -327,12 +327,12 @@ protected: Colorf _scene_graph_color; bool _has_scene_graph_color; bool _scene_graph_color_stale; + bool _transform_stale; bool _color_blend_involves_color_scale; bool _texture_involves_color_scale; bool _vertex_colors_enabled; bool _lighting_enabled; bool _clip_planes_enabled; - bool _color_scale_enabled; LVecBase4f _current_color_scale; diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index e623dc23a9..4cd209421a 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -86,7 +86,6 @@ DXGraphicsStateGuardian8(const FrameBufferProperties &properties) : _d3d_device = NULL; _dx_is_ready = false; - _transform_stale = false; _vertex_blending_enabled = false; _overlay_windows_supported = false; _tex_stats_retrieval_impossible = false; diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h index 618eca96ba..7fe7fd0533 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h @@ -192,7 +192,6 @@ protected: bool _dx_is_ready; HRESULT _last_testcooplevel_result; - bool _transform_stale; bool _vertex_blending_enabled; RenderBuffer::Type _cur_read_pixel_buffer; // source for copy_pixel_buffer operation diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 344be6bf50..3617a37308 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -787,7 +787,6 @@ reset() { _point_size = 1.0f; _point_perspective = false; - _transform_stale = false; _vertex_blending_enabled = false; report_my_gl_errors(); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 578e2c940f..0b8a9eb1bc 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -298,7 +298,6 @@ protected: float _point_size; bool _point_perspective; - bool _transform_stale; bool _vertex_blending_enabled; CPT(DisplayRegion) _actual_display_region;