Windows compile issues fix

This commit is contained in:
rdb 2015-03-15 19:37:14 +01:00
parent 22120524a2
commit 1bd343cd87
2 changed files with 16 additions and 4 deletions

View File

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

View File

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