From 1bd343cd87265256ca3432887e4175a3b69c2dc3 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 15 Mar 2015 19:37:14 +0100 Subject: [PATCH] Windows compile issues fix --- panda/src/pnmimage/pfmFile.cxx | 8 ++++---- panda/src/pnmimage/pnmImage.I | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/panda/src/pnmimage/pfmFile.cxx b/panda/src/pnmimage/pfmFile.cxx index e030ba73bc..071985a4d6 100644 --- a/panda/src/pnmimage/pfmFile.cxx +++ b/panda/src/pnmimage/pfmFile.cxx @@ -1596,10 +1596,10 @@ pull_spot(const LPoint4f &delta, float xc, float yc, float xd = ((float)xi - xc) / xr; float yd = ((float)yi - yc) / yr; float r2 = xd * xd + yd * yd; - if (r2 >= 1.0) { + if (r2 >= 1.0f) { continue; } - PN_float32 t = (PN_float32)pow(1.0 - sqrt(r2), exponent); + PN_float32 t = (PN_float32)cpow(1.0f - csqrt(r2), exponent); PN_float32 *f = &_table[(yi * _x_size + xi) * _num_channels]; for (int ci = 0; ci < _num_channels; ++ci) { @@ -1611,7 +1611,7 @@ pull_spot(const LPoint4f &delta, float xc, float yc, return count; } - + //////////////////////////////////////////////////////////////////// // Function: PfmFile::calc_tight_bounds // Access: Published @@ -1633,7 +1633,7 @@ calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point) const { if (!has_point(xi, yi)) { continue; } - + const LPoint3f &point = get_point(xi, yi); if (!found_any) { min_point = point; diff --git a/panda/src/pnmimage/pnmImage.I b/panda/src/pnmimage/pnmImage.I index 328eabbfc4..bcd533c74c 100644 --- a/panda/src/pnmimage/pnmImage.I +++ b/panda/src/pnmimage/pnmImage.I @@ -115,6 +115,9 @@ to_val(float input_value) const { case XE_scRGB: case XE_scRGB_alpha: return min(max(0, (int)((8192 * input_value) + 4096.5f)), 65535); + + default: + return 0; } } @@ -156,6 +159,9 @@ from_val(xelval input_value) const { case XE_scRGB: case XE_scRGB_alpha: return (input_value - 4096) * (1.f / 8192.f); + + default: + return 0.0f; } } @@ -607,6 +613,9 @@ get_xel(int x, int y) const { return LRGBColorf((int)col.r - 4096, (int)col.g - 4096, (int)col.b - 4096) * (1.f / 8192.f); + + default: + return LRGBColorf(0); } } @@ -752,6 +761,9 @@ get_xel_a(int x, int y) const { color.componentwise_mult(scale); return color; } + + default: + return LColorf(0); } }