Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 740 Lines • ▼ Show 20 Lines | if (wtb->outline) { | ||||
| if (wtb->emboss) { | if (wtb->emboss) { | ||||
| widget_verts_to_quad_strip_open(wtb, wtb->halfwayvert, quad_strip_emboss); | widget_verts_to_quad_strip_open(wtb, wtb->halfwayvert, quad_strip_emboss); | ||||
| } | } | ||||
| glEnableClientState(GL_VERTEX_ARRAY); | glEnableClientState(GL_VERTEX_ARRAY); | ||||
| for (j = 0; j < WIDGET_AA_JITTER; j++) { | for (j = 0; j < WIDGET_AA_JITTER; j++) { | ||||
| unsigned char emboss[4]; | |||||
| glTranslatef(jit[j][0], jit[j][1], 0.0f); | glTranslatef(jit[j][0], jit[j][1], 0.0f); | ||||
| /* outline */ | /* outline */ | ||||
| glColor4ubv(tcol); | glColor4ubv(tcol); | ||||
| glVertexPointer(2, GL_FLOAT, 0, quad_strip); | glVertexPointer(2, GL_FLOAT, 0, quad_strip); | ||||
| glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert * 2 + 2); | glDrawArrays(GL_QUAD_STRIP, 0, wtb->totvert * 2 + 2); | ||||
| /* emboss bottom shadow */ | /* emboss bottom shadow */ | ||||
| if (wtb->emboss) { | if (wtb->emboss) { | ||||
pablovazquez: I'm no dev, but I get a build error because of this. (ISO C90 forbids mixed declarations and… | |||||
Not Done Inline Actionsthis can be handled a little smarter... if (wtb->emboss) {
UI_GetThemeColor4ubv(TH_EMBOSS, emboss);
if (emboss[3]) {
.....glColor4ubv. glVertexPointer, glDrawArrays... etc
}campbellbarton: this can be handled a little smarter...
if (wtb->emboss) {
UI_GetThemeColor4ubv… | |||||
| glColor4f(1.0f, 1.0f, 1.0f, 0.02f); | UI_GetThemeColor4ubv(TH_EMBOSS, emboss); | ||||
| if (emboss[3]) { | |||||
| glColor4ubv(emboss); | |||||
| glVertexPointer(2, GL_FLOAT, 0, quad_strip_emboss); | glVertexPointer(2, GL_FLOAT, 0, quad_strip_emboss); | ||||
| glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert * 2); | glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert * 2); | ||||
| } | } | ||||
| } | |||||
| glTranslatef(-jit[j][0], -jit[j][1], 0.0f); | glTranslatef(-jit[j][0], -jit[j][1], 0.0f); | ||||
| } | } | ||||
| glDisableClientState(GL_VERTEX_ARRAY); | glDisableClientState(GL_VERTEX_ARRAY); | ||||
| } | } | ||||
| /* decoration */ | /* decoration */ | ||||
| if (wtb->tria1.tot || wtb->tria2.tot) { | if (wtb->tria1.tot || wtb->tria2.tot) { | ||||
| ▲ Show 20 Lines • Show All 3,275 Lines • Show Last 20 Lines | |||||
I'm no dev, but I get a build error because of this. (ISO C90 forbids mixed declarations and code)
Declarations should be done at the beginning of the block (line 749, where the loop starts).