some fixes..

master
steffen 13 years ago
parent 322630948e
commit 4817c88996

@ -56,7 +56,7 @@ sposmroute:
do if ! make -C $$i; then \ do if ! make -C $$i; then \
exit -2; \ exit -2; \
fi done fi done
$(CC) -o sposmroute -lgtk -lmapsys -lgui -ldraw -lmain -lbase -Lbase -Lmain -Lgtk -Ldraw -Lgui -Lmapsys `pkg-config --libs gtk+-2.0 libxml-2.0` -lbz2 $(DEBUG) $(CC) -o sposmroute -lgtk -lmapsys -lgui -ldraw -lmain -lbase -lgui -Lbase -Lmain -Lgtk -Ldraw -Lgui -Lmapsys `pkg-config --libs gtk+-2.0 libxml-2.0` -lbz2 $(DEBUG)
cleanapp: cleanapp:
rm -rf sposmroute rm -rf sposmroute

@ -1,4 +1,4 @@
/* $Id: gui.c,v 1.6 2013/02/21 23:07:19 steffen Exp $ */ /* $Id: gui.c,v 1.7 2013/02/22 20:46:26 steffen Exp $ */
/*************************************************************************** /***************************************************************************
* gui.c * gui.c
* *
@ -76,12 +76,12 @@ void gui_draw () {
} }
else { else {
ls.width = 1.0; ls.width = 1.0;
ls.c = ls.borderc = color[COLOR_white][3]; ls.c = ls.borderc = color[COLOR_red][3];
draw_polygonstart (); draw_polygonstart ();
draw_polygonadd (0, 0); draw_polygonadd (0, 0);
draw_polygonadd (0, currentwin->h-1); draw_polygonadd (0, currentwin->h);
draw_polygonadd (currentwin->w-1, currentwin->h-1); draw_polygonadd (currentwin->w, currentwin->h);
draw_polygonadd (currentwin->w-1, 0); draw_polygonadd (currentwin->w, 0);
draw_polygonfinish (currentwin->screen, ls, color[COLOR_white][0], 1); draw_polygonfinish (currentwin->screen, ls, color[COLOR_white][0], 1);
gfx_draw_text (currentwin->screen, 4, 0, currentwin->title, &color[COLOR_white][3]); gfx_draw_text (currentwin->screen, 4, 0, currentwin->title, &color[COLOR_white][3]);
} }

@ -59,31 +59,31 @@ void gui_buttons_show () {
/* add buttons */ /* add buttons */
if (btn_zoomin == NULL) { if (btn_zoomin == NULL) {
btn_zoomin = gui_button_new (_("+"), 0, 0, 31, 31); btn_zoomin = gui_button_new (_("+"), 1, 1, 30, 30);
btn_zoomin->callback_clicked = (void*)gui_buttons_zoomin; btn_zoomin->callback_clicked = (void*)gui_buttons_zoomin;
btn_zoomin->callback_draw = (void*)gui_buttons_draw; btn_zoomin->callback_draw = (void*)gui_buttons_draw;
} }
if (btn_zoomout == NULL) { if (btn_zoomout == NULL) {
btn_zoomout = gui_button_new (_("-"), 40, 0, 31, 31); btn_zoomout = gui_button_new (_("-"), 41, 1, 30, 30);
btn_zoomout->callback_clicked = (void*)gui_buttons_zoomout; btn_zoomout->callback_clicked = (void*)gui_buttons_zoomout;
btn_zoomout->callback_draw = (void*)gui_buttons_draw; btn_zoomout->callback_draw = (void*)gui_buttons_draw;
} }
if (btn_gps == NULL) { if (btn_gps == NULL) {
btn_gps = gui_button_new (_("GPS"), 80, 0, 31, 31); btn_gps = gui_button_new (_("GPS"), 81, 1, 30, 30);
btn_gps->callback_clicked = (void*)gui_buttons_gps; btn_gps->callback_clicked = (void*)gui_buttons_gps;
btn_gps->callback_draw = (void*)gui_buttons_draw; btn_gps->callback_draw = (void*)gui_buttons_draw;
} }
if (btn_menu == NULL) { if (btn_menu == NULL) {
btn_menu = gui_button_new (_("M"), 120, 0, 31, 31); btn_menu = gui_button_new (_("M"), 121, 1, 30, 30);
btn_menu->callback_clicked = (void*)gui_buttons_menu; btn_menu->callback_clicked = (void*)gui_buttons_menu;
btn_menu->callback_draw = (void*)gui_buttons_draw; btn_menu->callback_draw = (void*)gui_buttons_draw;
} }
if (btn_fav == NULL) { if (btn_fav == NULL) {
btn_fav = gui_button_new (_("F"), 160, 0, 31, 31); btn_fav = gui_button_new (_("F"), 161, 1, 30, 30);
btn_fav->callback_clicked = (void*)gui_buttons_fav; btn_fav->callback_clicked = (void*)gui_buttons_fav;
btn_fav->callback_draw = (void*)gui_buttons_draw; btn_fav->callback_draw = (void*)gui_buttons_draw;
} }

