diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-03 21:15:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-05-03 21:15:20 +0400 |
commit | 95d885b3f431284b2e1eb8640771cab00b201437 (patch) | |
tree | fb4e510adcab167b59032c04461ac819e1d46e38 /intern/cycles/app/cycles_xml.cpp | |
parent | 08d899d1e7fe0c669954b197fef0e57269edfb79 (diff) |
Quiet float conversion warnings when building cycles standalone
Diffstat (limited to 'intern/cycles/app/cycles_xml.cpp')
-rw-r--r-- | intern/cycles/app/cycles_xml.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index 1faf290f0ea..d5ef30e5c6f 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -105,7 +105,7 @@ static bool xml_read_float(float *value, pugi::xml_node node, const char *name) pugi::xml_attribute attr = node.attribute(name); if(attr) { - *value = atof(attr.value()); + *value = (float)atof(attr.value()); return true; } @@ -121,7 +121,7 @@ static bool xml_read_float_array(vector<float>& value, pugi::xml_node node, cons string_split(tokens, attr.value()); foreach(const string& token, tokens) - value.push_back(atof(token.c_str())); + value.push_back((float)atof(token.c_str())); return true; } @@ -322,7 +322,7 @@ static void xml_read_camera(const XMLReadState& state, pugi::xml_node node) xml_read_int(&cam->height, node, "height"); if(xml_read_float(&cam->fov, node, "fov")) - cam->fov *= M_PI/180.0f; + cam->fov = DEG2RADF(cam->fov); xml_read_float(&cam->nearclip, node, "nearclip"); xml_read_float(&cam->farclip, node, "farclip"); @@ -1032,7 +1032,7 @@ static void xml_read_transform(pugi::xml_node node, Transform& tfm) if(node.attribute("rotate")) { float4 rotate = make_float4(0.0f, 0.0f, 0.0f, 0.0f); xml_read_float4(&rotate, node, "rotate"); - tfm = tfm * transform_rotate(rotate.x*M_PI/180.0f, make_float3(rotate.y, rotate.z, rotate.w)); + tfm = tfm * transform_rotate(DEG2RADF(rotate.x), make_float3(rotate.y, rotate.z, rotate.w)); } if(node.attribute("scale")) { |