Fix for part of bug #17464, though not the original issue yet. A GLSL

shadow drawing fix also affected 3d view opengl render, hiding armatures,
now there's separate flags for it.
This commit is contained in:
2008-10-03 19:34:49 +00:00
parent 128ee40d60
commit 5574655dad
6 changed files with 17 additions and 25 deletions

View File

@@ -157,10 +157,10 @@ typedef struct Global {
/* **************** GLOBAL ********************* */
/* G.f */
#define G_DISABLE_OK (1 << 0)
#define G_RENDER_OGL (1 << 0)
#define G_PLAYANIM (1 << 1)
/* also uses G_FILE_AUTOPLAY */
#define G_SIMULATION (1 << 3)
#define G_RENDER_SHADOW (1 << 3)
#define G_BACKBUFSEL (1 << 4)
#define G_PICKSEL (1 << 5)
#define G_DRAWNORMALS (1 << 6)

View File

@@ -4952,9 +4952,7 @@ void do_meshbuts(unsigned short event)
if( select_area(SPACE_VIEW3D)) spin_mesh(G.scene->toolsettings->step, G.scene->toolsettings->degr, 0, 1);
break;
case B_EXTR:
G.f |= G_DISABLE_OK;
if( select_area(SPACE_VIEW3D)) extrude_mesh();
G.f -= G_DISABLE_OK;
break;
case B_SCREW:
if( select_area(SPACE_VIEW3D)) screw_mesh(G.scene->toolsettings->step, G.scene->toolsettings->turn);
@@ -4963,9 +4961,7 @@ void do_meshbuts(unsigned short event)
if( select_area(SPACE_VIEW3D)) extrude_repeat_mesh(G.scene->toolsettings->step, G.scene->toolsettings->extr_offs);
break;
case B_SPLIT:
G.f |= G_DISABLE_OK;
split_mesh();
G.f -= G_DISABLE_OK;
break;
case B_REMDOUB:
count= removedoublesflag(1, 0, G.scene->toolsettings->doublimit);

View File

@@ -2506,7 +2506,7 @@ int draw_armature(Base *base, int dt, int flag)
bArmature *arm= ob->data;
int retval= 0;
if(G.f & G_SIMULATION)
if(G.f & G_RENDER_SHADOW)
return 1;
if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) {

View File

@@ -281,7 +281,7 @@ void drawaxes(float size, int flag, char drawtype)
float v2[3]= {0.0, 0.0, 0.0};
float v3[3]= {0.0, 0.0, 0.0};
if(G.f & G_SIMULATION)
if(G.f & G_RENDER_SHADOW)
return;
switch(drawtype) {
@@ -666,7 +666,7 @@ static void drawlamp(Object *ob)
float imat[4][4], curcol[4];
char col[4];
if(G.f & G_SIMULATION)
if(G.f & G_RENDER_SHADOW)
return;
la= ob->data;
@@ -958,7 +958,7 @@ static void drawcamera(Object *ob, int flag)
float vec[8][4], tmat[4][4], fac, facx, facy, depth;
int i;
if(G.f & G_SIMULATION)
if(G.f & G_RENDER_SHADOW)
return;
cam= ob->data;
@@ -1768,7 +1768,7 @@ static void draw_verse_debug(Object *ob, EditMesh *em)
float v1[3], v2[3], v3[3], v4[3], fvec[3], col[3];
char val[32];
if(G.f & G_SIMULATION)
if(G.f & G_RENDER_SHADOW)
return;
if(G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0)
@@ -1834,7 +1834,7 @@ static void draw_em_measure_stats(Object *ob, EditMesh *em)
char conv_float[5]; /* Use a float conversion matching the grid size */
float area, col[3]; /* area of the face, color of the text to draw */
if(G.f & G_SIMULATION)
if(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))
return;
/* make the precission of the pronted value proportionate to the gridsize */
@@ -5164,7 +5164,7 @@ void draw_object(Base *base, int flag)
}
/* draw extra: after normal draw because of makeDispList */
if(dtx && !(G.f & G_SIMULATION)) {
if(dtx && !(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))) {
if(dtx & OB_AXIS) {
drawaxes(1.0f, flag, OB_ARROWS);
}
@@ -5204,7 +5204,7 @@ void draw_object(Base *base, int flag)
if(warning_recursive) return;
if(base->flag & (OB_FROMDUPLI|OB_RADIO)) return;
if(G.f & G_SIMULATION) return;
if(G.f & G_RENDER_SHADOW) return;
/* object centers, need to be drawn in viewmat space for speed, but OK for picking select */
if(ob!=OBACT || (G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))==0) {

View File

@@ -3129,13 +3129,9 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
}
if(v3d->drawtype > OB_WIRE) {
if(G.f & G_SIMULATION)
glClearColor(0.0, 0.0, 0.0, 0.0);
else {
float col[3];
BIF_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
}
float col[3];
BIF_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
@@ -3423,8 +3419,9 @@ void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int win
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* abuse! to make sure it doesnt draw the helpstuff */
G.f |= G_SIMULATION;
G.f |= G_RENDER_OGL;
if(shadow)
G.f |= G_RENDER_SHADOW;
/* first draw set */
if(G.scene->set) {
@@ -3500,7 +3497,7 @@ void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int win
draw_gpencil_oglrender(v3d, winx, winy);
}
G.f &= ~G_SIMULATION;
G.f &= ~(G_RENDER_OGL|G_RENDER_SHADOW);
if(!shadow) {
glFlush();

View File

@@ -1266,7 +1266,6 @@ void viewmove(int mode)
mvalo[1]= mval[1];
if(G.f & G_PLAYANIM) inner_play_anim_loop(0, 0);
if(G.f & G_SIMULATION) break;
/* If in retopo paint mode, update lines */
if(retopo_mesh_paint_check() && G.vd->retopo_view_data) {