From aeb99898d3bc0c62eb50893ad3ee47d3a29e313e Mon Sep 17 00:00:00 2001 From: Alexandr Arutjunov Date: Sun, 2 Oct 2016 20:00:57 +0300 Subject: [PATCH] [*] Set float type for constants: less warnings, less type truncations. --- code/X3DImporter_Light.cpp | 4 ++-- code/X3DImporter_Postprocess.cpp | 2 +- code/X3DImporter_Shape.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/X3DImporter_Light.cpp b/code/X3DImporter_Light.cpp index c297d1b95..b6f1ecaa5 100644 --- a/code/X3DImporter_Light.cpp +++ b/code/X3DImporter_Light.cpp @@ -174,9 +174,9 @@ void X3DImporter::ParseNode_Lighting_SpotLight() std::string def, use; float ambientIntensity = 0; aiVector3D attenuation(1, 0, 0); -float beamWidth = 0.7854; +float beamWidth = 0.7854f; aiColor3D color(1, 1, 1); -float cutOffAngle = 1.570796; +float cutOffAngle = 1.570796f; aiVector3D direction(0, 0, -1); bool global = true; float intensity = 1; diff --git a/code/X3DImporter_Postprocess.cpp b/code/X3DImporter_Postprocess.cpp index ba946b9a5..ddc5aa939 100644 --- a/code/X3DImporter_Postprocess.cpp +++ b/code/X3DImporter_Postprocess.cpp @@ -167,7 +167,7 @@ void X3DImporter::Postprocess_BuildMaterial(const CX3DImporter_NodeElement& pNod tvalf = 1; taimat.AddProperty(&tvalf, 1, AI_MATKEY_SHININESS_STRENGTH); taimat.AddProperty(&tnemat.Shininess, 1, AI_MATKEY_SHININESS); - tvalf = 1.0 - tnemat.Transparency; + tvalf = 1.0f - tnemat.Transparency; taimat.AddProperty(&tvalf, 1, AI_MATKEY_OPACITY); }// if((*el_it)->Type == CX3DImporter_NodeElement::ENET_Material) else if((*el_it)->Type == CX3DImporter_NodeElement::ENET_ImageTexture) diff --git a/code/X3DImporter_Shape.cpp b/code/X3DImporter_Shape.cpp index d697f916d..c974f70ce 100644 --- a/code/X3DImporter_Shape.cpp +++ b/code/X3DImporter_Shape.cpp @@ -159,10 +159,10 @@ CX3DImporter_NodeElement* ne; void X3DImporter::ParseNode_Shape_Material() { std::string use, def; -float ambientIntensity = 0.2; -float shininess = 0.2; +float ambientIntensity = 0.2f; +float shininess = 0.2f; float transparency = 0; -aiColor3D diffuseColor(0.8, 0.8, 0.8); +aiColor3D diffuseColor(0.8f, 0.8f, 0.8f); aiColor3D emissiveColor(0, 0, 0); aiColor3D specularColor(0, 0, 0); CX3DImporter_NodeElement* ne;