From b7cd91211f8fd12d13c67e6167c133dc8c4e3c8f Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 2 Jan 2012 00:10:53 +0000 Subject: [PATCH] Clear Conus radar overlay textures On Mac OS, the texture are not zeroed by default which causes artifacts along the edges of the radar overlays. AWeather relies on the edges of the texture to be zero and uses GL_CLAMP to merge multiple overlapping textures together. --- src/plugins/radar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/radar.c b/src/plugins/radar.c index 8166e66..9d39dd0 100644 --- a/src/plugins/radar.c +++ b/src/plugins/radar.c @@ -378,13 +378,14 @@ static void _conus_update_end_copy(GritsTile *tile, guchar *pixels) glGenTextures(1, tile->data); } + gchar *clear = g_malloc0(2048*2048*4); guint *tex = tile->data; glBindTexture(GL_TEXTURE_2D, *tex); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); glTexImage2D(GL_TEXTURE_2D, 0, 4, 2048, 2048, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); + GL_RGBA, GL_UNSIGNED_BYTE, clear); glTexSubImage2D(GL_TEXTURE_2D, 0, 1,1, CONUS_WIDTH/2,CONUS_HEIGHT, GL_RGBA, GL_UNSIGNED_BYTE, pixels); tile->coords.n = 1.0/(CONUS_WIDTH/2); @@ -396,6 +397,7 @@ static void _conus_update_end_copy(GritsTile *tile, guchar *pixels) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glFlush(); + g_free(clear); } /* Split the pixbuf into east and west halves (with 2K sides) -- 2.41.0