summaryrefslogtreecommitdiffstats
path: root/libdimension/pigment.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-07-27 18:02:09 -0600
committerTavian Barnes <tavianator@gmail.com>2011-07-27 18:03:06 -0600
commit2c6692e1fb0687ddd2898220286c7a3c7e8b6850 (patch)
tree751245112aa4df1ea9746a6fc981ba061928bbb0 /libdimension/pigment.c
parent43d43e8d604adcf13f10d2e96554e48ac407e8ab (diff)
downloaddimension-2c6692e1fb0687ddd2898220286c7a3c7e8b6850.tar.xz
Use quick_color only for solid pigments.
Diffstat (limited to 'libdimension/pigment.c')
-rw-r--r--libdimension/pigment.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libdimension/pigment.c b/libdimension/pigment.c
index 5522d71..7ed68e3 100644
--- a/libdimension/pigment.c
+++ b/libdimension/pigment.c
@@ -70,6 +70,10 @@ dmnsn_initialize_pigment(dmnsn_pigment *pigment)
dmnsn_color
dmnsn_evaluate_pigment(const dmnsn_pigment *pigment, dmnsn_vector v)
{
- dmnsn_vector v_trans = dmnsn_transform_vector(pigment->trans_inv, v);
- return pigment->pigment_fn(pigment, v_trans);
+ if (pigment->pigment_fn) {
+ dmnsn_vector v_trans = dmnsn_transform_vector(pigment->trans_inv, v);
+ return pigment->pigment_fn(pigment, v_trans);
+ } else {
+ return pigment->quick_color;
+ }
}