From 5235826e268245e23db88af6451e8a7460977f48 Mon Sep 17 00:00:00 2001 From: xchellx Date: Mon, 23 Dec 2024 14:01:23 -0500 Subject: [PATCH] Fix texture orientation --- src/txtrtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/txtrtool.c b/src/txtrtool.c index 4108949..daaa4b3 100644 --- a/src/txtrtool.c +++ b/src/txtrtool.c @@ -716,7 +716,7 @@ static TTStatus_t decode(TTDecodeOptions_t *opts, char *input, char *output) { size_t mipsCount; TXTRDecodeOptions_t texOpts = { .flipX = false, - .flipY = true, + .flipY = TXTR_IsIndexed(txtr.hdr.format), .decAllMips = opts->mipmaps }; TXTRDecodeError_t tde = TXTR_Decode(&txtr, mips, &mipsCount, &texOpts); @@ -818,7 +818,7 @@ static TTStatus_t encode(TTEncodeOptions_t *opts, char *input, char *output) { TXTRRawMipmap_t txtrMips[11]; TXTREncodeOptions_t texOpts = { .flipX = false, - .flipY = false, + .flipY = !TXTR_IsIndexed(opts->texFmtDec), .mipLimit = opts->mipLimit, .widthLimit = opts->widthLimit, .heightLimit = opts->heightLimit,