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:
authorCampbell Barton <ideasman42@gmail.com>2020-11-13 03:24:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-11-13 03:28:24 +0300
commit454b7876ff18c5103cad7d1ebc4e7bef5b1bff4b (patch)
tree81040e9e44f6fbf50f377e1618caf17088980b5c /source/blender/imbuf/intern/writeimage.c
parentac299bb45328da8dc3586be25bcff78ddfc2e03a (diff)
Cleanup: remove unnecessary ImFileType.ftype callback
This callback made some sense before moving the file-type information from a bit-flag to an enum: e142ae77cadf04103fbc643f21cf60891862f6a8 Since then, we can compare the type value directly. Also replace loops over file types with IMB_file_type_from_{ibuf/ftype}.
Diffstat (limited to 'source/blender/imbuf/intern/writeimage.c')
-rw-r--r--source/blender/imbuf/intern/writeimage.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index 71ecc8b14ae..f21d274f8fd 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -43,8 +43,6 @@ static bool prepare_write_imbuf(const ImFileType *type, ImBuf *ibuf)
bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
{
- const ImFileType *type;
-
errno = 0;
BLI_assert(!BLI_path_is_rel(filepath));
@@ -54,8 +52,9 @@ bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
}
ibuf->flags = flags;
- for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) {
- if (type->save && type->ftype(type, ibuf)) {
+ const ImFileType *type = IMB_file_type_from_ibuf(ibuf);
+ if (type != NULL) {
+ if (type->save != NULL) {
prepare_write_imbuf(type, ibuf);
return type->save(ibuf, filepath, flags);
}