diff options
author | Joseph Eagar <joeedh@gmail.com> | 2011-02-27 09:19:40 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2011-02-27 09:19:40 +0300 |
commit | f01261d040be27337db9f9996d648a279c89b7c4 (patch) | |
tree | c448230939b3c90d53ce8852dd00925d6052e3a4 /source/blender/editors/space_info/info_stats.c | |
parent | dcaeda5c4e3a0687251b8511de4f2e8b85ef75c0 (diff) | |
parent | 2198cfdb2deec8b2e85e242c74a032f43d0b26ca (diff) |
merge with/from trunk at r35190
Diffstat (limited to 'source/blender/editors/space_info/info_stats.c')
-rw-r--r-- | source/blender/editors/space_info/info_stats.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 7ffa68a9be1..b9e4730ec41 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -34,15 +34,17 @@ #include "DNA_meta_types.h" #include "DNA_scene_types.h" +#include "BLI_utildefines.h" + #include "BKE_anim.h" #include "BKE_displist.h" #include "BKE_DerivedMesh.h" #include "BKE_key.h" #include "BKE_mesh.h" #include "BKE_particle.h" -#include "BKE_utildefines.h" #include "BKE_tessmesh.h" +#include "ED_info.h" #include "ED_armature.h" #include "ED_mesh.h" #include "ED_curve.h" /* for ED_curve_editnurbs */ @@ -92,13 +94,12 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) case OB_SURF: case OB_CURVE: case OB_FONT: { - Curve *cu= ob->data; int tot= 0, totf= 0; stats->totcurve += totob; - if(cu->disp.first) - count_displist(&cu->disp, &tot, &totf); + if(ob->disp.first) + count_displist(&ob->disp, &tot, &totf); tot *= totob; totf *= totob; @@ -318,12 +319,10 @@ static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats) /* Statistics displayed in info header. Called regularly on scene changes. */ static void stats_update(Scene *scene) { - SceneStats stats; + SceneStats stats= {0}; Object *ob= (scene->basact)? scene->basact->object: NULL; Base *base; - memset(&stats, 0, sizeof(stats)); - if(scene->obedit) { /* Edit Mode */ stats_object_edit(scene->obedit, &stats); @@ -332,7 +331,7 @@ static void stats_update(Scene *scene) /* Pose Mode */ stats_object_pose(ob, &stats); } - else if(ob && (ob->flag & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { + else if(ob && (ob->flag & OB_MODE_ALL_PAINT)) { /* Sculpt and Paint Mode */ stats_object_paint(ob, &stats); } @@ -361,9 +360,9 @@ static void stats_string(Scene *scene) mmap_in_use= MEM_get_mapped_memory_in_use(); /* get memory statistics */ - s= memstr + sprintf(memstr, " | Mem:%.2fM", ((mem_in_use-mmap_in_use)>>10)/1024.0); + s= memstr + sprintf(memstr, " | Mem:%.2fM", (double)((mem_in_use-mmap_in_use)>>10)/1024.0); if(mmap_in_use) - sprintf(s, " (%.2fM)", ((mmap_in_use)>>10)/1024.0); + sprintf(s, " (%.2fM)", (double)((mmap_in_use)>>10)/1024.0); s= stats->infostr; @@ -411,7 +410,7 @@ void ED_info_stats_clear(Scene *scene) } } -char *ED_info_stats_string(Scene *scene) +const char *ED_info_stats_string(Scene *scene) { if(!scene->stats) stats_update(scene); |