Merge remote-tracking branch 'origin/master' into blender2.8
authorDalai Felinto <dfelinto@gmail.com>
Fri, 23 Dec 2016 14:36:16 +0000 (15:36 +0100)
committerDalai Felinto <dfelinto@gmail.com>
Fri, 23 Dec 2016 14:36:16 +0000 (15:36 +0100)
1  2 
source/blender/blenkernel/BKE_effect.h
source/blender/blenkernel/intern/effect.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_view3d/drawsimdebug.c
source/blender/makesdna/DNA_ID.h
source/blender/makesrna/intern/makesrna.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator_args.c

index 286e5825658a7c6298b5fc196cde3021379ca397,9414d39467dc00994e42ec1a971072ca93b3f2f9..2baa6304cd93ce61f7643bcf88728795b8136a26
@@@ -164,17 -130,29 +164,31 @@@ static void draw_sim_debug_elements(Sim
                if (elem->type != SIM_DEBUG_ELEM_VECTOR)
                        continue;
                
 -              glColor3f(elem->color[0], elem->color[1], elem->color[2]);
 -              glVertex3f(elem->v1[0], elem->v1[1], elem->v1[2]);
 +              immAttrib3fv(color, elem->color);
 +              immVertex3fv(pos, elem->v1);
                add_v3_v3v3(t, elem->v1, elem->v2);
 -              glVertex3f(t[0], t[1], t[2]);
 +              immVertex3fv(pos, t);
        }
 -      glEnd();
 +      immEnd();
 +      
 +      immUnbindProgram();
+       
+       /**** strings ****/
+       
+       for (BLI_ghashIterator_init(&iter, debug_data->gh); !BLI_ghashIterator_done(&iter); BLI_ghashIterator_step(&iter)) {
+               SimDebugElement *elem = BLI_ghashIterator_getValue(&iter);
+               if (elem->type != SIM_DEBUG_ELEM_STRING)
+                       continue;
+               
+               unsigned char col[4];
+               rgb_float_to_uchar(col, elem->color);
+               col[3] = 255;
+               view3d_cached_text_draw_add(elem->v1, elem->str, strlen(elem->str),
+                                           0, V3D_CACHE_TEXT_GLOBALSPACE, col);
+       }
  }
  
- void draw_sim_debug_data(Scene *UNUSED(scene), View3D *UNUSED(v3d), ARegion *ar)
+ void draw_sim_debug_data(Scene *UNUSED(scene), View3D *v3d, ARegion *ar)
  {
        RegionView3D *rv3d = ar->regiondata;
        /*Object *ob = base->object;*/
        
        invert_m4_m4(imat, rv3d->viewmatob);
        
 -//    glDepthMask(GL_FALSE);
 -//    glEnable(GL_BLEND);
 -      
        glPushMatrix();
-       
        glLoadMatrixf(rv3d->viewmat);
+       
+       view3d_cached_text_draw_begin();
        draw_sim_debug_elements(_sim_debug_data, imat);
+       view3d_cached_text_draw_end(v3d, ar, false, NULL);
        
        glPopMatrix();
 -      
 -//    glDepthMask(GL_TRUE);
 -//    glDisable(GL_BLEND);
  }
Simple merge
Simple merge