@ -1,4 +1,4 @@
/* $Id: gui_mainmenu.c,v 1.4 2013/02/21 23:07:19 steffen Exp $ */ /* $Id: gui_mainmenu.c,v 1.5 2013/02/22 20:46:26 steffen Exp $ */
/*************************************************************************** /***************************************************************************
* gui_mainmenu.c * gui_mainmenu.c
* *
@ -48,7 +48,7 @@ GUIButton *mbtn_config= NULL;
static GUIWindow wmmenu = {0}; static GUIWindow wmmenu = {0};
void gui_mainmenu_show () { void gui_mainmenu_show () {
if (wmmenu.screen == NULL) gui_window_new (&wmmenu, 175, 200, _("OSMroute Menu")); if (wmmenu.screen == NULL) gui_window_new (&wmmenu, 200, 200, _("OSMroute Menu"));
wmmenu.screen_changed = 1; wmmenu.screen_changed = 1;
wmmenu.style = WGUI_S_VCENTER | WGUI_S_HCENTER; wmmenu.style = WGUI_S_VCENTER | WGUI_S_HCENTER;

@ -140,7 +140,7 @@ void gfx_draw_line (struct image *dimg, int x1, int y1, int x2, int y2, struct l
gfx_fbo_switch (dimg); gfx_fbo_switch (dimg);
if (style.width < 1.0) style.width = 1.0; if (style.width < 1.0) style.width = 1.0;
glLineWidth (style.width); glLineWidth (style.width);
glColor3f (style.c.c.r, style.c.c.g, style.c.c.b); glColor4f(style.c.c.r, style.c.c.g, style.c.c.b, 1.0);
glBegin (GL_LINES); glBegin (GL_LINES);
glVertex2i (x1, y1); glVertex2i (x1, y1);
glVertex2i (x2, y2); glVertex2i (x2, y2);
@ -155,19 +155,25 @@ void gfx_draw_polygon (struct image *dimg, iPoint *p, int pcnt, struct line_styl
int i; int i;
gfx_fbo_switch (dimg); gfx_fbo_switch (dimg);
if (dimg) {
d_printf ("%d,%d", dimg->width, dimg->height);
}
glBegin (GL_POLYGON); glBegin (GL_POLYGON);
glColor4f (c.c.r, c.c.g, c.c.b, 1.0f); glColor4f (c.c.r, c.c.g, c.c.b, 1.0f);
for (i = 0; i < pcnt; i++) for (i = 0; i < pcnt; i++) {
d_printf (" %d, %d", p[i].x, p[i].y);
glVertex2i (p[i].x, p[i].y); glVertex2i (p[i].x, p[i].y);
}
glEnd (); glEnd ();
// glBegin (GL_LINES); if (style.width > 0.0) {
// d_printf ("line width: %f",style.width); glBegin (GL_LINE_LOOP);
// glLineWidth (style.width/2.0); glLineWidth (style.width/2.0);
// glColor4f (style.c.c.r, style.c.c.g, style.c.c.b, 1.0f); glColor4f (style.c.c.r, style.c.c.g, style.c.c.b, 1.0f);
// for (i = 0; i < pcnt; i++) for (i = 0; i < pcnt; i++)
// glVertex2i (p[i].x, p[i].y); glVertex2i (p[i].x, p[i].y);
// glEnd (); glEnd ();
}
}; };
@ -194,11 +200,13 @@ void gfx_draw_img (struct image *dimg, int dx, int dy, int dw, int dh, struct im
glBegin (GL_QUADS); glBegin (GL_QUADS);
glColor4f (1.0f, 1.0f, 1.0f, 1.0f); glColor4f (1.0f, 1.0f, 1.0f, 1.0f);
fx = (float) sx/(float) simg->width; fx = (float) sx/(float) (simg->width);
fy = (float) sy/(float) simg->height; fy = (float) sy/(float) (simg->height);
fw = (float) dw/(float) simg->width; fw = (float) dw/(float) (simg->width);
fh = (float) dh/(float) simg->height; fh = (float) dh/(float) (simg->height);
d_printf ("%d, %d ---- (%d, %d, %d, %d) --- (%f, %f, %f, %f)", simg->width, simg->height, sx, sy, dw, dh, fx, fy, fw, fh);
glTexCoord2d (fx, fy); glTexCoord2d (fx, fy);
glVertex2i (dx, dy); glVertex2i (dx, dy);
glTexCoord2d (fx, fy+fh); glTexCoord2d (fx, fy+fh);
@ -296,6 +304,22 @@ void gfx_img_free (struct image *img) {
void gfx_draw_rect (struct image *dimg, int x1, int y1, int x2, int y2, struct color *c) { void gfx_draw_rect (struct image *dimg, int x1, int y1, int x2, int y2, struct color *c) {
d_printf ("rect...");
// int i;
//
// gfx_fbo_switch (dimg);
// glBegin (GL_POLYGON);
// glColor4f (c.c.r, c.c.g, c.c.b, 1.0f);
// for (i = 0; i < pcnt; i++)
// glVertex2i (p[i].x, p[i].y);
// glEnd ();
//
// glBegin (GL_LINES);
// glLineWidth (style.width/2.0);
// glColor4f (style.c.c.r, style.c.c.g, style.c.c.b, 1.0f);
// for (i = 0; i < pcnt; i++)
// glVertex2i (p[i].x, p[i].y);
// glEnd ();
}; };

Loading…
Cancel
Save