reduced unsafe block.

This commit is contained in:
morkt
2015-10-10 02:46:02 +04:00
parent 8711349c19
commit f09921cd1d

View File

@@ -206,11 +206,6 @@ namespace GameRes.Formats.TopCat
return DecryptOgg (arc, entry); return DecryptOgg (arc, entry);
var header = new byte[0x14]; var header = new byte[0x14];
arc.File.View.Read (entry.Offset, header, 0, 0x14); arc.File.View.Read (entry.Offset, header, 0, 0x14);
unsafe
{
fixed (byte* raw = header)
{
int* dw = (int*)raw;
if (null == tcda.Key) if (null == tcda.Key)
{ {
foreach (var key in KnownKeys.Values) foreach (var key in KnownKeys.Values)
@@ -225,6 +220,11 @@ namespace GameRes.Formats.TopCat
} }
if (null != tcda.Key && 0 != tcda.Key.Value) if (null != tcda.Key && 0 != tcda.Key.Value)
{ {
unsafe
{
fixed (byte* raw = header)
{
int* dw = (int*)raw;
for (int i = 0; i < 5; ++i) for (int i = 0; i < 5; ++i)
dw[i] += tcda.Key.Value * (tcde.Index + 3 + i); dw[i] += tcda.Key.Value * (tcde.Index + 3 + i);
} }