Mercurial > hg > demos > krapula
changeset 46:62d3cf935706
Fix to match API changes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 27 Feb 2015 16:23:48 +0200 |
parents | ac7f374dfe00 |
children | 25a12fb58c19 |
files | krapula.c |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/krapula.c Wed Feb 04 18:09:41 2015 +0200 +++ b/krapula.c Fri Feb 27 16:23:48 2015 +0200 @@ -1,5 +1,6 @@ #include "dmengine.h" #include "dmvecmat.h" +#include "dmperlin.h" #include <math.h> static int demoInit(); @@ -7,7 +8,7 @@ static void demoQuit(); static int demoRender(); - +static DMPerlinContext perlinCtx; #define DM_COLORS (256) @@ -57,7 +58,7 @@ { for (x = 0; x < QWIDTH; x++) { - DMFloat f = 0.40f + dmPerlinNoise2D(x, y, 1.1f, q, 2); + DMFloat f = 0.40f + dmPerlinNoise2D(&perlinCtx, x, y, 1.1f, q, 2); map[y][x] = (int) (dmClamp10(f) * m); } } @@ -364,7 +365,7 @@ int i; // Initialize effect stuff - dmPerlinInit(); + dmPerlinInit(&perlinCtx, 1234); for (i = 0; i < NOSFE_MAX; i++) { @@ -385,7 +386,7 @@ if ((i = jssConvertModuleForPlaying(mod)) != DMERR_OK) { - dmError("Could not convert module for playing, %d: %s\n", + dmErrorMsg("Could not convert module for playing, %d: %s\n", i, dmErrorStr(i)); return DMERR_INIT_FAIL; }