Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/targa.c
| Context not available. | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_fileops.h" | #include "BLI_fileops.h" | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "imbuf.h" | #include "imbuf.h" | ||||
| Context not available. | |||||
| /* this one is only def-ed once, strangely... related to GS? */ | /* this one is only def-ed once, strangely... related to GS? */ | ||||
| #define GSS(x) (((uchar *)(x))[1] << 8 | ((uchar *)(x))[0]) | #define GSS(x) (((uchar *)(x))[1] << 8 | ((uchar *)(x))[0]) | ||||
| static CLG_LogRef LOG = { "imb.targa" }; | |||||
| /***/ | /***/ | ||||
| typedef struct TARGA { | typedef struct TARGA { | ||||
| Context not available. | |||||
| { | { | ||||
| int size = (ibuf->x * ibuf->y) - (rect - ibuf->rect); | int size = (ibuf->x * ibuf->y) - (rect - ibuf->rect); | ||||
| if (size) { | if (size) { | ||||
| printf("decodetarga: incomplete file, %.1f%% missing\n", 100 * ((float)size / (ibuf->x * ibuf->y))); | CLOG_WARN(&LOG, "decodetarga: incomplete file, %.1f%% missing", 100 * ((float)size / (ibuf->x * ibuf->y))); | ||||
| /* not essential but makes displaying partially rendered TGA's less ugly */ | /* not essential but makes displaying partially rendered TGA's less ugly */ | ||||
| memset(rect, 0, size); | memset(rect, 0, size); | ||||
| } | } | ||||
| else { | else { | ||||
| /* shouldn't happen */ | /* shouldn't happen */ | ||||
| printf("decodetarga: incomplete file, all pixels written\n"); | CLOG_WARN(&LOG, "decodetarga: incomplete file, all pixels written"); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| if (size) { | if (size) { | ||||
| printf("decodetarga: count would overwrite %d pixels\n", -size); | CLOG_WARN(&LOG, "count would overwrite %d pixels", -size); | ||||
| } | } | ||||
| return; | return; | ||||
| Context not available. | |||||