cosmetic changes.

This commit is contained in:
morkt 2014-10-31 18:47:37 +04:00
parent 6aeb3ea27e
commit 6736819db1
2 changed files with 2 additions and 4 deletions

View File

@ -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;
} }

View File

@ -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]);