[Solved]Dyeing Problem
hm... i'm upgrading my graphic engine to be compatible with korea mir3 WTL resources, higher resolution and much more gorgeous armors.
i have carefully read the source code in crystal engine and C# WTL viewer:
// FROM
var block = new byte[size];
Array.Copy(fBytes, blockOffSet, block, 0, size);// block[8] contain 2 * 16b color info
// VIA
private static void DecompressBlock(IList<byte> newPixels, byte[] block)
// WE GET
var newPixels = new byte[64]; // 4 * 4 * 32b color info
// COPY TO THE DST
Array.Copy(newPixels, pixelOffSet, sourcePixel, 0, 4);
pixelOffSet += 4;
if (destPixel + 4 > cap)
break;
for (int pc = 0; pc < 4; pc++)
pixels[destPixel + pc] = sourcePixel[pc];
my engine can display the WTL image now, though the decompressing process looks so weird(using two 16bit colors to produce sixteen 32bit colors...?!).
buuuuuuuuuuuuuuut, there is a functional problem about dyeing. What is the symbol of dyeing in WTL like 0x00C2 and 0x00C3 in old WIL?
in the WIL decompressing process, we do dyeing like this:
if ( srcColor == 0x00C2 || srcColor == 0x00C3 )
{
dyeing code...
}
but in the WTL decompressing process...
// block header : 4 bytes offset info and 4 bytes info about the number of the block
// block : 4 bytes colors + 4 bytes indices
no symbol was found...
could someone lend me a hand please?
related discussion is welcome.
hm... i'm upgrading my graphic engine to be compatible with korea mir3 WTL resources, higher resolution and much more gorgeous armors.
i have carefully read the source code in crystal engine and C# WTL viewer:
// FROM
var block = new byte[size];
Array.Copy(fBytes, blockOffSet, block, 0, size);// block[8] contain 2 * 16b color info
// VIA
private static void DecompressBlock(IList<byte> newPixels, byte[] block)
// WE GET
var newPixels = new byte[64]; // 4 * 4 * 32b color info
// COPY TO THE DST
Array.Copy(newPixels, pixelOffSet, sourcePixel, 0, 4);
pixelOffSet += 4;
if (destPixel + 4 > cap)
break;
for (int pc = 0; pc < 4; pc++)
pixels[destPixel + pc] = sourcePixel[pc];
my engine can display the WTL image now, though the decompressing process looks so weird(using two 16bit colors to produce sixteen 32bit colors...?!).
buuuuuuuuuuuuuuut, there is a functional problem about dyeing. What is the symbol of dyeing in WTL like 0x00C2 and 0x00C3 in old WIL?
in the WIL decompressing process, we do dyeing like this:
if ( srcColor == 0x00C2 || srcColor == 0x00C3 )
{
dyeing code...
}
but in the WTL decompressing process...
// block header : 4 bytes offset info and 4 bytes info about the number of the block
// block : 4 bytes colors + 4 bytes indices
no symbol was found...
could someone lend me a hand please?
related discussion is welcome.
Last edited: