diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-05-04 14:24:53 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-05-04 14:24:53 +0400 |
commit | e4e70bfb913a0d50abfc5b6320290c90543372af (patch) | |
tree | 2251dc1af59cb83a502cc6d9a39b3e249d512b25 /source | |
parent | 22c2827d2de6cccf272cadeaa7632fc27f229a32 (diff) |
2.5 - Bugfixes
* Loading files saved with 2.5 works again now without crashing. Was crashing when trying to load Grease Pencil data (even though there was none)
* Fixed some msvc compiler warnings in own code
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_fcurve.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 9 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 3d33b615809..9b8a2990fe5 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -127,7 +127,7 @@ void copy_fcurves(ListBase *dst, ListBase *src); struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int array_index); /* test if there is a keyframe at cfra */ -int on_keyframe_fcurve(struct FCurve *fcu, float cfra); +short on_keyframe_fcurve(struct FCurve *fcu, float cfra); /* get the time extents for F-Curve */ void calc_fcurve_range(struct FCurve *fcu, float *min, float *max); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 0585717e13e..3d780ee97d5 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -175,15 +175,16 @@ FCurve *list_find_fcurve (ListBase *list, const char rna_path[], const int array return NULL; } -int on_keyframe_fcurve(FCurve *fcu, float cfra) +short on_keyframe_fcurve(FCurve *fcu, float cfra) { BezTriple *bezt; - int i; + unsigned i; bezt= fcu->bezt; - for (i=0; i<fcu->totvert; i++, bezt++) - if(IS_EQ(bezt->vec[1][0], cfra)) + for (i=0; i<fcu->totvert; i++, bezt++) { + if (IS_EQ(bezt->vec[1][0], cfra)) return 1; + } return 0; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 450161854ec..fd9da2059e1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4090,6 +4090,10 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd) bGPDframe *gpf; bGPDstroke *gps; + /* we must firstly have some grease-pencil data to link! */ + if (gpd == NULL) + return; + /* relink layers */ link_list(fd, &gpd->layers); |