X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fscr_mod.c;fp=src%2Fscr_mod.c;h=b1cbc1d731a19eeca3e24fccacee37dd2be3fb12;hb=e17bfec530d9d476c61c9bb2a156788c742db43b;hp=efa4cb0defda3861f926a082d18b3ca2b769bb39;hpb=4a690a4a5268847c24e8edb08ba558a36bbd6d3c;p=retroray diff --git a/src/scr_mod.c b/src/scr_mod.c index efa4cb0..b1cbc1d 100644 --- a/src/scr_mod.c +++ b/src/scr_mod.c @@ -69,6 +69,7 @@ enum { static rtk_widget *tools[NUM_TOOLS]; static int vpdirty; +static rtk_rect totalrend; static int mdl_init(void); @@ -388,15 +389,20 @@ static void mdl_mouse(int bn, int press, int x, int y) app_rband(0, 0, 0, 0); if(cur_tool == TOOL_REND_AREA) { - if(prev_tool >= 0) { - act_settool(prev_tool); + if(rband.width && rband.height) { + rendering = 1; + rend_size(win_width, win_height); + rtk_fix_rect(&rband); + rendrect = rband; + rend_begin(rband.x, rband.y, rband.width, rband.height); + app_redisplay(rband.x, rband.y, rband.width, rband.height); + + if(totalrend.width) { + rtk_rect_union(&totalrend, &rband); + } else { + totalrend = rband; + } } - rendering = 1; - rend_size(win_width, win_height); - rtk_fix_rect(&rband); - rendrect = rband; - rend_begin(rband.x, rband.y, rband.width, rband.height); - app_redisplay(rband.x, rband.y, rband.width, rband.height); } } else if(bn == 0 && x == rband.x && y == rband.y) { @@ -518,6 +524,13 @@ static void act_settool(int tidx) int i; rtk_rect r; + if(tidx == prev_tool) return; + + if(prev_tool == TOOL_REND_AREA) { + app_redisplay(totalrend.x, totalrend.y, totalrend.width, totalrend.height); + totalrend.width = 0; + } + prev_tool = cur_tool; cur_tool = tidx; for(i=0; i