Commit 422e0030 authored by Jan Möbius's avatar Jan Möbius
Browse files

Make the redraw disable function a counter (might be used by multiple plugins at a time )

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4181 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 35c9a1a4
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "GlobalOptions.hh" #include "GlobalOptions.hh"
#include <stdlib.h> #include <stdlib.h>
#include <iostream>
#include <ACG/Scenegraph/DrawModes.hh> #include <ACG/Scenegraph/DrawModes.hh>
...@@ -115,7 +116,7 @@ static int maxFrameRate_ = 35; ...@@ -115,7 +116,7 @@ static int maxFrameRate_ = 35;
static uint standardDrawMode_ = ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED; static uint standardDrawMode_ = ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED;
/// Store the disableRedraw_ mode /// Store the disableRedraw_ mode
static bool redrawDisabled_ = false; static int redrawDisabled_ = 0;
/// Set if a drawMode Menu should always be in the context menu /// Set if a drawMode Menu should always be in the context menu
static bool drawModesInContextMenu_ = true; static bool drawModesInContextMenu_ = true;
...@@ -470,11 +471,17 @@ uint standardDrawMode(){ ...@@ -470,11 +471,17 @@ uint standardDrawMode(){
} }
void redrawDisabled( bool disable ){ void redrawDisabled( bool disable ){
redrawDisabled_ = disable; if ( disable )
redrawDisabled_++;
else
if ( redrawDisabled_ == 0 )
std::cerr << "Mismatch of redraw enable/disable!!" << std::endl;
else
redrawDisabled_--;
} }
bool redrawDisabled( ){ bool redrawDisabled( ){
return redrawDisabled_; return (redrawDisabled_ > 0);
} }
bool drawModesInContextMenu() { bool drawModesInContextMenu() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment