From: fredb Date: Sat, 31 May 2008 10:02:43 +0000 (+0000) Subject: Use bool instead of int to represent boolean values X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=373a0e4a7d59c3f8ed1d66ff6145de61ecd46279;p=simgear.git Use bool instead of int to represent boolean values --- diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 3da8824a..2d488f34 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -303,7 +303,7 @@ void SGMaterial::set_state( osg::StateSet *s ) } void SGMaterial::assignTexture( osg::StateSet *state, const std::string &fname, - int _wrapu, int _wrapv, int _mipmap ) + bool _wrapu, bool _wrapv, bool _mipmap ) { osg::Texture2D* texture = SGLoadTexture2D(fname, 0, _wrapu, _wrapv, mipmap ? -1 : 0); diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index 96a33a3a..6d0c89af 100644 --- a/simgear/scene/material/mat.hxx +++ b/simgear/scene/material/mat.hxx @@ -299,7 +299,7 @@ private: bool wrapu, wrapv; // use mipmapping? - int mipmap; + bool mipmap; // coverage of night lighting. double light_coverage; @@ -359,7 +359,7 @@ private: void build_state( bool defer_tex_load ); void set_state( osg::StateSet *s ); - void assignTexture( osg::StateSet *state, const std::string &fname, int _wrapu = TRUE, int _wrapv = TRUE, int _mipmap = TRUE ); + void assignTexture( osg::StateSet *state, const std::string &fname, bool _wrapu = true, bool _wrapv = true, bool _mipmap = true ); }; diff --git a/simgear/scene/tgdb/TileEntry.cxx b/simgear/scene/tgdb/TileEntry.cxx index 2782c023..ea0c73e4 100644 --- a/simgear/scene/tgdb/TileEntry.cxx +++ b/simgear/scene/tgdb/TileEntry.cxx @@ -237,7 +237,7 @@ bool TileEntry::obj_load( const string& path, if (node) geometry->addChild(node); - return node; + return node != 0; } diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index 0d62cac4..4f34f79a 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -63,7 +63,7 @@ static bool print_openal_error(const string &s = "unknown") { } else { SG_LOG( SG_GENERAL, SG_ALERT, "Unhandled error code = " << error ); } - return error; + return error != 0; } // empry constructor