From e142ae77cadf04103fbc643f21cf60891862f6a8 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Mon, 13 Jul 2015 13:58:17 +0200 Subject: Imbuf types refactor. ImBuf types were getting stored as bitflags in a 32bit integer which had already run out of space. Solved the problem by separating file type to an ftype enum, and file specific options to foptions. Reviewed by Campbell, thanks a lot! --- source/blender/imbuf/intern/targa.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/imbuf/intern/targa.c') diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 617fdab0618..7073d34e2bc 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -264,7 +264,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags) buf[2] = 11; } - if (ibuf->ftype == RAWTGA) buf[2] &= ~8; + if (ibuf->foptions.flag & RAWTGA) buf[2] &= ~8; buf[8] = 0; buf[9] = 0; @@ -289,7 +289,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags) return 0; } - if (ibuf->ftype == RAWTGA) { + if (ibuf->foptions.flag & RAWTGA) { ok = dumptarga(ibuf, fildes); } else { @@ -568,7 +568,9 @@ ImBuf *imb_loadtarga(const unsigned char *mem, size_t mem_size, int flags, char else ibuf = IMB_allocImBuf(tga.xsize, tga.ysize, (tga.pixsize + 0x7) & ~0x7, IB_rect); if (ibuf == NULL) return NULL; - ibuf->ftype = (tga.imgtyp < 4) ? RAWTGA : TGA; + ibuf->ftype = IMB_FTYPE_TGA; + if (tga.imgtyp < 4) + ibuf->foptions.flag |= RAWTGA; mem = mem + 18 + tga.numid; cp[0] = 0xff; -- cgit v1.2.3