# HG changeset patch # User Matti Hamalainen # Date 1424699073 -7200 # Node ID 90a879277ca2e4617e5069946b96ad3a0a305069 # Parent eb4ebbd5c1711aa920fe07b42be45ecbb23c7d68 Fix perling noise usage. diff -r eb4ebbd5c171 -r 90a879277ca2 tests/blittest.c --- a/tests/blittest.c Mon Feb 23 15:41:27 2015 +0200 +++ b/tests/blittest.c Mon Feb 23 15:44:33 2015 +0200 @@ -2,6 +2,7 @@ #include "dmargs.h" #include "dmvecmat.h" #include "dmtext.h" +#include "dmperlin.h" #include #define DM_COLORS (256) @@ -11,6 +12,7 @@ int optVFlags = SDL_SWSURFACE | SDL_HWPALETTE; int optScrWidth = 640, optScrHeight = 480, optFontSize = 20, optScrDepth = 32; int optBenchmarkLen = 20; +DMPerlinContext perlinCtx; static const DMOptArg optList[] = { { 0, '?', "help", "Show this help", OPT_NONE }, @@ -166,7 +168,7 @@ for (y = 0; y < QHEIGHT; y++) 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) (dmClip(f) * m); } } @@ -334,7 +336,7 @@ SDL_WM_SetCaption("Halleluja", "DMT"); } - dmPerlinInit(); + dmPerlinInit(&perlinCtx, 1234); bmap = SDL_CreateRGBSurface(SDL_SWSURFACE, QWIDTH, QHEIGHT, 8, 0, 0, 0, 0); DM_MakePalette(bmap);