From 534c0edc33285647d81331c0d55faab091d54722 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 18 Nov 2011 15:20:07 +0000 Subject: [PATCH] Larger radio boxes --- src/interface.c | 53 ++++++++++++++++++------------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/src/interface.c b/src/interface.c index 44d2ad9d1..d33dba887 100644 --- a/src/interface.c +++ b/src/interface.c @@ -588,34 +588,33 @@ void ui_radio_draw(pixel *vid_buf, ui_checkbox *ed) { if (ed->checked) { - int count; - for(count=0; count<=2; count++) - { - blendpixel(vid_buf, ed->x+3+count, ed->y+4, 255, 255, 255, 255); - blendpixel(vid_buf, ed->x+4, ed->y+3+count, 255, 255, 255, 255); - } + int nx, ny; + for(nx=-6; nx<=6; nx++) + for(ny=-6; ny<=6; ny++) + if((nx*nx+ny*ny)<16/* && (nx*nx+ny*ny)>28*/) + blendpixel(vid_buf, ed->x+6+nx, ed->y+6+ny, 128, 128, 128, 255); } if (ed->focus) { int nx, ny; - for(nx=-3; nx<=3; nx++) - for(ny=-3; ny<=3; ny++) - if((nx*nx+ny*ny)<14 && (nx*nx+ny*ny)>7) - blendpixel(vid_buf, ed->x+4+nx, ed->y+4+ny, 255, 255, 255, 255); + for(nx=-6; nx<=6; nx++) + for(ny=-6; ny<=6; ny++) + if((nx*nx+ny*ny)<40 && (nx*nx+ny*ny)>28) + blendpixel(vid_buf, ed->x+6+nx, ed->y+6+ny, 255, 255, 255, 255); } else { int nx, ny; - for(nx=-3; nx<=3; nx++) - for(ny=-3; ny<=3; ny++) - if((nx*nx+ny*ny)<14 && (nx*nx+ny*ny)>7) - blendpixel(vid_buf, ed->x+4+nx, ed->y+4+ny, 128, 128, 128, 255); + for(nx=-6; nx<=6; nx++) + for(ny=-6; ny<=6; ny++) + if((nx*nx+ny*ny)<40 && (nx*nx+ny*ny)>28) + blendpixel(vid_buf, ed->x+6+nx, ed->y+6+ny, 128, 128, 128, 255); } } void ui_radio_process(int mx, int my, int mb, int mbq, ui_checkbox *ed) { - int w = 7; + int w = 12; if (mb && !mbq) { @@ -6309,8 +6308,8 @@ void render_ui(pixel * vid_buf, int xcoord, int ycoord, int orientation) colour_cb = calloc(colour_optioncount, sizeof(ui_checkbox)); for(i = 0; i < colour_optioncount; i++) { - colour_cb[i].x = (xcoffset * 0) + xcoord + (i * xoffset) + 9; - colour_cb[i].y = ycoord + (i * yoffset) + 8; + colour_cb[i].x = (xcoffset * 0) + xcoord + (i * xoffset) + 5; + colour_cb[i].y = ycoord + (i * yoffset) + 5; colour_cb[i].focus = 0; colour_cb[i].checked = 0; j = 0; @@ -6343,18 +6342,7 @@ void render_ui(pixel * vid_buf, int xcoord, int ycoord, int orientation) for(i = 0; i < display_optioncount; i++) { display_cb[i].x = (xcoffset * 2) + xcoord + (i * xoffset) + 5; - - if(display_options[i] & DISPLAY_AIR) - { - display_cb[i].x = (xcoffset * 2) + xcoord + (i * xoffset) + 9; - display_cb[i].y = ycoord + (i * yoffset) + 8; - } - else - { - display_cb[i].x = (xcoffset * 2) + xcoord + (i * xoffset) + 5; - display_cb[i].y = ycoord + (i * yoffset) + 5; - } - + display_cb[i].y = ycoord + (i * yoffset) + 5; display_cb[i].focus = 0; display_cb[i].checked = 0; j = 0; @@ -6402,10 +6390,7 @@ void render_ui(pixel * vid_buf, int xcoord, int ycoord, int orientation) for(i = 0; i < display_optioncount; i++) { - if(display_options[i] & DISPLAY_AIR) - drawIcon(vid_buf, display_cb[i].x + 12, display_cb[i].y-1, display_optionicons[i]); - else - drawIcon(vid_buf, display_cb[i].x + 16, display_cb[i].y+2, display_optionicons[i]); + drawIcon(vid_buf, display_cb[i].x + 16, display_cb[i].y+2, display_optionicons[i]); if(display_options[i] & DISPLAY_AIR) { @@ -6433,7 +6418,7 @@ void render_ui(pixel * vid_buf, int xcoord, int ycoord, int orientation) for(i = 0; i < colour_optioncount; i++) { - drawIcon(vid_buf, colour_cb[i].x + 12, colour_cb[i].y-1, colour_optionicons[i]); + drawIcon(vid_buf, colour_cb[i].x + 16, colour_cb[i].y+2, colour_optionicons[i]); ui_radio_draw(vid_buf, &(colour_cb[i])); ui_radio_process(mx, my, b, bq, &(colour_cb[i])); if(colour_cb[i].checked) //One colour only