From 9251d64e2b6bbcdbe051f4c99cdb2e5a2071509a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 15 Feb 2012 18:11:10 +0000 Subject: [PATCH] Tomato: fixed incorrect behavior of textures buffer used in MCE together with 2d stabilization. --- source/blender/editors/space_clip/clip_draw.c | 7 +++---- source/blender/editors/space_clip/clip_editor.c | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index afc0d84ed9a..43068c38116 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -232,9 +232,8 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, ED_space_clip_load_movieclip_buffer(sc, ibuf); glPushMatrix(); - glTranslatef(x, y, 0); + glTranslatef(x, y, 0.0f); glScalef(zoomx, zoomy, 1.0f); - glMultMatrixf(sc->stabmat); glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f, 0.0f); @@ -268,9 +267,9 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, glLogicOp(GL_NOR); glPushMatrix(); - glTranslatef(x, y, 0); + glTranslatef(x, y, 0.0f); - glScalef(zoomx, zoomy, 0); + glScalef(zoomx, zoomy, 1.0f); glMultMatrixf(sc->stabmat); glBegin(GL_LINE_LOOP); diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 9835a1cf43b..5f042e6a2be 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -323,6 +323,7 @@ typedef struct SpaceClipDrawContext { struct ImBuf *texture_ibuf; /* image buffer for which texture was created */ int image_width, image_height; /* image width and height for which texture was created */ unsigned last_texture; /* ID of previously used texture, so it'll be restored after clip drawing */ + int framenr; } SpaceClipDrawContext; void ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) @@ -342,6 +343,7 @@ void ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) * assuming displaying happens of footage frames only on which painting doesn't heppen. * so not changed image buffer pointer means unchanged image content */ need_rebind |= context->texture_ibuf != ibuf; + need_rebind |= context->framenr != sc->user.framenr; if (need_rebind) { int width = ibuf->x, height = ibuf->y; @@ -423,6 +425,7 @@ void ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) context->texture_ibuf = ibuf; context->image_width = ibuf->x; context->image_height = ibuf->y; + context->framenr = sc->user.framenr; if (fscalerect) MEM_freeN(fscalerect);