Browse Source

fix edge condition when there are no transforms in the scene graph

David Rose 20 years ago
parent
commit
3172d9916b

+ 2 - 0
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;

+ 1 - 1
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;
 

+ 0 - 1
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;

+ 0 - 1
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

+ 0 - 1
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();

+ 0 - 1
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;