Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c56
1 files changed, 38 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index a88ec9ead64..69375674d94 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -211,28 +211,37 @@ int view3d_test_clipping(RegionView3D *rv3d, float *vec, int local)
static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, float dx)
-{
- float fx, fy;
-
+{
+ float v1[2], v2[2];
+
x+= (wx);
y+= (wy);
- fx= x/dx;
- fx= x-dx*floor(fx);
+
+ v1[1]= 0.0f;
+ v2[1]= (float)ar->winy;
+
+ v1[0] = v2[0] = x-dx*floor(x/dx);
+
+ glBegin(GL_LINES);
- while(fx< ar->winx) {
- fdrawline(fx, 0.0, fx, (float)ar->winy);
- fx+= dx;
+ while(v1[0] < ar->winx) {
+ glVertex2fv(v1);
+ glVertex2fv(v2);
+ v1[0] = v2[0] = v1[0] + dx;
}
- fy= y/dx;
- fy= y-dx*floor(fy);
-
+ v1[0]= 0.0f;
+ v2[0]= (float)ar->winx;
+
+ v1[1]= v2[1]= y-dx*floor(y/dx);
- while(fy< ar->winy) {
- fdrawline(0.0, fy, (float)ar->winx, fy);
- fy+= dx;
+ while(v1[1] < ar->winy) {
+ glVertex2fv(v1);
+ glVertex2fv(v2);
+ v1[1] = v2[1] = v1[1] + dx;
}
+ glEnd();
}
#define GRID_MIN_PX 6.0f
@@ -1798,7 +1807,7 @@ static void gpu_render_lamp_update(Scene *scene, View3D *v3d, Object *ob, Object
lamp = GPU_lamp_from_blender(scene, ob, par);
if(lamp) {
- GPU_lamp_update(lamp, ob->lay, (ob->restrictflag & OB_RESTRICT_VIEW), obmat);
+ GPU_lamp_update(lamp, ob->lay, (ob->restrictflag & OB_RESTRICT_RENDER), obmat);
GPU_lamp_update_colors(lamp, la->r, la->g, la->b, la->energy);
if((ob->lay & v3d->lay) && GPU_lamp_has_shadow_buffer(lamp)) {
@@ -1968,6 +1977,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx,
{
Scene *sce;
Base *base;
+ float backcol[3];
int bwinx, bwiny;
glPushMatrix();
@@ -1987,7 +1997,11 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx,
/* set background color, fallback on the view background color */
if(scene->world) {
- glClearColor(scene->world->horr, scene->world->horg, scene->world->horb, 0.0);
+ if(scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ linearrgb_to_srgb_v3_v3(backcol, &scene->world->horr);
+ else
+ copy_v3_v3(backcol, &scene->world->horr);
+ glClearColor(backcol[0], backcol[1], backcol[2], 0.0);
}
else {
UI_ThemeClearColor(TH_BACK);
@@ -2205,6 +2219,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
Scene *sce;
Base *base;
Object *ob;
+ float backcol[3];
int retopo= 0, sculptparticle= 0;
Object *obact = OBACT;
char *grid_unit= NULL;
@@ -2223,8 +2238,13 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
}
/* clear background */
- if((v3d->flag2 & V3D_RENDER_OVERRIDE) && scene->world)
- glClearColor(scene->world->horr, scene->world->horg, scene->world->horb, 0.0);
+ if((v3d->flag2 & V3D_RENDER_OVERRIDE) && scene->world) {
+ if(scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ linearrgb_to_srgb_v3_v3(backcol, &scene->world->horr);
+ else
+ copy_v3_v3(backcol, &scene->world->horr);
+ glClearColor(backcol[0], backcol[1], backcol[2], 0.0);
+ }
else
UI_ThemeClearColor(TH_BACK);