diff options
author | Andrea Weikert <elubie@gmx.net> | 2007-09-14 22:21:23 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2007-09-14 22:21:23 +0400 |
commit | ee6acc1061e94378a0aa5fab4b73f72c849531ad (patch) | |
tree | 03a4ce8aa0d3213ef494959771f79086d6b43811 /source/blender/blenloader | |
parent | 1bde4e3274042f08b60153f58273387801052a97 (diff) |
== imagebrowser ==
* fix for do_versions, bump correction of old imasel to all files including version 2.44
* refactoring of filtering code using indices instead of copying entries in filelist
* memleak fix.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 115 |
1 files changed, 60 insertions, 55 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6c7750b5741..38240ceeafa 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6505,61 +6505,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - - - if (main->versionfile < 244) { - bScreen *sc; - Image* ima; - - /* repair preview from 242 */ - for(ima= main->image.first; ima; ima= ima->id.next) { - ima->preview = NULL; - } - - /* repair imasel space - completely reworked */ - for(sc= main->screen.first; sc; sc= sc->id.next) { - ScrArea *sa; - sa= sc->areabase.first; - while(sa) { - SpaceLink *sl; - - for (sl= sa->spacedata.first; sl; sl= sl->next) { - if(sl->spacetype==SPACE_IMASEL) { - SpaceImaSel *simasel= (SpaceImaSel*) sl; - simasel->blockscale= 0.7; - /* view 2D */ - simasel->v2d.tot.xmin= -10.0; - simasel->v2d.tot.ymin= -10.0; - simasel->v2d.tot.xmax= (float)sa->winx + 10.0f; - simasel->v2d.tot.ymax= (float)sa->winy + 10.0f; - simasel->v2d.cur.xmin= 0.0; - simasel->v2d.cur.ymin= 0.0; - simasel->v2d.cur.xmax= (float)sa->winx; - simasel->v2d.cur.ymax= (float)sa->winy; - simasel->v2d.min[0]= 1.0; - simasel->v2d.min[1]= 1.0; - simasel->v2d.max[0]= 32000.0f; - simasel->v2d.max[1]= 32000.0f; - simasel->v2d.minzoom= 0.5f; - simasel->v2d.maxzoom= 1.21f; - simasel->v2d.scroll= 0; - simasel->v2d.keepaspect= 1; - simasel->v2d.keepzoom= 1; - simasel->v2d.keeptot= 0; - simasel->prv_h = 96; - simasel->prv_w = 96; - simasel->flag = 7; /* ??? elubie */ - strcpy (simasel->dir, U.textudir); /* TON */ - strcpy (simasel->file, ""); - - simasel->returnfunc = 0; - simasel->title[0] = 0; - } - } - sa = sa->next; - } - } - } + if(main->versionfile <= 244) { Scene *sce; Material *ma; @@ -6725,6 +6671,65 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile <= 245) { + bScreen *sc; + Image* ima; + + /* fix all versions before 2.45 */ + if (main->versionfile != 245) { + + /* repair preview from 242 - 244*/ + for(ima= main->image.first; ima; ima= ima->id.next) { + ima->preview = NULL; + } + + /* repair imasel space - completely reworked */ + for(sc= main->screen.first; sc; sc= sc->id.next) { + ScrArea *sa; + sa= sc->areabase.first; + while(sa) { + SpaceLink *sl; + + for (sl= sa->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_IMASEL) { + SpaceImaSel *simasel= (SpaceImaSel*) sl; + simasel->blockscale= 0.7; + /* view 2D */ + simasel->v2d.tot.xmin= -10.0; + simasel->v2d.tot.ymin= -10.0; + simasel->v2d.tot.xmax= (float)sa->winx + 10.0f; + simasel->v2d.tot.ymax= (float)sa->winy + 10.0f; + simasel->v2d.cur.xmin= 0.0; + simasel->v2d.cur.ymin= 0.0; + simasel->v2d.cur.xmax= (float)sa->winx; + simasel->v2d.cur.ymax= (float)sa->winy; + simasel->v2d.min[0]= 1.0; + simasel->v2d.min[1]= 1.0; + simasel->v2d.max[0]= 32000.0f; + simasel->v2d.max[1]= 32000.0f; + simasel->v2d.minzoom= 0.5f; + simasel->v2d.maxzoom= 1.21f; + simasel->v2d.scroll= 0; + simasel->v2d.keepaspect= 1; + simasel->v2d.keepzoom= 1; + simasel->v2d.keeptot= 0; + simasel->prv_h = 96; + simasel->prv_w = 96; + simasel->flag = 7; /* ??? elubie */ + strcpy (simasel->dir, U.textudir); /* TON */ + strcpy (simasel->file, ""); + + simasel->returnfunc = 0; + simasel->title[0] = 0; + } + } + sa = sa->next; + } + } + } + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ |