summaryrefslogtreecommitdiffstats
path: root/src/graphics/core
diff options
context:
space:
mode:
authorZaba999 <qrwfw5rp>2012-10-11 23:10:07 +0200
committerZaba999 <qrwfw5rp>2012-10-11 23:10:07 +0200
commit7575ffd49b76aaf4b054c0ca8cb8369fb12c11c9 (patch)
tree10915bce6a98c2b0848421dbb79b36ce52bb045b /src/graphics/core
parent8a932fed3e5700af283017deab3cb1da11cb0dce (diff)
parentdfe21c5a9c2ebf3df0f445014588bcce0387d699 (diff)
downloadcolobot-7575ffd49b76aaf4b054c0ca8cb8369fb12c11c9.tar.gz
colobot-7575ffd49b76aaf4b054c0ca8cb8369fb12c11c9.tar.bz2
colobot-7575ffd49b76aaf4b054c0ca8cb8369fb12c11c9.zip
Merge branch 'dev' of https://github.com/colobot/colobot into dev
Diffstat (limited to 'src/graphics/core')
-rw-r--r--src/graphics/core/color.h8
-rw-r--r--src/graphics/core/device.h2
-rw-r--r--src/graphics/core/light.h4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/graphics/core/color.h b/src/graphics/core/color.h
index 0bec7e9..7cbd175 100644
--- a/src/graphics/core/color.h
+++ b/src/graphics/core/color.h
@@ -107,6 +107,14 @@ inline IntColor ColorToIntColor(Color color)
static_cast<unsigned char>(color.a * 255.0f));
}
+inline Color IntensityToColor(float intensity)
+{
+ if (intensity <= 0.0f) return Color(0.0f, 0.0f, 0.0f, 0.0f);
+ if (intensity >= 1.0f) return Color(1.0f, 1.0f, 1.0f, 1.0f);
+
+ return Color(intensity, intensity, intensity, intensity);
+}
+
/**
* \struct ColorHSV
* \brief HSV color
diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h
index ba5af6e..b6dd138 100644
--- a/src/graphics/core/device.h
+++ b/src/graphics/core/device.h
@@ -72,7 +72,7 @@ struct DeviceConfig
size = Math::IntPoint(800, 600);
bpp = 32;
fullScreen = false;
- resizeable = true;
+ resizeable = false;
doubleBuf = true;
noFrame = false;
}
diff --git a/src/graphics/core/light.h b/src/graphics/core/light.h
index 35f37e6..28733c1 100644
--- a/src/graphics/core/light.h
+++ b/src/graphics/core/light.h
@@ -68,7 +68,7 @@ struct Light
float attenuation1;
//! Quadratic attenuation factor
float attenuation2;
- //! Angle of spotlight cone (0-90 degrees)
+ //! Angle of spotlight cone (0-PI/2 radians)
float spotAngle;
//! Intensity of spotlight (0 = uniform; 128 = most intense)
@@ -91,7 +91,7 @@ struct Light
direction = Math::Vector(0.0f, 0.0f, 1.0f);
attenuation0 = 1.0f;
attenuation1 = attenuation2 = 0.0f;
- spotAngle = 90.0f;
+ spotAngle = Math::PI/2.0f;
spotIntensity = 0.0f;
}
};