|
From: <le...@pr...> - 2005-01-21 23:12:59
|
Update of /cvsroot/meshdb/src/geo/alt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26263 Modified Files: Tag: leonard-dev main.c Log Message: fix bug where initial height was sub-surface Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/alt/main.c,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -u -d -r1.3.2.3 -r1.3.2.4 --- main.c 21 Jan 2005 16:05:25 -0000 1.3.2.3 +++ main.c 21 Jan 2005 23:12:45 -0000 1.3.2.4 @@ -96,7 +96,7 @@ int i; int vflag = 0; int lflag = 0; - double lvalue = 0; + double lvalue = 0, h0; double e0, n0, scale, e, n; int w, h, w2, h2; char *Shiftfile = NULL; @@ -196,6 +196,10 @@ exit(0); } + if (lflag) { + h0 = lvalue + alt_fastat(&alt, e0, n0); + } + /* if no crosses, put one in the centre */ if (ncross == 0) { cr = newcross(); @@ -240,7 +244,7 @@ 1.0/scale, 1.0/scale); } else { /* generate PNG output */ - image_set_type(IMAGE_TYPE_JPG); + image_set_type(IMAGE_TYPE_PNM); image_begin(w, h); } @@ -293,7 +297,7 @@ #define LOS(x,y,xp,yp,xq,yq) \ if (-w2<(x) && (x)<w2 && -h2<(y) && (y)<h2) { \ float az, azprev, azmaxprev; \ - az = (H(x,y) - lvalue) / d; \ + az = (H(x,y) - h0) / d; \ if (isnanf(az)) az = ZENITH; \ azprev = AZ(xp,yp)*(p/n) + \ AZ(xq,yq)*(1-p/n); \ |