Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2004-11-05 20:18:17 +0300
committerTon Roosendaal <ton@blender.org>2004-11-05 20:18:17 +0300
commite9017926c90e71544798bd14a543043cdff824d7 (patch)
treeb4e3507a2444498930185e573600c95888b7cc34
parentc013711c073e7a6e9470c34f6bac73c9af12c3a9 (diff)
Three minor fixes;
- themecolor for the 'bars' in NLA used signed char - global undo, restore pointers for UI accidentally added user values for oops and outliner, causing unused blocks to show used - moved popup menus one pix up or down, it was overlapping the button causing accidental selection of menus
-rw-r--r--source/blender/blenloader/intern/readfile.c30
-rw-r--r--source/blender/src/drawnla.c16
-rw-r--r--source/blender/src/interface.c4
3 files changed, 25 insertions, 25 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 82fd06b9897..ec6e2c8a083 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2662,7 +2662,7 @@ static void lib_link_screen(FileData *fd, Main *main)
}
}
-static void *restore_pointer_by_name(Main *mainp, ID *id)
+static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
{
ListBase *lb;
ID *idn=NULL;
@@ -2672,7 +2672,7 @@ static void *restore_pointer_by_name(Main *mainp, ID *id)
idn= lb->first;
while(idn) {
if( strcmp(idn->name, id->name)==0) {
- if(idn->us==0) idn->us++;
+ if(user && idn->us==0) idn->us++;
break;
}
idn= idn->next;
@@ -2690,7 +2690,7 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
sc= newmain->screen.first;
while(sc) {
- if(mode=='u') sc->scene= restore_pointer_by_name(newmain, (ID *)sc->scene);
+ if(mode=='u') sc->scene= restore_pointer_by_name(newmain, (ID *)sc->scene, 1);
if(sc->scene==NULL || mode=='n') sc->scene= curscene;
sa= sc->areabase.first;
@@ -2701,27 +2701,27 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
if(sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
- if(mode=='u') v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera);
+ if(mode=='u') v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1);
if(v3d->camera==NULL || mode=='n') v3d->camera= sc->scene->camera;
if(v3d->scenelock) v3d->lay= sc->scene->lay;
if(v3d->bgpic) {
- v3d->bgpic->ima= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->ima);
- v3d->bgpic->tex= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->tex);
+ v3d->bgpic->ima= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->ima, 1);
+ v3d->bgpic->tex= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->tex, 1);
if(v3d->bgpic->rect) freeN(v3d->bgpic->rect);
v3d->bgpic->rect= NULL;
}
if(v3d->localvd) {
- if(mode=='u') v3d->localvd->camera= restore_pointer_by_name(newmain, (ID *)v3d->localvd->camera);
+ if(mode=='u') v3d->localvd->camera= restore_pointer_by_name(newmain, (ID *)v3d->localvd->camera, 1);
if(v3d->localvd->camera==NULL || mode=='n') v3d->localvd->camera= sc->scene->camera;
}
}
else if(sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo *)sl;
- sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from);
+ sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0);
// not free sipo->ipokey, creates dependency with src/
- sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo);
+ sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0);
if(sipo->editipo) MEM_freeN(sipo->editipo);
sipo->editipo= NULL;
}
@@ -2741,12 +2741,12 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
}
else if(sl->spacetype==SPACE_ACTION) {
SpaceAction *saction= (SpaceAction *)sl;
- saction->action = restore_pointer_by_name(newmain, (ID *)saction->action);
+ saction->action = restore_pointer_by_name(newmain, (ID *)saction->action, 1);
}
else if(sl->spacetype==SPACE_IMAGE) {
SpaceImage *sima= (SpaceImage *)sl;
- sima->image= restore_pointer_by_name(newmain, (ID *)sima->image);
+ sima->image= restore_pointer_by_name(newmain, (ID *)sima->image, 1);
}
else if(sl->spacetype==SPACE_NLA){
/* SpaceNla *snla= (SpaceNla *)sl; */
@@ -2754,7 +2754,7 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
else if(sl->spacetype==SPACE_TEXT) {
SpaceText *st= (SpaceText *)sl;
- st->text= restore_pointer_by_name(newmain, (ID *)st->text);
+ st->text= restore_pointer_by_name(newmain, (ID *)st->text, 1);
if(st->text==NULL) st->text= newmain->text.first;
}
else if(sl->spacetype==SPACE_SCRIPT) {
@@ -2769,7 +2769,7 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
int a;
oops= so->oops.first;
while(oops) {
- oops->id= restore_pointer_by_name(newmain, (ID *)oops->id);
+ oops->id= restore_pointer_by_name(newmain, (ID *)oops->id, 0);
oops= oops->next;
}
so->lockpoin= NULL;
@@ -2778,14 +2778,14 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
TreeStore *ts= so->treestore;
TreeStoreElem *tselem=ts->data;
for(a=0; a<ts->usedelem; a++, tselem++) {
- tselem->id= restore_pointer_by_name(newmain, tselem->id);
+ tselem->id= restore_pointer_by_name(newmain, tselem->id, 0);
}
}
}
else if(sl->spacetype==SPACE_SOUND) {
SpaceSound *ssound= (SpaceSound *)sl;
- ssound->sound= restore_pointer_by_name(newmain, (ID *)ssound->sound);
+ ssound->sound= restore_pointer_by_name(newmain, (ID *)ssound->sound, 1);
}
}
sa= sa->next;
diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c
index d95254a4c22..f4da9655c5a 100644
--- a/source/blender/src/drawnla.c
+++ b/source/blender/src/drawnla.c
@@ -227,18 +227,18 @@ static void draw_nlastrips(SpaceNla *snla)
/* Draw the field */
glEnable (GL_BLEND);
if (TESTBASE_SAFE(base))
- glColor4b (col1[0], col1[1], col1[2], 0x22);
+ glColor4ub (col1[0], col1[1], col1[2], 0x22);
else
- glColor4b (col2[0], col2[1], col2[2], 0x22);
+ glColor4ub (col2[0], col2[1], col2[2], 0x22);
gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
glRectf(0, channel_y-NLACHANNELHEIGHT/2, frame1_x, channel_y+NLACHANNELHEIGHT/2);
if (TESTBASE_SAFE(base))
- glColor4b (col1[0], col1[1], col1[2], 0x44);
+ glColor4ub (col1[0], col1[1], col1[2], 0x44);
else
- glColor4b (col2[0], col2[1], col2[2], 0x44);
+ glColor4ub (col2[0], col2[1], col2[2], 0x44);
glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2);
glDisable (GL_BLEND);
@@ -251,18 +251,18 @@ static void draw_nlastrips(SpaceNla *snla)
for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next){
glEnable (GL_BLEND);
if (conchan->flag & CONSTRAINT_CHANNEL_SELECT)
- glColor4b (col1[0], col1[1], col1[2], 0x22);
+ glColor4ub (col1[0], col1[1], col1[2], 0x22);
else
- glColor4b (col2[0], col2[1], col2[2], 0x22);
+ glColor4ub (col2[0], col2[1], col2[2], 0x22);
gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
glRectf(0, channel_y-NLACHANNELHEIGHT/2+4, frame1_x, channel_y+NLACHANNELHEIGHT/2-4);
if (conchan->flag & CONSTRAINT_CHANNEL_SELECT)
- glColor4b (col1[0], col1[1], col1[2], 0x44);
+ glColor4ub (col1[0], col1[1], col1[2], 0x44);
else
- glColor4b (col2[0], col2[1], col2[2], 0x44);
+ glColor4ub (col2[0], col2[1], col2[2], 0x44);
glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2+4, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2-4);
glDisable (GL_BLEND);
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 738fea7db6e..ede18300a8d 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -581,7 +581,7 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
else yof= butrct.ymax - block->maxy+centre;
}
else if(dir1==UI_TOP) {
- yof= butrct.ymax - block->miny-1;
+ yof= butrct.ymax - block->miny;
if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
else xof= butrct.xmin - block->minx;
// changed direction?
@@ -592,7 +592,7 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
}
}
else if(dir1==UI_DOWN) {
- yof= butrct.ymin - block->maxy+1;
+ yof= butrct.ymin - block->maxy;
if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
else xof= butrct.xmin - block->minx;
// changed direction?