master
steffen 12 years ago
parent 867acfafcd
commit 09b8c79772

@ -1,6 +1,12 @@
Version 0.0.2: name changed to spOSMroute, since on there had been another
OSMroute already.
=============================================================================
(2014-02-27):
- fixed: progressbar is back working again.
- fixed: during start up the draw_setscalef function wasn't called.
- got all systems back working again: Windows, WindowsCE, SDLGL, Android
and GTK
(2014-02-12):
- fixed: quiting while in routing did not work.
- fixed: gui_list elements where almost unable use.

@ -20,7 +20,7 @@ sposmedit:
do if ! make -C $$i; then \
exit -2; \
fi done
$(CC) -o sposmedit -lmain -lncurses -lmapsys -lbase -lmain -Lbase -Lmapsys -Lmain `pkg-config --libs libxml-2.0` -lbz2 -ggdb -pg $(DEBUG)
$(CC) -o sposmedit -lm -lmain -lncurses -lmapsys -lbase -lmain -Lbase -Lmapsys -Lmain `pkg-config --libs libxml-2.0` -lbz2 -ggdb -pg $(DEBUG)
cleanapp:
rm -rf sposmedit

Binary file not shown.

@ -198,7 +198,7 @@ void draw_init () {
view_lon = cfg.last_lon;
view_lat = cfg.last_lat;
view_scale = cfg.last_scale;
draw_setscalef (cfg.last_scale);
};
void draw_init_color () {
@ -284,7 +284,7 @@ void draw_init_color () {
case (MWAY_unknown):
case (MWAY_unknown_way):
default:
gfx_color_alloc (&draw_linestyle[n].c, 0x7000,0x5000,0x5000);
gfx_color_alloc (&draw_linestyle[n].c, 0xA000,0x5000,0x5000);
break;
}
}

