Fix for bug #5539, brush circle cursor is slow.
This commit is contained in:
@@ -119,6 +119,7 @@ void sculptmode_propset_init(PropsetMode mode);
|
||||
void sculptmode_propset(const unsigned short event);
|
||||
void sculptmode_selectbrush_menu();
|
||||
void sculptmode_draw_mesh(int);
|
||||
void sculpt_paint_brush(char clear);
|
||||
|
||||
struct BrushData *sculptmode_brush();
|
||||
|
||||
|
||||
@@ -2787,9 +2787,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
||||
fdrawXORcirc(pd->origloc[0], pd->origloc[1], r1);
|
||||
fdrawXORcirc(pd->origloc[0], pd->origloc[1], r2);
|
||||
} else {
|
||||
short c[2];
|
||||
getmouseco_areawin(c);
|
||||
fdrawXORcirc((float)c[0], (float)c[1], sculptmode_brush()->size);
|
||||
sculpt_paint_brush(1);
|
||||
}
|
||||
}
|
||||
retopo_draw_paint_lines();
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
#include "BIF_editkey.h"
|
||||
#include "BIF_editview.h"
|
||||
#include "BIF_glutil.h"
|
||||
#include "BIF_gl.h"
|
||||
#include "BIF_interface.h"
|
||||
@@ -1538,6 +1539,24 @@ void sculptmode_propset_init(PropsetMode mode)
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
}
|
||||
|
||||
void sculpt_paint_brush(char clear)
|
||||
{
|
||||
static short mvalo[2];
|
||||
short mval[2];
|
||||
const short rad= sculptmode_brush()->size;
|
||||
|
||||
getmouseco_areawin(mval);
|
||||
|
||||
persp(PERSP_WIN);
|
||||
if(clear)
|
||||
fdrawXORcirc(mval[0], mval[1], rad);
|
||||
else
|
||||
draw_sel_circle(mval, mvalo, rad, rad, 0);
|
||||
|
||||
mvalo[0]= mval[0];
|
||||
mvalo[1]= mval[1];
|
||||
}
|
||||
|
||||
void sculptmode_propset(unsigned short event)
|
||||
{
|
||||
PropsetData *pd= sculpt_session()->propset;
|
||||
@@ -1891,9 +1910,7 @@ void sculpt()
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
/* Draw cursor */
|
||||
persp(PERSP_WIN);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
fdrawXORcirc((float)mouse[0],(float)mouse[1],sculptmode_brush()->size);
|
||||
sculpt_paint_brush(1);
|
||||
|
||||
myswapbuffers();
|
||||
}
|
||||
|
||||
@@ -1052,8 +1052,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
if(val) {
|
||||
|
||||
if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
||||
|
||||
//if(event==MOUSEY || event==MOUSEX) return;
|
||||
|
||||
if(event==UI_BUT_EVENT) do_butspace(val); /* temporal, view3d deserves own queue? */
|
||||
|
||||
@@ -1075,7 +1073,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
}
|
||||
else if(event!=LEFTMOUSE && event!=MIDDLEMOUSE && (event==MOUSEY || event==MOUSEX)) {
|
||||
if(!bwin_qtest(sa->win))
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
sculpt_paint_brush(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user