(ags): green background by default.

This commit is contained in:
morkt 2017-03-11 11:37:22 +04:00
parent da05891157
commit df15daebf0
2 changed files with 10 additions and 3 deletions

View File

@ -147,10 +147,9 @@ namespace GameRes.Formats.Ags
} }
} }
var input = arc.File.CreateStream (entry.Offset, entry.Size); var input = arc.File.CreateStream (entry.Offset, entry.Size);
CgMetaData info = null;
try try
{ {
info = Cg.ReadMetaData (input) as CgMetaData; var info = Cg.ReadMetaData (input) as CgMetaData;
if (null == info) if (null == info)
throw new InvalidFormatException(); throw new InvalidFormatException();
return new CgFormat.Reader (input, info, key_frame); return new CgFormat.Reader (input, info, key_frame);

View File

@ -129,7 +129,7 @@ namespace GameRes.Formats.Ags
m_top = info.OffsetY; m_top = info.OffsetY;
m_right = info.Right == 0 ? m_width : info.Right; m_right = info.Right == 0 ? m_width : info.Right;
m_bottom = info.Bottom == 0 ? m_height : info.Bottom; m_bottom = info.Bottom == 0 ? m_height : info.Bottom;
m_output = base_image ?? new byte[3*m_width*m_height]; m_output = base_image ?? CreateBackground();
m_input = file; m_input = file;
Info = info; Info = info;
ShiftTable = InitShiftTable(); ShiftTable = InitShiftTable();
@ -159,6 +159,14 @@ namespace GameRes.Formats.Ags
return table; return table;
} }
private byte[] CreateBackground ()
{
var bg = new byte[3*m_width*m_height];
for (int i = 1; i < bg.Length; i += 3)
bg[i] = 0xFF;
return bg;
}
public void Unpack () public void Unpack ()
{ {
if (0 != (m_type & 0x10)) if (0 != (m_type & 0x10))