(malie): LIBP alignment handling.

This commit is contained in:
morkt
2017-06-07 00:54:03 +04:00
parent 360664343f
commit 8a74eb1c77
3 changed files with 13 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ namespace GameRes.Formats.Malie
[Serializable]
public abstract class LibScheme
{
public uint DataAlign;
uint DataAlign;
public LibScheme (uint align)
{
@@ -40,6 +40,12 @@ namespace GameRes.Formats.Malie
}
public abstract IMalieDecryptor CreateDecryptor ();
public virtual long GetAlignedOffset (long offset)
{
long align = DataAlign - 1;
return (offset + align) & ~align;
}
}
[Serializable]