Warning fixes for VS, and removal of associated warning disables
This commit is contained in:
parent
aa8402ce81
commit
7b598c5701
@ -25,8 +25,6 @@
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4251 )
|
||||
#pragma warning( disable : 4275 )
|
||||
#pragma warning( disable : 4305 )
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
|
||||
|
@ -182,7 +182,7 @@ void AutoTransform::accept(NodeVisitor& nv)
|
||||
|
||||
if (getAutoScaleToScreen())
|
||||
{
|
||||
double size = 1.0/cs->pixelSize(getPosition(),0.48);
|
||||
double size = 1.0/cs->pixelSize(getPosition(),0.48f);
|
||||
|
||||
if (_autoScaleTransitionWidthRatio>0.0)
|
||||
{
|
||||
|
@ -233,7 +233,7 @@ int BuildKdTree::divide(KdTree::BuildOptions& options, osg::BoundingBox& bb, int
|
||||
|
||||
if (node.bb.valid())
|
||||
{
|
||||
float epsilon = 1e-6;
|
||||
float epsilon = 1e-6f;
|
||||
node.bb._min.x() -= epsilon;
|
||||
node.bb._min.y() -= epsilon;
|
||||
node.bb._min.z() -= epsilon;
|
||||
@ -505,7 +505,7 @@ void IntersectKdTree::intersect(const KdTree::KdNode& node, const osg::Vec3& ls,
|
||||
|
||||
float r,r0,r1,r2;
|
||||
|
||||
const float esplison = 1e-10;
|
||||
const float esplison = 1e-10f;
|
||||
if (det>esplison)
|
||||
{
|
||||
float u = (P*T);
|
||||
|
@ -1637,24 +1637,24 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID)
|
||||
const char* renderer = (const char*) glGetString(GL_RENDERER);
|
||||
std::string rendererString(renderer ? renderer : "");
|
||||
|
||||
_isMultiTexturingSupported = isGLExtensionOrVersionSupported( contextID,"GL_ARB_multitexture", 1.3) ||
|
||||
isGLExtensionOrVersionSupported(contextID,"GL_EXT_multitexture", 1.3);
|
||||
_isMultiTexturingSupported = isGLExtensionOrVersionSupported( contextID,"GL_ARB_multitexture", 1.3f) ||
|
||||
isGLExtensionOrVersionSupported(contextID,"GL_EXT_multitexture", 1.3f);
|
||||
|
||||
_isTextureFilterAnisotropicSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_filter_anisotropic");
|
||||
|
||||
_isTextureCompressionARBSupported = isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3);
|
||||
_isTextureCompressionARBSupported = isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3f);
|
||||
|
||||
_isTextureCompressionS3TCSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc");
|
||||
|
||||
_isTextureMirroredRepeatSupported = isGLExtensionOrVersionSupported(contextID,"GL_IBM_texture_mirrored_repeat", 1.4) ||
|
||||
isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_mirrored_repeat", 1.4);
|
||||
_isTextureMirroredRepeatSupported = isGLExtensionOrVersionSupported(contextID,"GL_IBM_texture_mirrored_repeat", 1.4f) ||
|
||||
isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_mirrored_repeat", 1.4f);
|
||||
|
||||
_isTextureEdgeClampSupported = isGLExtensionOrVersionSupported(contextID,"GL_EXT_texture_edge_clamp", 1.2) ||
|
||||
isGLExtensionOrVersionSupported(contextID,"GL_SGIS_texture_edge_clamp", 1.2);
|
||||
_isTextureEdgeClampSupported = isGLExtensionOrVersionSupported(contextID,"GL_EXT_texture_edge_clamp", 1.2f) ||
|
||||
isGLExtensionOrVersionSupported(contextID,"GL_SGIS_texture_edge_clamp", 1.2f);
|
||||
|
||||
_isTextureBorderClampSupported = isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_border_clamp", 1.3);
|
||||
_isTextureBorderClampSupported = isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_border_clamp", 1.3f);
|
||||
|
||||
_isGenerateMipMapSupported = isGLExtensionOrVersionSupported(contextID,"GL_SGIS_generate_mipmap", 1.4);
|
||||
_isGenerateMipMapSupported = isGLExtensionOrVersionSupported(contextID,"GL_SGIS_generate_mipmap", 1.4f);
|
||||
|
||||
_isShadowSupported = isGLExtensionSupported(contextID,"GL_ARB_shadow");
|
||||
|
||||
|
@ -74,7 +74,7 @@ const bsp::Plane & VBSPData::getPlane(int index) const
|
||||
void VBSPData::addVertex(osg::Vec3f & newVertex)
|
||||
{
|
||||
// Scale the vertex from inches up to meter scale
|
||||
vertex_list.push_back(newVertex * 0.0254);
|
||||
vertex_list.push_back(newVertex * 0.0254f);
|
||||
}
|
||||
|
||||
|
||||
|
@ -294,13 +294,13 @@ void VBSPGeometry::createDispSurface(Face & face, DisplaceInfo & dispInfo)
|
||||
texVOffset = currentTexInfo.texture_vecs[1][3];
|
||||
|
||||
// Scale the texture vectors from inches to meters
|
||||
texU *= 39.37;
|
||||
texV *= 39.37;
|
||||
texU *= 39.37f;
|
||||
texV *= 39.37f;
|
||||
|
||||
// Get the size of the texture involved, as the planar texture projection
|
||||
// assumes non-normalized texture coordinates
|
||||
texUScale = 1.0 / (float)currentTexData.texture_width;
|
||||
texVScale = 1.0 / (float)currentTexData.texture_height;
|
||||
texUScale = 1.0f / (float)currentTexData.texture_width;
|
||||
texVScale = 1.0f / (float)currentTexData.texture_height;
|
||||
|
||||
// Get the first edge index
|
||||
edgeIndex = face.first_edge;
|
||||
@ -335,7 +335,7 @@ void VBSPGeometry::createDispSurface(Face & face, DisplaceInfo & dispInfo)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
// Calculate the distance of the start position from this vertex
|
||||
dist = (vertices[i] - dispInfo.start_position * 0.0254).length();
|
||||
dist = (vertices[i] - dispInfo.start_position * 0.0254f).length();
|
||||
|
||||
// If this is the smallest distance we've seen, remember it
|
||||
if (dist < minDist)
|
||||
@ -553,13 +553,13 @@ void VBSPGeometry::addFace(int faceIndex)
|
||||
texVOffset = currentTexInfo.texture_vecs[1][3];
|
||||
|
||||
// Scale the texture vectors from inches to meters
|
||||
texU *= 39.37;
|
||||
texV *= 39.37;
|
||||
texU *= 39.37f;
|
||||
texV *= 39.37f;
|
||||
|
||||
// Get the texture size, as the planar texture projection results in
|
||||
// non-normalized texture coordinates
|
||||
texUScale = 1.0 / (float)currentTexData.texture_width;
|
||||
texVScale = 1.0 / (float)currentTexData.texture_height;
|
||||
texUScale = 1.0f / (float)currentTexData.texture_width;
|
||||
texVScale = 1.0f / (float)currentTexData.texture_height;
|
||||
|
||||
// Start with the last edge index, because we need to switch from
|
||||
// clockwise winding (DirectX) to counter-clockwise winding (OpenGL)
|
||||
|
Loading…
Reference in New Issue
Block a user