summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.cxx22
-rw-r--r--src/gipfel.cxx4
2 files changed, 16 insertions, 10 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 20d4a42..15a3cc6 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -677,22 +677,28 @@ GipfelWidget::handle(int event) {
int
GipfelWidget::export_hills(FILE *fp) {
Hills *mnts;
- Hill *m;
- fprintf(fp, "#\n# name\theight\tx\ty\tdistance\n#\n");
+ fprintf(fp, "#\n# name\theight\tx\ty\tdistance\tflags\n#\n");
mnts = pan->get_visible_mountains();
for (int i=0; i<mnts->get_num(); i++) {
- m = mnts->get(i);
+ Hill *m = mnts->get(i);
+ char *flags;
+ int _x = (int) rint(m->x) + w() / 2;
+ int _y = (int) rint(m->y) + h() / 2;
- if (m->x < 0 || m->x > w() || m->y < 0 || m->y > h()) {
+ if (_x < 0 || _x > w() || _y < 0 || _y > h()) {
continue;
}
- fprintf(fp, "%s\t%d\t%d\t%d\t%d\n",
- m->name, (int) rint(m->height),
- (int) rint( m->x), (int) rint(m->y),
- (int) rint(pan->get_real_distance(m)));
+ if (m->flags & Hill::HIDDEN) {
+ flags = "HIDDEN";
+ } else {
+ flags = "";
+ }
+ fprintf(fp, "%s\t%d\t%d\t%d\t%d\t%s\n",
+ m->name, (int) rint(m->height), _x, _y,
+ (int) rint(pan->get_real_distance(m)), flags);
}
return 0;
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 295adf6..ba757e2 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -658,9 +658,9 @@ export_hills(const char *export_mode, double visibility) {
} else {
ImageMetaData md;
if (md.load_image(img_file) == 0) {
- printf(",,%s,,%f,%f,%d\n", img_file,
- md.get_longitude(),
+ printf(",%s,,%f,%f,%d\n", img_file,
md.get_latitude(),
+ md.get_longitude(),
(int) rint(md.get_height()));
ret = 0;
}