[Bf-blender-cvs] [49de1ad] soc-2013-viewport_fx: fixed compile errors on MacOSX Clang 5.1 after previous merge
Jason Wilkins
noreply at git.blender.org
Thu May 29 05:21:06 CEST 2014
Commit: 49de1ada8dcba35862759e0f7da5ca2209b4f588
Author: Jason Wilkins
Date: Tue May 20 00:08:13 2014 -0500
https://developer.blender.org/rB49de1ada8dcba35862759e0f7da5ca2209b4f588
fixed compile errors on MacOSX Clang 5.1 after previous merge
===================================================================
M extern/glew-es/src/glew.c
M source/blender/blenkernel/BKE_DerivedMesh.h
M source/blender/editors/animation/keyframes_draw.c
M source/blender/editors/interface/interface_panel.c
M source/blender/editors/mask/mask_draw.c
M source/blender/editors/mesh/editmesh_knife.c
M source/blender/editors/sculpt_paint/paint_cursor.c
M source/blender/editors/space_clip/clip_draw.c
M source/blender/editors/space_clip/clip_graph_draw.c
M source/blender/editors/space_clip/space_clip.c
M source/blender/editors/space_graph/graph_draw.c
M source/blender/editors/space_image/image_draw.c
M source/blender/editors/space_sequencer/sequencer_draw.c
M source/blender/editors/space_view3d/drawarmature.c
M source/blender/editors/space_view3d/drawmesh.c
M source/blender/editors/space_view3d/drawobject.c
M source/blender/editors/space_view3d/view3d_walk.c
M source/blender/editors/uvedit/uvedit_draw.c
M source/blender/gpu/GPU_deprecated.h
M source/blender/gpu/GPU_material.h
M source/blender/gpu/intern/gpu_draw.c
M source/blender/gpu/intern/gpu_raster.c
M source/blender/gpu/intern/gpu_sprite.c
===================================================================
diff --git a/extern/glew-es/src/glew.c b/extern/glew-es/src/glew.c
index 6124321..2cab97e 100644
--- a/extern/glew-es/src/glew.c
+++ b/extern/glew-es/src/glew.c
@@ -423,7 +423,7 @@ static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, c
}
#ifndef GLEW_ES_ONLY
else { // XXX jwilkins: unified extension string is deprecated
- GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC pglGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress("glGetStringi");
+ PFNGLGETSTRINGIPROC pglGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress("glGetStringi");
if (pglGetStringi != NULL) {
const GLubyte* ext;
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 216c119..b3db0ea 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -150,6 +150,8 @@ typedef int (*DMCompareDrawOptions)(void *userData, int cur_index, int next_inde
typedef void (*DMSetDrawInterpOptions)(void *userData, int index, float t);
typedef DMDrawOption (*DMSetDrawOptions)(void *userData, int index);
typedef DMDrawOption (*DMSetDrawOptionsTex)(struct MTFace *tface, const bool has_vcol, int matnr);
+typedef void (*DMForEachMappedVert)(void *, int, const float *, const float *, const short *);
+typedef void (*DMForEachMappedFaceCenter)(void *, int, const float *, const float *);
typedef enum DMDrawFlag {
DM_DRAW_USE_COLORS = 1,
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 5152113..c95afe0 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -599,7 +599,7 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel,
* greying out protected/muted channels doesn't work correctly!
*/
inner_col[3] *= alpha;
- glColor4fv(inner_col);
+ gpuColor4fv(inner_col);
/* draw the "filled in" interior poly now */
gpuBegin(GL_QUADS);
@@ -623,7 +623,7 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel,
else UI_GetThemeColor4fv(TH_KEYBORDER, border_col);
border_col[3] *= alpha;
- glColor4fv(border_col);
+ gpuColor4fv(border_col);
gpuBegin(GL_LINE_LOOP);
gpuVertex2fv(_unit_diamond_shape[0]);
@@ -671,7 +671,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
UI_GetThemeColor4fv(TH_STRIP, color);
color[3] *= alpha;
- glColor4fv(color);
+ gpuColor4fv(color);
gpuSingleFilledRectf(ab->start, ypos - iconsize, ab->end, ypos + iconsize);
}
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 2b79b11..4271092 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -51,6 +51,7 @@
#include "BKE_context.h"
#include "BKE_screen.h"
+#include "GPU_basic.h"
#include "GPU_blender_aspect.h"
#include "GPU_colors.h"
#include "GPU_primitives.h"
@@ -618,8 +619,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con
{
glEnable(GL_BLEND);
UI_icon_draw_aspect(headrect.xmax - ((PNL_ICON * 2.2f) / block->aspect), headrect.ymin + (5.0f / block->aspect),
- (panel->flag & PNL_PIN) ? ICON_PINNED : ICON_UNPINNED,
- (block->aspect / UI_DPI_FAC), 1.0f);
+ (panel->flag & PNL_PIN) ? ICON_PINNED : ICON_UNPINNED,
+ (block->aspect / UI_DPI_FAC), 1.0f);
glDisable(GL_BLEND);
}
@@ -1338,15 +1339,15 @@ void UI_panel_category_clear_all(ARegion *ar)
/* based on uiDrawBox, check on making a version which allows us to skip some sides */
static void ui_panel_category_draw_tab(int mode, float minx, float miny, float maxx, float maxy, float rad,
- int roundboxtype,
- const bool use_highlight, const bool use_shadow,
- const unsigned char highlight_fade[3])
+ int roundboxtype,
+ const bool use_highlight, const bool use_shadow,
+ const unsigned char highlight_fade[3])
{
float vec[4][2] = {
- {0.195, 0.02},
- {0.55, 0.169},
- {0.831, 0.45},
- {0.98, 0.805}};
+ {0.195, 0.02},
+ {0.55, 0.169},
+ {0.831, 0.45},
+ {0.98, 0.805}};
int a;
/* mult */
@@ -1357,69 +1358,73 @@ static void ui_panel_category_draw_tab(int mode, float minx, float miny, float m
(void)use_shadow;
(void)use_highlight;
- glBegin(mode);
+ gpuImmediateFormat_V2();
+
+ gpuBegin(mode);
/* start with corner right-top */
if (use_highlight) {
if (roundboxtype & UI_CNR_TOP_RIGHT) {
- glVertex2f(maxx, maxy - rad);
+ gpuVertex2f(maxx, maxy - rad);
for (a = 0; a < 4; a++) {
- glVertex2f(maxx - vec[a][1], maxy - rad + vec[a][0]);
+ gpuVertex2f(maxx - vec[a][1], maxy - rad + vec[a][0]);
}
- glVertex2f(maxx - rad, maxy);
+ gpuVertex2f(maxx - rad, maxy);
}
else {
- glVertex2f(maxx, maxy);
+ gpuVertex2f(maxx, maxy);
}
/* corner left-top */
if (roundboxtype & UI_CNR_TOP_LEFT) {
- glVertex2f(minx + rad, maxy);
+ gpuVertex2f(minx + rad, maxy);
for (a = 0; a < 4; a++) {
- glVertex2f(minx + rad - vec[a][0], maxy - vec[a][1]);
+ gpuVertex2f(minx + rad - vec[a][0], maxy - vec[a][1]);
}
- glVertex2f(minx, maxy - rad);
+ gpuVertex2f(minx, maxy - rad);
}
else {
- glVertex2f(minx, maxy);
+ gpuVertex2f(minx, maxy);
}
}
if (use_highlight && !use_shadow) {
if (highlight_fade) {
- glColor3ubv(highlight_fade);
+ gpuColor3ubv(highlight_fade);
}
- glVertex2f(minx, miny + rad);
- glEnd();
+ gpuVertex2f(minx, miny + rad);
+ gpuEnd();
return;
}
/* corner left-bottom */
if (roundboxtype & UI_CNR_BOTTOM_LEFT) {
- glVertex2f(minx, miny + rad);
+ gpuVertex2f(minx, miny + rad);
for (a = 0; a < 4; a++) {
- glVertex2f(minx + vec[a][1], miny + rad - vec[a][0]);
+ gpuVertex2f(minx + vec[a][1], miny + rad - vec[a][0]);
}
- glVertex2f(minx + rad, miny);
+ gpuVertex2f(minx + rad, miny);
}
else {
- glVertex2f(minx, miny);
+ gpuVertex2f(minx, miny);
}
/* corner right-bottom */
if (roundboxtype & UI_CNR_BOTTOM_RIGHT) {
- glVertex2f(maxx - rad, miny);
+ gpuVertex2f(maxx - rad, miny);
for (a = 0; a < 4; a++) {
- glVertex2f(maxx - rad + vec[a][0], miny + vec[a][1]);
+ gpuVertex2f(maxx - rad + vec[a][0], miny + vec[a][1]);
}
- glVertex2f(maxx, miny + rad);
+ gpuVertex2f(maxx, miny + rad);
}
else {
- glVertex2f(maxx, miny);
+ gpuVertex2f(maxx, miny);
}
- glEnd();
+ gpuEnd();
+
+ gpuImmediateUnformat();
}
@@ -1545,13 +1550,13 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active)
/* draw the background */
if (is_alpha) {
glEnable(GL_BLEND);
- glColor4ubv(theme_col_tab_bg);
+ gpuColor4ubv(theme_col_tab_bg);
}
else {
- glColor3ubv(theme_col_tab_bg);
+ gpuColor3ubv(theme_col_tab_bg);
}
- glRecti(v2d->mask.xmin, v2d->mask.ymin, v2d->mask.xmin + category_tabs_width, v2d->mask.ymax);
+ gpuSingleFilledRecti(v2d->mask.xmin, v2d->mask.ymin, v2d->mask.xmin + category_tabs_width, v2d->mask.ymax);
if (is_alpha) {
glDisable(GL_BLEND);
@@ -1573,38 +1578,35 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active)
if (is_active)
#endif
{
- glColor3ubv(is_active ? theme_col_tab_active : theme_col_tab_inactive);
+ gpuColor3ubv(is_active ? theme_col_tab_active : theme_col_tab_inactive);
ui_panel_category_draw_tab(GL_POLYGON, rct->xmin, rct->ymin, rct->xmax, rct->ymax,
- tab_curve_radius - px, roundboxtype, true, true, NULL);
+ tab_curve_radius - px, roundboxtype, true, true, NULL);
/* tab outline */
- glColor3ubv(theme_col_tab_outline);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ gpuColor3ubv(theme_col_tab_outline);
ui_panel_category_draw_tab(GL_LINE_STRIP, rct->xmin - px, rct->ymin - px, rct->xmax - px, rct->ymax + px,
- tab_curve_radius, roundboxtype, true, true, NULL);
+ tab_curve_radius, roundboxtype, true, true, NULL);
/* tab highlight (3d look) */
- glShadeModel(GL_SMOOTH);
- glColor3ubv(is_active ? theme_col_tab_highlight : theme_col_tab_highlight_inactive);
+ GPU_aspect_enable(GPU_ASPECT_BASIC, GPU_BASIC_SMOOTH);
+ gpuColor3ubv(is_active ? theme_col_tab_highlight : theme_col_tab_highlight_inactive);
ui_panel_category_draw_tab(GL_LINE_STRIP, rct->xmin, rct->ymin, rct->xmax, rct->ymax,
- tab_curve_radius, roundboxtype, true, false,
- is_active ? theme_col_back : theme_col_tab_inactive);
- glShadeModel(GL_FLAT);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ tab_curve_radius, roundboxtype, true, false,
+ is_active ? theme_col_back : theme_col_tab_inactive);
+ GPU_aspect_disable(GPU_ASPECT_BASIC, GPU_BASIC_SMOOTH);
}
/* tab blackline */
if (!is_active) {
- glColor3ubv(theme_col_tab_divider);
- glRecti(v2d->mask.xmin + category_tabs_width - px,
- rct->ymin - tab_v_pad,
- v2d->mask.xmin + category_tabs_width,
- rct->ymax + tab_v_pad);
+ gpuColor3ubv(theme_col_tab_divider);
+ gpuSingleFilledRecti(v2d->mask.xmin + category_tabs_width - px,
+ rct->ymin - tab_v_pad,
+ v2d->mask.xmin + category_tabs_width,
+ rct->ymax + tab_v_pad);
}
if (do_scaletabs) {
category_draw_len = BLF_width_to_strlen(fontid, category_id_draw, category_draw_len,
- category_width, NULL);
+ category_width, NULL);
}
BLF_position(fontid, rct->xmax - text_v_ofs, rct->ymin + tab_v_pad_text, 0.0f);
@@ -1612,7 +1614,7 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active)
/* tab titles */
/* draw white shadow to give text more depth */
- glColor3ubv(theme_col_text);
+ gpuColor3ubv(theme_col_text);
/* main tab title */
BLF_draw(fontid, category_id_draw, category_draw_len);
@@ -1621,28 +1623,28 @@ void UI_panel_cat
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list