]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
explain more
authorRudolf Polzer <divverent@alientrap.org>
Thu, 26 Aug 2010 04:09:40 +0000 (06:09 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 26 Aug 2010 04:09:40 +0000 (06:09 +0200)
misc/tools/fft-normalmap-to-heightmap.c

index 909f591ff33667355fec0f52bebdcb5d77ab219d..aa4ac7fffe78855f555424ba2cfff178581f75db 100644 (file)
@@ -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 x, y;
        int fx, fy;
-       int ffx, ffy;
+       double ffx, ffy;
        double nx, ny, nz;
        double v, vmin, vmax;
 #ifndef C99
        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 */
                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
                ffx = fx;
                ffy = fy;
 #ifdef C99