Mercurial > hg > demos > krapula
changeset 35:1bac8390dafc
This function is in dmlib now.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 04 Oct 2012 06:42:20 +0300 |
parents | f5c5af85ccfd |
children | d17d31b736c2 |
files | krapula.c |
diffstat | 1 files changed, 1 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/krapula.c Thu Oct 04 06:36:52 2012 +0300 +++ b/krapula.c Thu Oct 04 06:42:20 2012 +0300 @@ -50,12 +50,6 @@ typedef Uint8 DMBlockMap[QHEIGHT][QWIDTH]; -static DMFloat dmClip(DMFloat a) -{ - return (a < 0.0f ? 0.0f : (a > 1.0f ? 1.0f : a)); -} - - void dmMakeBumpMap(DMBlockMap map, DMFloat q, DMFloat m) { int x, y; @@ -64,7 +58,7 @@ for (x = 0; x < QWIDTH; x++) { DMFloat f = 0.40f + dmPerlinNoise2D(x, y, 1.1f, q, 2); - map[y][x] = (int) (dmClip(f) * m); + map[y][x] = (int) (dmClamp10(f) * m); } } }