mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
cosmetic changes.
This commit is contained in:
parent
6aeb3ea27e
commit
6736819db1
@ -176,9 +176,7 @@ namespace GameRes.Formats.ONScripter
|
|||||||
break;
|
break;
|
||||||
if (name_buffer.Length == name_len)
|
if (name_buffer.Length == name_len)
|
||||||
{
|
{
|
||||||
byte[] new_buffer = new byte[checked(name_len/2*3)];
|
Array.Resize (ref name_buffer, checked(name_len/2*3));
|
||||||
Array.Copy (name_buffer, new_buffer, name_len);
|
|
||||||
name_buffer = new_buffer;
|
|
||||||
}
|
}
|
||||||
name_buffer[name_len] = b;
|
name_buffer[name_len] = b;
|
||||||
}
|
}
|
||||||
|
@ -95,12 +95,12 @@ namespace GameRes.Formats.DRS
|
|||||||
int stride = (int)info.Width*((info.BPP+7)/8);
|
int stride = (int)info.Width*((info.BPP+7)/8);
|
||||||
if (8 == info.BPP)
|
if (8 == info.BPP)
|
||||||
{
|
{
|
||||||
|
file.Position = 44;
|
||||||
format = PixelFormats.Indexed8;
|
format = PixelFormats.Indexed8;
|
||||||
var palette_data = new byte[0x400];
|
var palette_data = new byte[0x400];
|
||||||
if (palette_data.Length != file.Read (palette_data, 0, palette_data.Length))
|
if (palette_data.Length != file.Read (palette_data, 0, palette_data.Length))
|
||||||
throw new InvalidFormatException();
|
throw new InvalidFormatException();
|
||||||
var palette = new Color[256];
|
var palette = new Color[256];
|
||||||
file.Position = 44;
|
|
||||||
for (int i = 0; i < 256; ++i)
|
for (int i = 0; i < 256; ++i)
|
||||||
{
|
{
|
||||||
palette[i] = Color.FromRgb (palette_data[i*4+2], palette_data[i*4+1], palette_data[i*4]);
|
palette[i] = Color.FromRgb (palette_data[i*4+2], palette_data[i*4+1], palette_data[i*4]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user