瀏覽代碼

Windows compile issues fix

rdb 10 年之前
父節點
當前提交
1bd343cd87
共有 2 個文件被更改,包括 16 次插入4 次删除
  1. 4 4
      panda/src/pnmimage/pfmFile.cxx
  2. 12 0
      panda/src/pnmimage/pnmImage.I

+ 4 - 4
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;

+ 12 - 0
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);
   }
 }