Commit f6251b9c authored by Jan Möbius's avatar Jan Möbius

Fixed a lot of cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13296 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e18893f0
...@@ -256,7 +256,7 @@ void GLState::clearBuffers () ...@@ -256,7 +256,7 @@ void GLState::clearBuffers ()
glScissor( left_,bottom_,width_,height_ ); glScissor( left_,bottom_,width_,height_ );
// Clear restricted region // Clear restricted region
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
// Reset to originalsettings // Reset to originalsettings
glScissor( origBox[0], origBox[1], origBox[2], origBox[3] ); glScissor( origBox[0], origBox[1], origBox[2], origBox[3] );
......
...@@ -66,7 +66,9 @@ namespace ACG { ...@@ -66,7 +66,9 @@ namespace ACG {
GLTrackball:: GLTrackball::
GLTrackball(GLState& _state) GLTrackball(GLState& _state)
: glstate_(_state), : glstate_(_state),
center_(0,0,0) center_(0,0,0) ,
last_point_ok_(false),
action_(ROTATION)
{ {
for (int i=0; i<10; ++i) for (int i=0; i<10; ++i)
button_down_[i] = false; button_down_[i] = false;
......
...@@ -67,7 +67,9 @@ namespace ACG { ...@@ -67,7 +67,9 @@ namespace ACG {
GlutExaminer:: GlutExaminer::
GlutExaminer(const char* _title, int _width, int _height) GlutExaminer(const char* _title, int _width, int _height)
: GlutViewer(_title, _width, _height), : GlutViewer(_title, _width, _height),
trackball_(glstate_) trackball_(glstate_),
center_(Vec3f(0.0,0.0,0.0)),
radius_(1.0)
{ {
init(); init();
} }
......
...@@ -111,8 +111,11 @@ public: ...@@ -111,8 +111,11 @@ public:
unsigned int slices, stacks; unsigned int slices, stacks;
// Constructor // Constructor
Primitive() Primitive(GlutPrimitiveType _t)
{ {
// Set the type
type = _t;
// default axis is negative z // default axis is negative z
axis = Vec3d(0,0,1); axis = Vec3d(0,0,1);
...@@ -175,8 +178,7 @@ public: ...@@ -175,8 +178,7 @@ public:
setColor_(true) setColor_(true)
{ {
// add a single primitive of the given type // add a single primitive of the given type
Primitive p; Primitive p(_type);
p.type = _type;
primitives_.push_back(p); primitives_.push_back(p);
} }
......
...@@ -166,7 +166,6 @@ private: ...@@ -166,7 +166,6 @@ private:
/// Contains all orientations to draw /// Contains all orientations to draw
unsigned int orientation_; unsigned int orientation_;
bool ok_;
}; };
......
...@@ -91,7 +91,7 @@ TextureNode::TextureNode( BaseNode* _parent, ...@@ -91,7 +91,7 @@ TextureNode::TextureNode( BaseNode* _parent,
TextureNode::~TextureNode() TextureNode::~TextureNode()
{ {
for (std::vector<TextureInfo>::iterator texturesIt = textures_.begin(); texturesIt != textures_.end(); texturesIt++) { for (std::vector<TextureInfo>::iterator texturesIt = textures_.begin(); texturesIt != textures_.end(); ++texturesIt) {
if ( glIsTexture( texturesIt->id ) ) { if ( glIsTexture( texturesIt->id ) ) {
glDeleteTextures( 1, &(texturesIt->id) ); glDeleteTextures( 1, &(texturesIt->id) );
} }
......
...@@ -137,6 +137,8 @@ TranslationManipulatorNode( BaseNode* _parent, const std::string& _name ) ...@@ -137,6 +137,8 @@ TranslationManipulatorNode( BaseNode* _parent, const std::string& _name )
sphere_(0), sphere_(0),
manipulator_radius_(20.0), manipulator_radius_(20.0),
manipulator_height_(20), manipulator_height_(20),
set_manipulator_radius_(1.0),
set_manipulator_height_(1.0),
manipulator_slices_(10), manipulator_slices_(10),
manipulator_stacks_(10), manipulator_stacks_(10),
any_axis_clicked_(false), any_axis_clicked_(false),
......
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