From c8991502bf6ef3735f79f665118bb1fab8ba6cfc Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 12 May 2006 18:21:19 +0000 Subject: [PATCH] fix camera.set_active() --- panda/src/display/graphicsEngine.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index fb6462d36e..9a6444e839 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -271,7 +271,7 @@ make_output(GraphicsPipe *pipe, int x_size, int y_size, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) { - + // The code here is tricky because the gsg that is passed in // might be in the uninitialized state. As a result, // pipe::make_output may not be able to tell which DirectX @@ -351,7 +351,7 @@ make_output(GraphicsPipe *pipe, (prop.get_aux_float() == 0)) { can_use_parasite = true; } - + // If parasite buffers are preferred, then try a parasite first. if ((prefer_parasite_buffer) && @@ -404,7 +404,7 @@ make_output(GraphicsPipe *pipe, } // Could not create a window to the user's specs. - + return NULL; } @@ -1018,7 +1018,10 @@ cull_and_draw_together(GraphicsOutput *win, DisplayRegion *dr, gsg->prepare_display_region(dr_reader, dr_reader->get_stereo_channel()); PT(SceneSetup) scene_setup = setup_scene(gsg, dr_reader); - if (!gsg->set_scene(scene_setup)) { + if (scene_setup == (SceneSetup *)NULL) { + // Never mind. + + } else if (!gsg->set_scene(scene_setup)) { // The scene or lens is inappropriate somehow. display_cat.error() << gsg->get_type() << " cannot render scene with specified lens.\n"; @@ -1132,13 +1135,12 @@ cull_to_bins(GraphicsOutput *win, DisplayRegion *dr, Thread *current_thread) { BinCullHandler cull_handler(cull_result); do_cull(&cull_handler, scene_setup, gsg, current_thread); - { - PStatTimer timer(_cull_sort_pcollector, current_thread); - cull_result->finish_cull(scene_setup, current_thread); - // Save the results for next frame. - dr->set_cull_result(cull_result, scene_setup, current_thread); - } + PStatTimer timer(_cull_sort_pcollector, current_thread); + cull_result->finish_cull(scene_setup, current_thread); } + + // Save the results for next frame. + dr->set_cull_result(cull_result, scene_setup, current_thread); } ////////////////////////////////////////////////////////////////////