build in stdfloat_double

This commit is contained in:
David Rose 2011-10-11 17:28:03 +00:00
parent df60493195
commit 05c6cc00a4
4 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;