RoamTriangle *tri = cur->data;
RoamPoint *points[] = {tri->p.l, tri->p.m, tri->p.r, tri->split};
for (int i = 0; i < G_N_ELEMENTS(points); i++) {
- points[i]->height_func = height_func;
- points[i]->height_data = user_data;
- roam_point_update_height(points[i]);
+ if (tile->edge.n >= points[i]->lat && points[i]->lat >= tile->edge.s &&
+ tile->edge.e >= points[i]->lon && points[i]->lon >= tile->edge.w) {
+ points[i]->height_func = height_func;
+ points[i]->height_data = user_data;
+ roam_point_update_height(points[i]);
+ }
}
}
g_list_free(triangles);
#define LOAD_OPENGL FALSE
struct _LoadTileData {
GisPluginSrtm *self;
+ gchar *path;
GisTile *tile;
GdkPixbuf *pixbuf;
struct _TileData *data;
static gboolean _load_tile_cb(gpointer _load)
{
struct _LoadTileData *load = _load;
+ g_debug("GisPluginSrtm: _load_tile_cb: %s", load->path);
GisPluginSrtm *self = load->self;
GisTile *tile = load->tile;
GdkPixbuf *pixbuf = load->pixbuf;
struct _TileData *data = load->data;
+ g_free(load->path);
g_free(load);
if (LOAD_OPENGL)
{
GisPluginSrtm *self = _self;
- g_debug("GisPluginSrtm: _load_tile");
- gchar *path = gis_wms_make_local(self->wms, tile);
struct _LoadTileData *load = g_new0(struct _LoadTileData, 1);
+ load->path = gis_wms_make_local(self->wms, tile);
+ g_debug("GisPluginSrtm: _load_tile: %s", load->path);
load->self = self;
load->tile = tile;
load->data = g_new0(struct _TileData, 1);
if (LOAD_BIL || LOAD_OPENGL)
- load->data->bil = _load_bil(path);
+ load->data->bil = _load_bil(load->path);
if (LOAD_OPENGL)
load->pixbuf = _load_pixbuf(load->data->bil);
g_idle_add_full(G_PRIORITY_LOW, _load_tile_cb, load, NULL);
- g_free(path);
}
static gboolean _free_tile_cb(gpointer _data)
if (self != self->t.b->t.b)
roam_triangle_split(self->t.b, sphere);
+ if (self != self->t.b->t.b)
+ g_assert_not_reached();
RoamTriangle *base = self->t.b;
list = _roam_sphere_get_leaves(tri->kids[1], list, all);
return list;
} else {
- return g_list_append(list, tri);
+ return g_list_prepend(list, tri);
}
}
static GList *_roam_sphere_get_intersect_rec(RoamTriangle *tri, GList *list,
/* No intersect */
if (debug) g_message("no intersect");
return list;
- } else if (tn < n && ts > s && te < e && tw > w) {
+ } else if (tn <= n && ts >= s && te <= e && tw >= w) {
/* Triangle is completely contained */
if (debug) g_message("contained");
if (all) list = g_list_prepend(list, tri);
} else {
/* This triangle is an edge case */
if (debug) g_message("edge");
- return g_list_append(list, tri);
+ return g_list_prepend(list, tri);
}
}
GList *roam_sphere_get_intersect(RoamSphere *self, gboolean all,