mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
Fix cgear png import
Closes #3231 Symptoms observed: - Tiles were too dark (not high enough RBG value due to >>3; keep 8bit color here. - Red/Blue channel inverted, swap R & B. Works? Hope this isn't something related to png storing rgb vs bgr and we'd need to check input pixel format? - Tiles were misplaced slightly, off by 1. Fix order of operations so that the tile choice value is correct.
This commit is contained in:
parent
6ee552b860
commit
f5090e3ae7
1 changed files with 5 additions and 5 deletions
|
@ -182,10 +182,10 @@ namespace PKHeX.Core
|
|||
|
||||
private static int GetRGB555_32(int val)
|
||||
{
|
||||
var R = (val >> 0 >> 3) & 0x1F;
|
||||
var G = (val >> 8 >> 3) & 0x1F;
|
||||
var B = (val >> 16 >> 3) & 0x1F;
|
||||
return 0xFF << 24 | R << 16 | G << 8 | B;
|
||||
var R = (val >> 00) & 0xFF;
|
||||
var G = (val >> 08) & 0xFF;
|
||||
var B = (val >> 16) & 0xFF;
|
||||
return 0xFF << 24 | B << 16 | G << 8 | R;
|
||||
}
|
||||
|
||||
private static int GetRGB555_16(ushort val)
|
||||
|
@ -305,9 +305,9 @@ namespace PKHeX.Core
|
|||
}
|
||||
|
||||
// No tile found, add to list
|
||||
tilelist.Add(t);
|
||||
tm.TileChoices[tileIndex] = tilelist.Count - 1;
|
||||
tm.Rotations[tileIndex] = 0;
|
||||
tilelist.Add(t);
|
||||
}
|
||||
|
||||
private CGearBackground(int[] Palette, Tile[] tilelist, TileMap tm)
|
||||
|
|
Loading…
Reference in a new issue