mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
(McgDecoder): use ImageFormat.ReadPalette.
This commit is contained in:
parent
13cf289bae
commit
cb5dc9c726
@ -189,7 +189,7 @@ namespace GameRes.Formats.FC01
|
||||
int input_size = m_info.PackedSize;
|
||||
if (8 == m_info.BPP)
|
||||
{
|
||||
ReadPalette();
|
||||
Palette = ImageFormat.ReadPalette (m_file.AsStream);
|
||||
input_size -= 0x400;
|
||||
}
|
||||
m_input = m_file.ReadBytes (input_size);
|
||||
@ -314,18 +314,5 @@ namespace GameRes.Formats.FC01
|
||||
m_output[dst++] = (byte)(r + g);
|
||||
}
|
||||
}
|
||||
|
||||
void ReadPalette ()
|
||||
{
|
||||
var palette_data = m_file.ReadBytes (0x400);
|
||||
int src = 0;
|
||||
var colors = new Color[0x100];
|
||||
for (int i = 0; i < 0x100; ++i)
|
||||
{
|
||||
colors[i] = Color.FromRgb (palette_data[src+2], palette_data[src+1], palette_data[src]);
|
||||
src += 4;
|
||||
}
|
||||
Palette = new BitmapPalette (colors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user