@ -215,18 +215,31 @@ void draw_gui () {
ls.width = 1.0;
ls.c = ls.borderc = color[COLOR_white][3];
p1.x = gfx_screensize.x/2-100;
p2.x = gfx_screensize.x/2+100;
p1.x = gfx_screensize.x/2-101;
p2.x = gfx_screensize.x/2+101;
p1.y = gfx_screensize.y-32;
p2.y = gfx_screensize.y-10;
draw_polygonstart ();
draw_polygonadd (p1.x, p1.y);
draw_polygonadd (p2.x, p1.y);
draw_polygonadd (p2.x, p2.y);
draw_polygonadd (p1.x, p2.y);
draw_polygonfinish (NULL, ls, &color[COLOR_white][0], 1);
p1.x = gfx_screensize.x/2-(float)(100.0*app.statusline_progress);
p2.x = gfx_screensize.x/2+(float)(100.0*app.statusline_progress);
p1.y = gfx_screensize.y-31;
p2.y = gfx_screensize.y-11;
draw_polygonstart ();
draw_polygonadd (p1.x, p1.y);
draw_polygonadd (p2.x, p1.y);
draw_polygonadd (p2.x, p2.y);
draw_polygonadd (p1.x, p2.y);
draw_polygonfinish (NULL, ls, &color[COLOR_blue][3], 1);
gfx_draw_text (NULL, p1.x + 2, p1.y + 2, app.statusline_text, &color[COLOR_white][3]);
draw_polygonfinish (NULL, ls, &color[COLOR_blue][3], 0);
gfx_draw_text (NULL, gfx_screensize.x/2-98, p1.y + 2, app.statusline_text, &color[COLOR_white][3]);
}
/*

@ -63,7 +63,7 @@ void main_menu_refresh () {
he.lon = view_lon + 2.0 * map_km2lon(view_scale * ((float)ss.x/10), he.lat);
map_load_web (hs, he);
app_status ("", -1);
app_status (-1, "", 0.0);
draw ();
}
};
@ -80,9 +80,9 @@ void main_menu_mapdefrag () {
void main_menu_saveall () {
app_status (_("save all"), -1);
app_status (-1,_("save all"), 0.0);
map_save_all();
app_status ("", -1);
app_status (-1, "", 0.0);
};
@ -127,14 +127,13 @@ void main_menu_osmimport () {
osm_loadfile (fn);
draw_redrawmap ();
}
app_status ("", -1);
app.status = APPSTATUS_nothing;
app_status (APPSTATUS_nothing, "", 0.0);
};
void main_menu_map_searchsort () {
map_search_sort ();
app_status ("", -1);
app_status (-1, "", 0.0);
};
@ -145,7 +144,7 @@ void main_menu_map_searchrefresh () {
map_search_get_filename (lfn, LEN_FILENAME);
map_webload (rfn, lfn, NULL);
app_status ("", -1);
app_status (-1, "", 0.0);
};

@ -211,7 +211,7 @@ void main_wnd_loop (long long int cur, long long int max) {
t1 = time (NULL);
if (to != t1) {
app_status (NULL, 0);
app_status (-1, NULL, 0.0);
to = t1;
}

@ -29,9 +29,6 @@
#define SEARCH_MAXRESULT 32
void gui_search_close ();
void gui_search_refresh ();
void gui_search_next ();
void gui_search_prev ();
void gui_search_city ();
void gui_search_switch (int pos);

@ -62,12 +62,17 @@ int app_loop () {
/******************************************************************************
* update stausbar
*/
void app_status (char *text, int progress) {
void app_status (int status, char *text, float progress) {
static char oldtext[255];
if (text) strncpy (app.statusline_text, text, 255);
else strncpy (app.statusline_text, oldtext, 255);
app.statusline_progress = progress;
if (status >= 0) app.status = status;
if (progress < 0.0) app.statusline_progress = 0.0;
else if (progress > 1.0) app.statusline_progress = 1.0;
else app.statusline_progress = progress;
#ifdef SPOSMROUTE
if (currentwin) currentwin->screen_changed = 1;

@ -139,7 +139,7 @@ struct cfgdata {
struct appdata {
char statusline_text[255];
int statusline_progress;
float statusline_progress; // value in 0.0 to 1.0
int status;
float debug_lon;
float debug_lat;
@ -174,7 +174,7 @@ extern struct appdata app;
*/
extern int app_init (int argc, char **argv);
extern int app_shutdown ();
extern void app_status (char *text, int progress);
extern void app_status (int status, char *text, float progress);
extern int app_loop ();
extern void config_init ();

@ -251,6 +251,9 @@ void map_refresh (float lon, float lat) {
map_ls_get_filename (rfn, LEN_FILENAME, map_geo2igeo (lon), map_geo2igeo (lat));
#if defined(SPOSMROUTE)
map_webload (fn, rfn, NULL);
map_clear ();
map_init ();
draw_redrawmap ();
#endif
};
@ -304,6 +307,12 @@ void map_refreshblock (struct map_pos start, struct map_pos end, float delta) {
#endif
}
}
map_clear ();
map_init ();
#if defined(SPOSMROUTE)
draw_redrawmap ();
#endif
};

@ -167,7 +167,7 @@ void map_hash_free (struct map_hash *mh, int noremove) {
* allocate new memory, copy all the data and free the momory again.
*/
struct map_hash *map_hash_realloc (struct map_hash *mhorg, int memsize) {
struct map_hash *res;
struct map_hash *res = NULL;
int i = memsize;
if (i < mhorg->datasize) return res;

@ -217,7 +217,7 @@ struct map_lsstat *map_ls_statopen (char *fname) {
mlss.r_fd = mlss.w_fd = 0;
mlss.changed = 0;
if (file_exist (mlss.fname) == NULL) {
if (file_exist (mlss.fname) == 0) {
d_printf ("map_ls_statopen file '%s' not found.", mlss.fname);
mlss.r_fd = 0;
return &mlss;

@ -737,7 +737,7 @@ void osm_waynodes_check () {
for (hid = 0; hid < osm_hidmax; hid++) {
sprintf (text, _("checking for waynodes in hid %d"), hid);
app_status (text, 0);
app_status (-1, text, 0.0);
ohash = osm_hashnodes_load (hid, 1);
for (i = 0; i < ohash->hash_cnt; i++) {
if ((i%1024) == 0) main_wnd_loop (i, ohash->hash_cnt);
@ -1605,7 +1605,7 @@ void osm_processdata (xmlTextReaderPtr reader) {
osm.oway->type -= MWAY_MAX;
osm_area_cnt++;
osm_area_save (osm.oway, &osm.area);
if (osm.oway->type != MAREA_ignore) osm_area_save (osm.oway, &osm.area);
}
else {
osm_ways_cnt++;
@ -1724,7 +1724,7 @@ void osm_processdata (xmlTextReaderPtr reader) {
else if (strcmp ((char*) v, (char*) "steps") == 0) osm.oway->type = MWAY_footway;
else {
osm.oway->type = MWAY_unknown_way;
// printf ("unknown highway:'%s'\n", v);
printf ("unknown highway:'%s'\n", v);
}
}
@ -1922,7 +1922,7 @@ void osm_loadfile (char *fn) {
osm_init ();
if (fn == NULL) return;
app_status (_("converting file"), 0);
app_status (-1, _("converting file"), 0.0);
d_printf ("osm_loadfile (%s)", fn);
/* check the extension of the osm file */
@ -1984,7 +1984,7 @@ void osm_loadfile (char *fn) {
/* reset the locale setting back to the environment setting */
setlocale (LC_ALL, NULL);
osm_free ();
app_status (_(""), -1);
app_status (-1, _(""), 0.0);
};
@ -2023,7 +2023,7 @@ void map_load_web (struct map_pos hs, struct map_pos he) {
#if defined (_LINUX_)
osm_load_from_web_end = he;
osm_load_from_web_start = hs;
app_status (_("refresh from OpenStreetMap.org"), 0);
app_status (-1, _("refresh from OpenStreetMap.org"), 0.0);
for (ret = 0; ret < MLWEBMAX; ret++) wl[ret].p.used = 0;
for (ret = 0; ret < 13; ret++) args[ret] = NULL;
@ -2039,7 +2039,7 @@ void map_load_web (struct map_pos hs, struct map_pos he) {
ret = execwait (&wl[i].p);
if (ret == 1) {
osm_loadfile (wl[i].fcache);
app_status (_("refresh from OpenStreetMap.org"), 0);
app_status (-1, _("refresh from OpenStreetMap.org"), 0.0);
main_wnd_update ();
}
}

@ -200,7 +200,7 @@ void map_search_sort_alg1 (struct maps_sort *data) {
}
if (j % 100 == 0) {
sprintf (text, _("Sorting search.mapidx %d/%d"), j, data->cnt);
app_status (text, 0);
app_status (-1, text, 0.0);
main_wnd_update ();
}
}
@ -350,7 +350,7 @@ void map_search_sort_alg2 (struct maps_sort *data) {
/* display update on the screen */
if (to++ < 0 || to > 250) {
sprintf (text, _("sorting search.mapidx %d"), maps_qs_pos);
app_status (text, 0);
app_status (-1, text, 0.0);
main_wnd_update ();
to = 0;
}
@ -440,7 +440,7 @@ void map_search_sort () {
lid = msd.id;
if (i % 10000 == 0) {
sprintf (text, _("save search.mapidx %d"), i);
app_status (text, 0);
app_status (-1, text, 0.0);
main_wnd_update ();
}
}
@ -471,8 +471,8 @@ void map_search_sort () {
* the size on file.
*/
static char maps_line[MAP_SEARCHLINE_LEN*4];
#warning maps_readpos.. read current position without checing and return
#warning start of next line.
#warning maps_readpos.. read current position without checking
#warning and return start of next line.
/*
* read an random position, check if we are at the start of valid data. If not

@ -346,8 +346,8 @@ int map_webload (char *remotefn, char *localfn, char *statustext) {
else strncpy (_statustext, statustext, 255);
d_printf ("map_webload started");
app.status = APPSTATUS_loadfromweb;
app_status(APPSTATUS_loadfromweb, NULL, 0.0);
strncpy (host, HOST, NET_HOSTLEN);
strncpy (port, PORT, NET_PORTLEN);
sock = tcp_connect (host, port);
@ -399,6 +399,7 @@ int map_webload (char *remotefn, char *localfn, char *statustext) {
to = time(NULL);
if (filesize > 0) sprintf (text, _("%s%d/%dkb loaded"), _statustext, filelen/1024, filesize/1024);
else sprintf (text, _("%s%dkb loaded"), _statustext, filelen/1024);
app_status(-1, text, (float)((float)filelen/(float)filesize));
main_wnd_update ();
}
}
@ -418,12 +419,7 @@ int map_webload (char *remotefn, char *localfn, char *statustext) {
if (file_exist (tmpfn)) unlink (tmpfn);
}
app.status = APPSTATUS_nothing;
app_status(NULL, -1);
map_clear ();
map_init ();
draw_redrawmap ();
draw ();
app_status(APPSTATUS_nothing, NULL, 0.0);
return 0;
};

@ -488,7 +488,7 @@ void DoMenuActions(HWND hWnd, INT id) {
map_webload (rfn, lfn, NULL);
map_search_sort ();
#endif
app_status ("", -1);
app_status (-1, "", 0.0);
}
break;
case IDM_MENU_MAP_WEBLOAD:

Loading…
Cancel
Save