mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Add an assertion that all colours are within range
Because I know I'm going to mess this up at some point.
This commit is contained in:
3
midend.c
3
midend.c
@ -1348,6 +1348,9 @@ float *midend_colours(midend *me, int *ncolours)
|
|||||||
ret[i*3 + 1] = g / 255.0F;
|
ret[i*3 + 1] = g / 255.0F;
|
||||||
ret[i*3 + 2] = b / 255.0F;
|
ret[i*3 + 2] = b / 255.0F;
|
||||||
}
|
}
|
||||||
|
assert(0.0F <= ret[i*3 + 0] && ret[i*3 + 0] <= 1.0F);
|
||||||
|
assert(0.0F <= ret[i*3 + 1] && ret[i*3 + 1] <= 1.0F);
|
||||||
|
assert(0.0F <= ret[i*3 + 2] && ret[i*3 + 2] <= 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user