diff --git a/panda/src/particlesystem/zSpinParticle.cxx b/panda/src/particlesystem/zSpinParticle.cxx index f311d0cb55..23c9e618de 100644 --- a/panda/src/particlesystem/zSpinParticle.cxx +++ b/panda/src/particlesystem/zSpinParticle.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "zSpinParticle.h" +#include "cmath.h" //////////////////////////////////////////////////////////////////// // Function : ZSpinParticle @@ -90,9 +91,9 @@ update() { } // normalize the result to [0..360) - _cur_angle = fmod(_cur_angle, 360.0f); + _cur_angle = cmod(_cur_angle, (PN_stdfloat)360.0); - // if _cur_angle was negative, it is still negative after fmod, + // if _cur_angle was negative, it is still negative after cmod, // wrap it around by adding 360 // is this really necessary? should be in range of sin/cos diff --git a/panda/src/speedtree/speedTreeNode.cxx b/panda/src/speedtree/speedTreeNode.cxx index c909dc3f24..c25952e622 100644 --- a/panda/src/speedtree/speedTreeNode.cxx +++ b/panda/src/speedtree/speedTreeNode.cxx @@ -986,13 +986,13 @@ cull_callback(CullTraverser *trav, CullTraverserData &data) { CPT(TransformState) orig_modelview = data.get_modelview_transform(trav); CPT(TransformState) modelview = gsg->get_cs_transform()->compose(orig_modelview); CPT(TransformState) camera_transform = modelview->invert_compose(TransformState::make_identity()); - const LMatrix4 &modelview_mat = modelview->get_mat(); + LMatrix4f modelview_mat = LCAST(float, modelview->get_mat()); const LPoint3 &camera_pos = camera_transform->get_pos(); const Lens *lens = trav->get_scene()->get_lens(); - LMatrix4 projection_mat = - LMatrix4::convert_mat(gsg->get_internal_coordinate_system(), lens->get_coordinate_system()) * - lens->get_projection_mat(); + LMatrix4f projection_mat = + LCAST(float, LMatrix4::convert_mat(gsg->get_internal_coordinate_system(), lens->get_coordinate_system()) * + lens->get_projection_mat()); _view.Set(SpeedTree::Vec3(camera_pos[0], camera_pos[1], camera_pos[2]), SpeedTree::Mat4x4(projection_mat.get_data()), @@ -1068,7 +1068,7 @@ cull_callback(CullTraverser *trav, CullTraverserData &data) { _forest_render.SetLightDir(_light_dir); - SpeedTree::st_stdfloat updated_splits[SpeedTree::c_nMaxNumShadowMaps]; + SpeedTree::st_float32 updated_splits[SpeedTree::c_nMaxNumShadowMaps]; memset(updated_splits, 0, sizeof(updated_splits)); for (int smi = 0; smi < (int)_shadow_infos.size(); ++smi) { updated_splits[smi] = _shadow_infos[smi]._shadow_split; diff --git a/panda/src/speedtree/stBasicTerrain.cxx b/panda/src/speedtree/stBasicTerrain.cxx index d9b2374acc..40e17739ee 100644 --- a/panda/src/speedtree/stBasicTerrain.cxx +++ b/panda/src/speedtree/stBasicTerrain.cxx @@ -385,7 +385,7 @@ read_height_map() { int pi = 0; for (int yi = image.get_y_size() - 1; yi >= 0; --yi) { for (int xi = 0; xi < image.get_x_size(); ++xi) { - Colord rgba = image.get_xel_a(xi, yi); + LColord rgba = image.get_xel_a(xi, yi); PN_stdfloat v = rgba[0] + rgba[1] + rgba[2] + rgba[3]; v *= scalar; _height_data._data[pi] = v; diff --git a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx index 0dc48bd8fe..dcb99cee3c 100755 --- a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx +++ b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx @@ -365,7 +365,7 @@ choose_pixel_format(const FrameBufferProperties &properties, static const int max_attrib_list = 64; int iattrib_list[max_attrib_list]; - PN_stdfloat fattrib_list[max_attrib_list]; + float fattrib_list[max_attrib_list]; int ni = 0; int nf = 0;