- Fix a display glitch with float image painting and undo.
- Fix a crash with float images texture mapped onto meshes, it didn't always do conversion from float to byte before uploading to OpenGL.
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "BLI_arithb.h"
|
||||
#include "BLI_edgehash.h"
|
||||
|
||||
#include "IMB_imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
#include "DNA_image_types.h"
|
||||
@@ -303,9 +304,11 @@ int set_tpage(TFace *tface)
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((ima->ibuf->rect==NULL) && ima->ibuf->rect_float)
|
||||
IMB_rect_from_float(ima->ibuf);
|
||||
|
||||
if(ima->tpageflag & IMA_TWINANIM) fCurtile= ima->lastframe;
|
||||
else fCurtile= tface->tile;
|
||||
|
||||
@@ -443,6 +446,9 @@ void update_realtime_image(Image *ima, int x, int y, int w, int h)
|
||||
int skip_pixels = glaGetOneInteger(GL_UNPACK_SKIP_PIXELS);
|
||||
int skip_rows = glaGetOneInteger(GL_UNPACK_SKIP_ROWS);
|
||||
|
||||
if ((ima->ibuf->rect==NULL) && ima->ibuf->rect_float)
|
||||
IMB_rect_from_float(ima->ibuf);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, ima->bindcode);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, ima->ibuf->x);
|
||||
|
||||
@@ -255,10 +255,12 @@ void imagepaint_undo()
|
||||
if (imapaintundo.tiles[tile])
|
||||
imapaint_copy_tile(ima, tile, x, y, 1);
|
||||
|
||||
free_realtime_image(ima); /* force OpenGL reload */
|
||||
if(ima->ibuf->rect_float)
|
||||
imb_freerectImBuf(ima->ibuf); /* force recreate of char rect */
|
||||
|
||||
allqueue(REDRAWIMAGE, 0);
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
|
||||
free_realtime_image(ima); /* force OpenGL reload */
|
||||
}
|
||||
|
||||
void free_imagepaint()
|
||||
|
||||
Reference in New Issue
Block a user