From 8c1b11286c22f22fdffe15e3b5d855679caa9a85 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 30 Jul 2004 13:59:09 +0000 Subject: [PATCH] Fixed small annoyances with drawing selection circle and paint brush. With glflush() change as committed before, updates weren't that good anymore. Solution is actually just flipping drawing order. --- source/blender/src/edit.c | 8 ++++---- source/blender/src/vpaint.c | 36 ++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c index b76ac31375b..0f29ee8bc18 100644 --- a/source/blender/src/edit.c +++ b/source/blender/src/edit.c @@ -342,7 +342,6 @@ void draw_sel_circle(short *mval, short *mvalo, float rad, float rado, int selec glDrawBuffer(GL_FRONT); /* draw circle */ - if(mvalo && no_mvalo==0) { fdrawXORcirc(mvalo[0], mvalo[1], rado); } @@ -393,15 +392,16 @@ void circle_selectCB(select_CBfunc callback) if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || rado!=rad || firsttime) { firsttime= 0; + if(selecting) { + callback(selecting, obj, mval, rad); + } + draw_sel_circle(mval, mvalo, rad, rado, selecting); mvalo[0]= mval[0]; mvalo[1]= mval[1]; rado= rad; - if(selecting) { - callback(selecting, obj, mval, rad); - } } event= extern_qread(&val); if (event) { diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index 018d04bd3e2..055b2d0529d 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -72,6 +72,7 @@ #include "BIF_space.h" #include "BIF_screen.h" #include "BIF_toolbox.h" +#include "BIF_glutil.h" #include "BIF_gl.h" #include "BDR_vpaint.h" @@ -828,9 +829,6 @@ void weight_paint(void) if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - if(firsttime) draw_sel_circle(mval, 0, Gvp.size, Gvp.size, 0); - else draw_sel_circle(mval, mvalo, Gvp.size, Gvp.size, 0); - firsttime= 0; /* which faces are involved */ @@ -912,11 +910,16 @@ void weight_paint(void) else BIF_wait_for_statechange(); if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { -// makeDispList(ob); + scrarea_do_windraw(curarea); + + /* draw circle in backbuf! */ + persp(PERSP_WIN); + fdrawXORcirc((float)mval[0], (float)mval[1], Gvp.size); + persp(PERSP_VIEW); + screen_swapbuffers(); backdrawview3d(0); - draw_sel_circle(mval, 0, Gvp.size, Gvp.size, 0); mvalo[0]= mval[0]; mvalo[1]= mval[1]; @@ -928,9 +931,6 @@ void weight_paint(void) me->mcol= 0; } - /* clear circle */ - draw_sel_circle(0, mvalo, 0, Gvp.size, 1); - makeDispList(ob); allqueue(REDRAWVIEW3D, 0); @@ -992,9 +992,6 @@ void vertex_paint() if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - if(firsttime) draw_sel_circle(mval, 0, Gvp.size, Gvp.size, 0); - else draw_sel_circle(mval, mvalo, Gvp.size, Gvp.size, 0); - firsttime= 0; /* which faces are involved */ @@ -1081,23 +1078,25 @@ void vertex_paint() MTC_Mat4SwapMat4(G.vd->persmat, mat); - } - else BIF_wait_for_statechange(); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { do_shared_vertexcol(me); if(me->tface) { mcol_to_tface(me, 0); } scrarea_do_windraw(curarea); + + /* draw circle in backbuf! */ + persp(PERSP_WIN); + fdrawXORcirc((float)mval[0], (float)mval[1], Gvp.size); + persp(PERSP_VIEW); + screen_swapbuffers(); - draw_sel_circle(mval, 0, Gvp.size, Gvp.size, 0); backdrawview3d(0); - + mvalo[0]= mval[0]; mvalo[1]= mval[1]; } + else BIF_wait_for_statechange(); } if(me->tface) { @@ -1105,9 +1104,6 @@ void vertex_paint() me->mcol= 0; } - /* clear circle */ - draw_sel_circle(0, mvalo, 0, Gvp.size, 1); - allqueue(REDRAWVIEW3D, 0); }