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:
authorAntony Riakiotakis <kalast@gmail.com>2015-07-13 14:58:17 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-07-13 14:58:17 +0300
commite142ae77cadf04103fbc643f21cf60891862f6a8 (patch)
tree142e25fccd5ba3e748a1652706e7e4f1220ca289 /source/blender/imbuf/intern/targa.c
parent107bbee4c763c95ea5d07a3b2f08bfe3b6adb24c (diff)
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!
Diffstat (limited to 'source/blender/imbuf/intern/targa.c')
-rw-r--r--source/blender/imbuf/intern/targa.c8
1 files changed, 5 insertions, 3 deletions
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;