From 37427e0d34edd34e2d231822d05ab07779d1601c Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 6 Jul 2015 20:51:35 -0700 Subject: [PATCH] Add rectangle scaling fix for bclim creation Thanks slashmolder for help debugging! --- pk3DS/3DS/BCLIM.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pk3DS/3DS/BCLIM.cs b/pk3DS/3DS/BCLIM.cs index e4c8414..55eadc1 100644 --- a/pk3DS/3DS/BCLIM.cs +++ b/pk3DS/3DS/BCLIM.cs @@ -432,14 +432,14 @@ internal static int write16BitColorPalette(Bitmap img, ref MemoryStream ms) } return 7; } - internal static void writeGeneric(int format, Bitmap img, ref MemoryStream ms) + internal static void writeGeneric(int format, Bitmap img, ref MemoryStream ms, bool rectangle = true) { int w = img.Width; int h = img.Height; // square format. Yay. w = h = Math.Max(nlpo2(w),nlpo2(h)); - if (format == 0 && Math.Min(img.Width, img.Height) > 64) + if (rectangle && Math.Min(img.Width, img.Height) > 64) { w = nlpo2(img.Width); h = nlpo2(img.Height);