Преглед на файлове

[*] Set float type for constants: less warnings, less type truncations.

Alexandr Arutjunov преди 9 години
родител
ревизия
aeb99898d3
променени са 3 файла, в които са добавени 6 реда и са изтрити 6 реда
  1. 2 2
      code/X3DImporter_Light.cpp
  2. 1 1
      code/X3DImporter_Postprocess.cpp
  3. 3 3
      code/X3DImporter_Shape.cpp

+ 2 - 2
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;

+ 1 - 1
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)

+ 3 - 3
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;