Uses the bglFlush() and is_a_really_crappy_intel_card() hacks to give

better support on low-end Macintoshes with integrated Intel graphics
chipsets.  Patch received from "UncleZiev" on #blendercoders, but I
adjusted it so other video chipsets and platforms are unaffected.

The only visual difference is that on MacBook and iMac machines, the box
select outline is drawn with solid, not dashed lines like other platforms
and not invisible as they were previously.
This commit is contained in:
2007-03-06 03:39:15 +00:00
parent 8d95e59fea
commit 3927ee214c
4 changed files with 15 additions and 11 deletions

View File

@@ -206,7 +206,7 @@ void bglVertex3f(float x, float y, float z);
void bglVertex2fv(float *vec); void bglVertex2fv(float *vec);
/* intel gfx cards frontbuffer problem */ /* intel gfx cards frontbuffer problem */
void bglFlush(void); void bglFlush(void);
int is_a_really_crappy_intel_card(void);
void set_inverted_drawing(int enable); void set_inverted_drawing(int enable);

View File

@@ -168,7 +168,7 @@ int get_border(rcti *rect, short flag)
/* draws the selection initial cross */ /* draws the selection initial cross */
sdrawXORline4(0, 0, mvalo[1], curarea->winx, mvalo[1]); sdrawXORline4(0, 0, mvalo[1], curarea->winx, mvalo[1]);
sdrawXORline4(1, mvalo[0], 0, mvalo[0], curarea->winy); sdrawXORline4(1, mvalo[0], 0, mvalo[0], curarea->winy);
glFlush(); bglFlush();
while(TRUE) { while(TRUE) {
@@ -180,7 +180,7 @@ int get_border(rcti *rect, short flag)
/* aiming cross */ /* aiming cross */
sdrawXORline4(0, 0, mval[1], curarea->winx, mval[1]); sdrawXORline4(0, 0, mval[1], curarea->winx, mval[1]);
sdrawXORline4(1, mval[0], 0, mval[0], curarea->winy); sdrawXORline4(1, mval[0], 0, mval[0], curarea->winy);
glFlush(); bglFlush();
mvalo[0]= mval[0]; mvalo[0]= mval[0];
mvalo[1]= mval[1]; mvalo[1]= mval[1];
@@ -227,7 +227,7 @@ int get_border(rcti *rect, short flag)
sdrawXORline4(1, x1, mvalo[1], mvalo[0], mvalo[1]); sdrawXORline4(1, x1, mvalo[1], mvalo[0], mvalo[1]);
sdrawXORline4(2, mvalo[0], mvalo[1], mvalo[0], y1); sdrawXORline4(2, mvalo[0], mvalo[1], mvalo[0], y1);
sdrawXORline4(3, mvalo[0], y1, x1, y1); sdrawXORline4(3, mvalo[0], y1, x1, y1);
glFlush(); bglFlush();
while(TRUE) { while(TRUE) {
getmouseco_areawin(mval); getmouseco_areawin(mval);
@@ -294,7 +294,7 @@ int get_border(rcti *rect, short flag)
BMF_DrawString(G.fonts, str); BMF_DrawString(G.fonts, str);
} }
glFlush(); bglFlush();
mvalo[0]= mval[0]; mvalo[0]= mval[0];
mvalo[1]= mval[1]; mvalo[1]= mval[1];
@@ -344,7 +344,7 @@ int get_border(rcti *rect, short flag)
} }
} }
glFlush(); bglFlush();
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
glDrawBuffer(GL_BACK); glDrawBuffer(GL_BACK);
@@ -399,7 +399,7 @@ void draw_sel_circle(short *mval, short *mvalo, float rad, float rado, int selec
} }
//setlinestyle(0); //setlinestyle(0);
glFlush(); bglFlush();
persp(PERSP_VIEW); persp(PERSP_VIEW);
glDrawBuffer(GL_BACK); glDrawBuffer(GL_BACK);
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);

View File

@@ -1656,10 +1656,14 @@ void borderselect(void)
face_borderselect(); face_borderselect();
return; return;
} }
setlinestyle(2); a = 0;
#ifdef __APPLE__
a = is_a_really_crappy_intel_card();
#endif
if (!a) setlinestyle(2);
val= get_border(&rect, 3); val= get_border(&rect, 3);
setlinestyle(0); if (!a) setlinestyle(0);
if(val==0) if(val==0)
return; return;

View File

@@ -661,7 +661,7 @@ void bglPolygonOffset(float dist)
} }
} }
static int is_a_really_crappy_intel_card(void) int is_a_really_crappy_intel_card(void)
{ {
static int well_is_it= -1; static int well_is_it= -1;