#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <string.h>
+#include "globals.h"
#include "mapcache.h"
#include "preferences.h"
static int queue_count = 0;
static guint32 queue_size = 0;
-static guint32 max_queue_size = VIK_CONFIG_MAPCACHE_SIZE;
+static guint32 max_queue_size = VIK_CONFIG_MAPCACHE_SIZE * 1024 * 1024;
static GHashTable *cache = NULL;
#define HASHKEY_FORMAT_STRING "%d-%d-%d-%d-%d-%d-%.3f-%.3f"
#define HASHKEY_FORMAT_STRING_NOSHRINK_NOR_ALPHA "%d-%d-%d-%d-%d-"
-#define VIKING_PREFERENCES_GROUP_KEY "viking.globals"
-#define VIKING_PREFERENCES_NAMESPACE "viking.globals."
-
static VikLayerParamScale params_scales[] = {
/* min, max, step, digits (decimal places) */
- { 1, 300, 1, 0 },
+ { 1, 1024, 1, 0 },
};
static VikLayerParam prefs[] = {
- { VIKING_PREFERENCES_NAMESPACE "mapcache_size", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Mapcache memory size (MB):"), VIK_LAYER_WIDGET_HSCALE, params_scales, NULL },
+ { VIKING_PREFERENCES_NAMESPACE "mapcache_size", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Map cache memory size (MB):"), VIK_LAYER_WIDGET_HSCALE, params_scales, NULL },
};
void a_mapcache_init ()
{
VikLayerParamData tmp;
- tmp.u = VIK_CONFIG_MAPCACHE_SIZE / 1024 / 1024;
+ tmp.u = VIK_CONFIG_MAPCACHE_SIZE;
a_preferences_register(prefs, tmp, VIKING_PREFERENCES_GROUP_KEY);
mc_mutex = g_mutex_new();
}
g_mutex_unlock(mc_mutex);
- if ( (++tmp == 100 )) { g_print("DEBUG: queue count=%d %u\n", queue_count, queue_size ); tmp=0; }
+ if ( (++tmp == 100 )) { g_print("DEBUG: queue count=%d size=%u\n", queue_count, queue_size ); tmp=0; }
}
GdkPixbuf *a_mapcache_get ( gint x, gint y, gint z, guint8 type, guint zoom, guint8 alpha, gdouble xshrinkfactor, gdouble yshrinkfactor )