plug-ins: add option to vertically flip dds image on import
Some games apparently need dds images to be vertically flipped. We already have an option to flip dds images on export, so it makes sense to also allow flipping on import.
This commit is contained in:
parent
efa1267f13
commit
dd45e3b462
2 changed files with 12 additions and 0 deletions
|
|
@ -170,6 +170,12 @@ dds_create_procedure (GimpPlugIn *plug_in,
|
|||
TRUE,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
GIMP_PROC_ARG_BOOLEAN (procedure, "flip-image",
|
||||
_("Flip image _vertically"),
|
||||
_("Flip the image vertically on import"),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
GIMP_PROC_ARG_BOOLEAN (procedure, "decode-images",
|
||||
_("Automatically decode YCoCg/AE_xp images when detected"),
|
||||
_("Decode YCoCg/AExp images when detected"),
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ read_dds (GFile *file,
|
|||
gboolean decode_images;
|
||||
gint i, j;
|
||||
guint computed_pitch_or_linsize;
|
||||
gboolean flip_import;
|
||||
|
||||
if (interactive)
|
||||
{
|
||||
|
|
@ -149,6 +150,7 @@ read_dds (GFile *file,
|
|||
|
||||
g_object_get (config,
|
||||
"load-mipmaps", &read_mipmaps,
|
||||
"flip-image", &flip_import,
|
||||
"decode-images", &decode_images,
|
||||
NULL);
|
||||
|
||||
|
|
@ -730,6 +732,9 @@ read_dds (GFile *file,
|
|||
|
||||
gimp_image_take_selected_layers (image, layers);
|
||||
|
||||
if (flip_import)
|
||||
gimp_image_flip (image, GIMP_ORIENTATION_VERTICAL);
|
||||
|
||||
*ret_image = image;
|
||||
|
||||
return GIMP_PDB_SUCCESS;
|
||||
|
|
@ -2007,6 +2012,7 @@ load_dialog (GimpProcedure *procedure,
|
|||
vbox = gimp_procedure_dialog_fill_box (GIMP_PROCEDURE_DIALOG (dialog),
|
||||
"dds-read-box",
|
||||
"load-mipmaps",
|
||||
"flip-image",
|
||||
"decode-images",
|
||||
NULL);
|
||||
gtk_box_set_spacing (GTK_BOX (vbox), 8);
|
||||
|
|
|
|||
Loading…
Reference in a new issue