From 5c26faa20e17b50ee8e6aaea0a82680f8bbf9971 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 1 Apr 2004 13:47:02 +0000 Subject: [PATCH] Clean up several stray warnings that have accumulated. --- simgear/math/fastmath.cxx | 2 +- simgear/scene/material/mat.cxx | 4 +-- simgear/scene/material/mat.hxx | 2 +- simgear/scene/material/matlib.cxx | 50 ------------------------------- simgear/scene/model/animation.cxx | 6 ++-- simgear/scene/sky/oursun.cxx | 2 ++ simgear/scene/sky/oursun.hxx | 2 -- 7 files changed, 9 insertions(+), 59 deletions(-) diff --git a/simgear/math/fastmath.cxx b/simgear/math/fastmath.cxx index 19968109..51973cae 100644 --- a/simgear/math/fastmath.cxx +++ b/simgear/math/fastmath.cxx @@ -41,7 +41,7 @@ double fast_exp(double val) { const double a = 1048576/M_LN2; const double b_c = 1072632447; /* 1072693248 - 60801 */ - _eco.n.i = a*val + b_c; + _eco.n.i = (int)(a*val + b_c); return _eco.d; } diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 565b1f42..7b25faeb 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -90,7 +90,7 @@ SGMaterial::read_properties( const string &fg_root, const SGPropertyNode * props { // Gather the path(s) to the texture(s) vector textures = props->getChildren("texture"); - for (int i = 0; i < textures.size(); i++) + for (unsigned int i = 0; i < textures.size(); i++) { string tname = textures[i]->getStringValue(); if (tname == "") { @@ -227,7 +227,7 @@ SGMaterial::build_ssg_state( bool defer_tex_load ) { GLenum shade_model = GL_SMOOTH; - for (int i = 0; i < _status.size(); i++) + for (unsigned int i = 0; i < _status.size(); i++) { ssgSimpleState *state = new ssgSimpleState(); state->ref(); diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index 5f14a306..fd519415 100644 --- a/simgear/scene/material/mat.hxx +++ b/simgear/scene/material/mat.hxx @@ -217,7 +217,7 @@ private: vector<_internal_state> _status; // Round-robin counter - int _current_ptr; + unsigned int _current_ptr; // texture size double xsize, ysize; diff --git a/simgear/scene/material/matlib.cxx b/simgear/scene/material/matlib.cxx index 2165153d..22309400 100644 --- a/simgear/scene/material/matlib.cxx +++ b/simgear/scene/material/matlib.cxx @@ -174,56 +174,6 @@ static int gen_taxiway_dir_light_map( int r, int g, int b, int alpha ) { } -// generate the directional vasi light environment texture map -static int gen_vasi_light_map_old() { - const int env_tex_res = 256; - int half_res = env_tex_res / 2; - - static unsigned char env_map[env_tex_res][env_tex_res][4]; - GLuint tex_name; - - for ( int i = 0; i < env_tex_res; ++i ) { - for ( int j = 0; j < env_tex_res; ++j ) { - double x = (i - half_res) / (double)half_res; - double y = (j - half_res) / (double)half_res; - double dist = sqrt(x*x + y*y); - if ( dist > 1.0 ) { dist = 1.0; } - double bright = cos( dist * SGD_PI_2 ); - - // top half white, bottom half red - env_map[i][j][0] = 255; - if ( i > half_res ) { - // white - env_map[i][j][1] = 255; - env_map[i][j][2] = 255; - } else if ( i == half_res - 1 || i == half_res ) { - // pink - env_map[i][j][1] = 127; - env_map[i][j][2] = 127; - } else { - // red - env_map[i][j][1] = 0; - env_map[i][j][2] = 0; - } - env_map[i][j][3] = (int)(bright * 255); - } - } - - glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); - glGenTextures( 1, &tex_name ); - glBindTexture( GL_TEXTURE_2D, tex_name ); - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, env_tex_res, env_tex_res, 0, - GL_RGBA, GL_UNSIGNED_BYTE, env_map); - - return tex_name; -} - - // Load a library of material properties bool SGMaterialLib::load( const string &fg_root, const string& mpath ) { diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index ce687086..ac305760 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -498,14 +498,14 @@ SGBlendAnimation::SGBlendAnimation( SGPropertyNode *prop_root, SGPropertyNode_ptr props ) : SGAnimation(props, new ssgTransform), _prop((SGPropertyNode *)prop_root->getNode(props->getStringValue("property", "/null"), true)), + _table(read_interpolation_table(props)), + _prev_value(1.0), _offset(props->getDoubleValue("offset", 0.0)), _factor(props->getDoubleValue("factor", 1.0)), - _table(read_interpolation_table(props)), _has_min(props->hasValue("min")), _min(props->getDoubleValue("min", 0.0)), _has_max(props->hasValue("max")), - _max(props->getDoubleValue("max", 1.0)), - _prev_value(1.0) + _max(props->getDoubleValue("max", 1.0)) { } diff --git a/simgear/scene/sky/oursun.cxx b/simgear/scene/sky/oursun.cxx index 11c7f894..10c6129a 100644 --- a/simgear/scene/sky/oursun.cxx +++ b/simgear/scene/sky/oursun.cxx @@ -49,6 +49,8 @@ #include "sphere.hxx" #include "oursun.hxx" +static double sun_exp2_punch_through; + // Set up sun rendering call backs static int sgSunOrbPreDraw( ssgEntity *e ) { /* cout << endl << "Sun orb pre draw" << endl << "----------------" diff --git a/simgear/scene/sky/oursun.hxx b/simgear/scene/sky/oursun.hxx index 981c5441..3c33fd73 100644 --- a/simgear/scene/sky/oursun.hxx +++ b/simgear/scene/sky/oursun.hxx @@ -34,8 +34,6 @@ #include -static double sun_exp2_punch_through; - class SGSun { ssgTransform *sun_transform; -- 2.39.5