]> Pileus Git - aweather/blobdiff - src/plugins/radar.c
Save and restore window size
[aweather] / src / plugins / radar.c
index 1b4e2b8feed1bdd423cda82fb5006cfa376325ab..016aa912de735c8ecab5a3e8b740d449cfc98ab6 100644 (file)
@@ -21,7 +21,6 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <gio/gio.h>
-#include <GL/gl.h>
 #include <math.h>
 #include <rsl.h>
 
@@ -306,6 +305,7 @@ RadarSite *radar_site_new(city_t *city, GtkWidget *pconfig,
                        "level2" G_DIR_SEPARATOR_S);
        site->city    = city;
        site->pconfig = pconfig;
+       site->hidden  = TRUE;
 
        /* Set initial location */
        gdouble lat, lon, elev;
@@ -379,13 +379,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);
@@ -397,6 +398,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)
@@ -425,7 +427,7 @@ static void _conus_update_end_split(guchar *pixels, guchar *west, guchar *east,
                        dst[0] = src[0];
                        dst[1] = src[1];
                        dst[2] = src[2];
-                       dst[3] = 0xff;
+                       dst[3] = 0xff * 0.75;
                        for (int j = 0; j < G_N_ELEMENTS(alphamap); j++)
                                if (src[0] == alphamap[j][0] &&
                                    src[1] == alphamap[j][1] &&