Misc fixes

This commit is contained in:
Ottermandias 2022-03-20 11:20:50 +01:00
parent d03a3168b0
commit 4888bc243f
2 changed files with 5 additions and 9 deletions

View file

@ -66,12 +66,10 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
var def = ( byte* )DefaultData.Data; var def = ( byte* )DefaultData.Data;
Functions.MemCpyUnchecked( Data, def, IdentifierSize + PreambleSize ); Functions.MemCpyUnchecked( Data, def, IdentifierSize + PreambleSize );
var controlPtr = ( ushort* )( def + IdentifierSize + PreambleSize ); var controlPtr = ( ushort* )( def + IdentifierSize + PreambleSize );
var dataBasePtr = controlPtr + BlockCount; var dataBasePtr = controlPtr + BlockCount;
var myDataPtrStart = ( ushort* )( Data + IdentifierSize + PreambleSize + 2 * BlockCount ); var myDataPtr = ( ushort* )( Data + IdentifierSize + PreambleSize + 2 * BlockCount );
var myDataPtr = myDataPtrStart; var myControlPtr = ( ushort* )( Data + IdentifierSize + PreambleSize );
var myControlPtr = ( ushort* )( Data + IdentifierSize + PreambleSize );
var x = new ReadOnlySpan< ushort >( ( ushort* )Data, Length / 2 );
for( var i = 0; i < BlockCount; ++i ) for( var i = 0; i < BlockCount; ++i )
{ {
if( controlPtr[ i ] == CollapsedBlock ) if( controlPtr[ i ] == CollapsedBlock )
@ -80,8 +78,6 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
} }
else else
{ {
var y = new ReadOnlySpan< ushort >( dataBasePtr + controlPtr[ i ], BlockSize );
var z = new ReadOnlySpan< ushort >( myDataPtr, BlockSize );
Functions.MemCpyUnchecked( myDataPtr, dataBasePtr + controlPtr[ i ], BlockSize * EqdpEntrySize ); Functions.MemCpyUnchecked( myDataPtr, dataBasePtr + controlPtr[ i ], BlockSize * EqdpEntrySize );
} }

View file

@ -56,7 +56,7 @@ public partial class MetaManager
Manipulations.Clear(); Manipulations.Clear();
} }
public unsafe bool ApplyMod( ImcManipulation m, Mod.Mod mod ) public bool ApplyMod( ImcManipulation m, Mod.Mod mod )
{ {
#if USE_IMC #if USE_IMC
if( !Manipulations.TryAdd( m, mod ) ) if( !Manipulations.TryAdd( m, mod ) )