X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2Ffft-normalmap-to-heightmap.c;fp=misc%2Ftools%2Ffft-normalmap-to-heightmap.c;h=aa4ac7fffe78855f555424ba2cfff178581f75db;hp=909f591ff33667355fec0f52bebdcb5d77ab219d;hb=56cf102d6417ee780f45af1fb8d4628a0132f5ec;hpb=6dcb9aea907314ace3b160940c9d7204ab02db2f diff --git a/misc/tools/fft-normalmap-to-heightmap.c b/misc/tools/fft-normalmap-to-heightmap.c index 909f591f..aa4ac7ff 100644 --- a/misc/tools/fft-normalmap-to-heightmap.c +++ b/misc/tools/fft-normalmap-to-heightmap.c @@ -39,7 +39,7 @@ void nmap_to_hmap(unsigned char *map, const unsigned char *refmap, int w, int h, { int x, y; int fx, fy; - int ffx, ffy; + double ffx, ffy; double nx, ny, nz; double v, vmin, vmax; #ifndef C99 @@ -95,6 +95,7 @@ void nmap_to_hmap(unsigned char *map, const unsigned char *refmap, int w, int h, if(fy > h/2) fy -= h; /* these must have the same sign as fx and fy (so ffx*fx + ffy*fy is nonzero), otherwise do not matter */ + /* it basically decides how artifacts are distributed */ ffx = fx; ffy = fy; #ifdef C99