mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
CopyOverlapped function defined in GameRes.Utitlity now.
CopyOverlapped copies ranges within array the same way standard C function memcpy does (that is, ignoring potential region overlapping).
This commit is contained in:
@@ -69,6 +69,20 @@ namespace GameRes.Utility
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void CopyOverlapped (byte[] data, int src, int dst, int count)
|
||||
{
|
||||
int preceding = dst-src;
|
||||
while (count > 0)
|
||||
{
|
||||
if (preceding > count)
|
||||
preceding = count;
|
||||
System.Array.Copy (data, src, data, dst, preceding);
|
||||
src = dst;
|
||||
dst += preceding;
|
||||
count -= preceding;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class LittleEndian
|
||||
|
||||
Reference in New Issue
Block a user