Bugfix #4620
Hurmf, then you bring back old backbuffer, and they want to have fields work on that! OK... here it is. Although using Compositor features will make this much easier and advanced to control. :)
This commit is contained in:
@@ -59,7 +59,8 @@ struct anim *openanim(char * name, int flags);
|
||||
void ima_ibuf_is_nul(struct Tex *tex, struct Image *ima);
|
||||
void load_image(struct Image * ima, int flags, char *relabase, int framenum);
|
||||
void converttopremul(struct ImBuf *ibuf);
|
||||
|
||||
void image_de_interlace(struct Image *ima, int odd);
|
||||
|
||||
void tag_image_time(struct Image *ima);
|
||||
void free_old_images(void);
|
||||
|
||||
|
||||
@@ -620,6 +620,14 @@ static void de_interlace_st(struct ImBuf *ibuf) /* standard fields */
|
||||
ibuf->y /= 2;
|
||||
}
|
||||
|
||||
void image_de_interlace(Image *ima, int odd)
|
||||
{
|
||||
if(odd)
|
||||
de_interlace_st(ima->ibuf);
|
||||
else
|
||||
de_interlace_ng(ima->ibuf);
|
||||
}
|
||||
|
||||
/* important note: all calls here and calls inside can NOT use threadsafe malloc! */
|
||||
/* this entire function is mutex'ed with the same lock as for mallocs */
|
||||
void ima_ibuf_is_nul(Tex *tex, Image *ima)
|
||||
|
||||
@@ -597,12 +597,17 @@ void image_sample(Image *ima, float fx, float fy, float dx, float dy, float *res
|
||||
return;
|
||||
}
|
||||
|
||||
if( (R.flag & R_SEC_FIELD) && (ima->ibuf->flags & IB_fields) )
|
||||
ima->ibuf->rect+= (ima->ibuf->x*ima->ibuf->y);
|
||||
|
||||
boxsample(ima->ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 0);
|
||||
result[0]= texres.tr;
|
||||
result[1]= texres.tg;
|
||||
result[2]= texres.tb;
|
||||
result[3]= texres.ta;
|
||||
|
||||
if( (R.flag & R_SEC_FIELD) && (ima->ibuf->flags & IB_fields) )
|
||||
ima->ibuf->rect-= (ima->ibuf->x*ima->ibuf->y);
|
||||
}
|
||||
|
||||
int imagewraposa(Tex *tex, Image *ima, float *texvec, float *dxt, float *dyt, TexResult *texres)
|
||||
|
||||
@@ -1463,8 +1463,14 @@ static void load_backbuffer(Render *re)
|
||||
|
||||
if(re->backbuf && re->backbuf->ibuf==NULL) {
|
||||
re->backbuf->ibuf= IMB_loadiffname(re->backbuf->name, IB_rect);
|
||||
if(re->backbuf->ibuf==NULL) re->backbuf->ok= 0;
|
||||
else re->backbuf->ok= 1;
|
||||
if(re->backbuf->ibuf==NULL)
|
||||
re->backbuf->ok= 0;
|
||||
else {
|
||||
re->backbuf->ok= 1;
|
||||
|
||||
if (re->r.mode & R_FIELDS)
|
||||
image_de_interlace(re->backbuf, re->r.mode & R_ODDFIELD);
|
||||
}
|
||||
}
|
||||
if(re->backbuf==NULL || re->backbuf->ok==0) {
|
||||
// error() doesnt work with render window open
|
||||
|
||||
Reference in New Issue
Block a user