From 6c708129289b73dc3281ba538233a4e87085473c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 9 Nov 2005 10:41:52 +0000 Subject: [PATCH] Fixed warnings. --- examples/osgdelaunay/osgdelaunay.cpp | 2 +- src/osg/Texture.cpp | 2 +- src/osgPlugins/gdal/ReaderWriterGDAL.cpp | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/osgdelaunay/osgdelaunay.cpp b/examples/osgdelaunay/osgdelaunay.cpp index f39dfab39..b0572e9a6 100644 --- a/examples/osgdelaunay/osgdelaunay.cpp +++ b/examples/osgdelaunay/osgdelaunay.cpp @@ -1125,7 +1125,7 @@ osg::DrawArrays* LinearConstraint::makeRoad(void ) const } -osg::Vec3Array *LinearConstraint::getRoadNormals(const osg::Vec3Array *points) const +osg::Vec3Array *LinearConstraint::getRoadNormals(const osg::Vec3Array*) const { osg::Vec3Array *nrms=new osg::Vec3Array; for(unsigned int i=0;i<_midline->size();i++) { diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 95efffd08..d62e406a2 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -346,7 +346,7 @@ Texture::Texture(): _internalFormatMode(USE_IMAGE_DATA_FORMAT), _internalFormat(0), _sourceFormat(0), - _sourceType(GL_UNSIGNED_BYTE), + _sourceType(0), _use_shadow_comparison(false), _shadow_compare_func(LEQUAL), _shadow_texture_mode(LUMINANCE), diff --git a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp index b98c4cc27..8303e6cf7 100644 --- a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +++ b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp @@ -462,17 +462,17 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter G = Hue_2_RGB( var_1, var_2, H ); B = Hue_2_RGB( var_1, var_2, H - ( 1 / 3 ) ); } - imageData[4*i+0] = R; - imageData[4*i+1] = G; - imageData[4*i+2] = B; - imageData[4*i+3] = 1.0f; + imageData[4*i+0] = static_cast(R*255.0f); + imageData[4*i+1] = static_cast(G*255.0f); + imageData[4*i+2] = static_cast(B*255.0f); + imageData[4*i+3] = static_cast(255.0f); } else if (interp == GPI_Gray) { - imageData[4*i+0] = colorEntry->c1; - imageData[4*i+1] = colorEntry->c1; - imageData[4*i+2] = colorEntry->c1; - imageData[4*i+3] = 1.0f; + imageData[4*i+0] = static_cast(colorEntry->c1*255.0f); + imageData[4*i+1] = static_cast(colorEntry->c1*255.0f); + imageData[4*i+2] = static_cast(colorEntry->c1*255.0f); + imageData[4*i+3] = static_cast(255.0f); } } }