X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fgis-opengl.c;h=1b219904a0f1b0ea33295d6c5db776be8a1f1b47;hp=86fba80ccee92a729767db5f3eacc147e81b3eb9;hb=becee285e152746e64b6d3984e2a7229f664062d;hpb=35eef7db3248843c17de23c5636ff9c8610ea191 diff --git a/src/gis-opengl.c b/src/gis-opengl.c index 86fba80..1b21990 100644 --- a/src/gis-opengl.c +++ b/src/gis-opengl.c @@ -370,6 +370,25 @@ void gis_opengl_set_height_func(GisOpenGL *self, GisTile *tile, g_list_free(triangles); } +static void _gis_opengl_clear_height_func_rec(RoamTriangle *root) +{ + if (!root) + return; + RoamPoint *points[] = {root->p.l, root->p.m, root->p.r, root->split}; + for (int i = 0; i < G_N_ELEMENTS(points); i++) { + points[i]->height_func = NULL; + points[i]->height_data = NULL; + roam_point_update_height(points[i]); + } + _gis_opengl_clear_height_func_rec(root->kids[0]); + _gis_opengl_clear_height_func_rec(root->kids[1]); +} +void gis_opengl_clear_height_func(GisOpenGL *self) +{ + for (int i = 0; i < G_N_ELEMENTS(self->sphere->roots); i++) + _gis_opengl_clear_height_func_rec(self->sphere->roots[i]); +} + void gis_opengl_redraw(GisOpenGL *self) { g_debug("GisOpenGL: redraw");