X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fscr_mod.c;h=efa4cb0defda3861f926a082d18b3ca2b769bb39;hb=4a690a4a5268847c24e8edb08ba558a36bbd6d3c;hp=3ad4e7b64a55c777b90aa028b9cd7cc103cfc937;hpb=bba16e9faf7ff0e4089ba75c06baef713da04a4a;p=retroray diff --git a/src/scr_mod.c b/src/scr_mod.c index 3ad4e7b..efa4cb0 100644 --- a/src/scr_mod.c +++ b/src/scr_mod.c @@ -90,8 +90,6 @@ static void act_settool(int tidx); static void act_addobj(void); static void act_rmobj(void); -static void fix_rect(rtk_rect *rect); -static void draw_rband(void); static void moveobj(struct object *obj, int px0, int py0, int px1, int py1); static void inval_vport(void); @@ -253,17 +251,12 @@ static void mdl_display(void) if(rendering) { if(!render(framebuf)) { rendering = 0; - vpdirty = 1; } app_redisplay(rendrect.x, rendrect.y, rendrect.width, rendrect.height); } /* GUI */ rtk_draw_widget(toolbar); - - if(rband_valid) { - draw_rband(); - } } static void draw_object(struct object *obj) @@ -392,6 +385,7 @@ static void mdl_mouse(int bn, int press, int x, int y) if(rband_valid) { rband_valid = 0; + app_rband(0, 0, 0, 0); if(cur_tool == TOOL_REND_AREA) { if(prev_tool >= 0) { @@ -399,11 +393,11 @@ static void mdl_mouse(int bn, int press, int x, int y) } rendering = 1; rend_size(win_width, win_height); - fix_rect(&rband); + 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); } - app_redisplay(rband.x, rband.y, rband.width, rband.height); } else if(bn == 0 && x == rband.x && y == rband.y) { primray(&pickray, x, y); @@ -458,6 +452,7 @@ static void mdl_motion(int x, int y) rband.width = x - rband.x; rband.height = y - rband.y; rband_valid = 1; + app_rband(rband.x, rband.y, rband.width, rband.height); } break; @@ -558,56 +553,6 @@ static void act_rmobj(void) } } -static void fix_rect(rtk_rect *rect) -{ - int x, y, w, h; - - x = rband.x; - y = rband.y; - - if(rband.width < 0) { - w = -rband.width; - x += rband.width; - } else { - w = rband.width; - } - if(rband.height < 0) { - h = -rband.height; - y += rband.height; - } else { - h = rband.height; - } - - rect->x = x; - rect->y = y; - rect->width = w; - rect->height = h; -} - -static void draw_rband(void) -{ - int i; - rtk_rect rect; - uint32_t *fbptr, *bptr; - - rect = rband; - fix_rect(&rect); - - fbptr = framebuf + rect.y * win_width + rect.x; - bptr = fbptr + win_width * (rect.height - 1); - - for(i=0; i