Cleanup: add View3D_Runtime struct
authorCampbell Barton <ideasman42@gmail.com>
Sat, 13 Apr 2019 13:20:15 +0000 (15:20 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 13 Apr 2019 13:24:28 +0000 (15:24 +0200)
Also remove 'matcap_icon'

source/blender/blenloader/intern/readfile.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/makesdna/DNA_view3d_types.h

index 2c23f13..ea6ac1b 100644 (file)
@@ -7170,7 +7170,7 @@ static void direct_link_area(FileData *fd, ScrArea *area)
                                direct_link_gpencil(fd, v3d->gpd);
                        }
                        v3d->localvd = newdataadr(fd, v3d->localvd);
-                       v3d->properties_storage = NULL;
+                       v3d->runtime.properties_storage = NULL;
 
                        /* render can be quite heavy, set to solid on load */
                        if (v3d->shading.type == OB_RENDER) {
index d46c7a2..c18a22f 100644 (file)
@@ -415,8 +415,8 @@ static void view3d_free(SpaceLink *sl)
                MEM_freeN(vd->localvd);
        }
 
-       if (vd->properties_storage) {
-               MEM_freeN(vd->properties_storage);
+       if (vd->runtime.properties_storage) {
+               MEM_freeN(vd->runtime.properties_storage);
        }
 
        if (vd->fx_settings.ssao) {
@@ -443,7 +443,7 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
 
        if (v3dn->localvd) {
                v3dn->localvd = NULL;
-               v3dn->properties_storage = NULL;
+               v3dn->runtime.properties_storage = NULL;
        }
 
        if (v3dn->shading.type == OB_RENDER) {
@@ -452,7 +452,7 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
 
        /* copy or clear inside new stuff */
 
-       v3dn->properties_storage = NULL;
+       v3dn->runtime.properties_storage = NULL;
        if (v3dn->fx_settings.dof) {
                v3dn->fx_settings.dof = MEM_dupallocN(v3do->fx_settings.dof);
        }
index 3baf297..ca30e3d 100644 (file)
@@ -196,10 +196,10 @@ static void apply_scale_factor_clamp(float *val, const int tot, const float ve_m
 
 static TransformProperties *v3d_transform_props_ensure(View3D *v3d)
 {
-       if (v3d->properties_storage == NULL) {
-               v3d->properties_storage = MEM_callocN(sizeof(TransformProperties), "TransformProperties");
+       if (v3d->runtime.properties_storage == NULL) {
+               v3d->runtime.properties_storage = MEM_callocN(sizeof(TransformProperties), "TransformProperties");
        }
-       return v3d->properties_storage;
+       return v3d->runtime.properties_storage;
 }
 
 /* is used for both read and write... */
index 075ea50..cced70b 100644 (file)
@@ -223,6 +223,11 @@ typedef struct View3DOverlay {
 
 } View3DOverlay;
 
+typedef struct View3D_Runtime {
+       /** Nkey panel stores stuff here. */
+       void *properties_storage;
+} View3D_Runtime;
+
 /* 3D ViewPort Struct */
 typedef struct View3D {
        struct SpaceLink *next, *prev;
@@ -275,10 +280,7 @@ typedef struct View3D {
        float clip_start, clip_end;
        float ofs[3] DNA_DEPRECATED;
 
-       char _pad[4];
-
-       /** Icon id. */
-       short matcap_icon;
+       char _pad[6];
 
        short gridlines;
        /** Number of subdivisions in the grid between each highlighted grid line. */
@@ -295,9 +297,6 @@ typedef struct View3D {
         * instead set (temporarily) from camera */
        struct GPUFXSettings fx_settings;
 
-       /** Nkey panel stores stuff here (runtime only!). */
-       void *properties_storage;
-
        /* XXX deprecated? */
        /** Grease-Pencil Data (annotation layers). */
        struct bGPdata *gpd  DNA_DEPRECATED;
@@ -316,6 +315,9 @@ typedef struct View3D {
 
        View3DShading shading;
        View3DOverlay overlay;
+
+       /** Runtime evaluation data (keep last). */
+       View3D_Runtime runtime;
 } View3D;