summaryrefslogtreecommitdiffhomepage
path: root/nGenEx/Polygon.cpp
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 16:46:21 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 16:46:21 +0000
commit396c12ee73193f4ac3665ecac2f634fc0b046697 (patch)
tree16edb33b60f95f6bda93bc84b3f2eb81e316ba1d /nGenEx/Polygon.cpp
parent50971e84e295033941fac5291b08e593541fe945 (diff)
downloadstarshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.zip
starshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.tar.gz
starshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.tar.bz2
Fixes for unsafe string handling, variable scoping errors.
Diffstat (limited to 'nGenEx/Polygon.cpp')
-rw-r--r--nGenEx/Polygon.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/nGenEx/Polygon.cpp b/nGenEx/Polygon.cpp
index 419d3a5..d5c581f 100644
--- a/nGenEx/Polygon.cpp
+++ b/nGenEx/Polygon.cpp
@@ -701,7 +701,7 @@ Material::GetThumbColor(int i, int j, int size)
// anisotropic diffuse lighting
if (brilliance >= 0) {
- diffuse = pow(diffuse, brilliance);
+ diffuse = pow(diffuse, (double)brilliance);
}
// forward lighting
@@ -713,7 +713,7 @@ Material::GetThumbColor(int i, int j, int size)
if (power > 0) {
double spec = ((nrm * 2*(nrm*light) - light) * eye);
if (spec > 0.01) {
- spec = pow(spec, power);
+ spec = pow(spec, (double)power);
c += cs * (white * spec);
}
}
@@ -730,8 +730,8 @@ Material::GetThumbColor(int i, int j, int size)
double spec = ((nrm * 2*(nrm*light) - light) * eye);
if (spec > 0.01) {
- spec = pow(spec, power);
- c += cs * (white * spec) * 0.7;
+ spec = pow(spec, (double)power);
+ c += cs * (white * spec) * 0.7;
}
}
}