private void ProcessPlacedObject( MajorRecordFrame majorFrame, long fileOffset) { int amount = 0; if (majorFrame.TryLocateSubrecordFrame(RecordTypes.XLOC, out var xlocFrame, out var xlocLoc) && xlocFrame.ContentLength == 16) { ModifyLengthTracking(fileOffset, -4); var removeStart = fileOffset + xlocLoc + xlocFrame.HeaderLength + 12; this._instructions.SetSubstitution( loc: fileOffset + xlocLoc + 4, sub: new byte[] { 12, 0 }); this._instructions.SetRemove( section: new RangeInt64( removeStart, removeStart + 3)); amount -= 4; } if (majorFrame.TryLocateSubrecordFrame(RecordTypes.XSED, out var xsedFrame, out var xsedLoc)) { var len = xsedFrame.ContentLength; if (len == 4) { ModifyLengthTracking(fileOffset, -3); var removeStart = fileOffset + xsedLoc + xsedFrame.HeaderLength + 1; this._instructions.SetSubstitution( loc: fileOffset + xsedLoc + 4, sub: new byte[] { 1, 0 }); this._instructions.SetRemove( section: new RangeInt64( removeStart, removeStart + 2)); amount -= 3; } } if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { ProcessZeroFloats(dataRec, fileOffset, 6); } if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.XTEL, out var xtelFrame)) { ProcessZeroFloats(xtelFrame, fileOffset, 6); } ProcessLengths( majorFrame, amount, fileOffset); }
private void ProcessImageSpaceAdapters( MajorRecordFrame majorFrame, long fileOffset) { void ProcessKeyframe(SubrecordPinFrame subrecord) { ProcessZeroFloats(subrecord, fileOffset, subrecord.ContentLength / 4); } foreach (var subrecord in majorFrame) { switch (subrecord.RecordTypeInt) { case RecordTypeInts.QIAD: case RecordTypeInts.RIAD: ProcessKeyframe(subrecord); break; default: break; } } if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { int offset = 0; ProcessFormIDOverflows(dataRec, fileOffset, ref offset, 6); ProcessZeroFloats(dataRec, fileOffset, ref offset, 5); } }
private void ProcessShaders( MajorRecordFrame majorFrame, long fileOffset) { if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { var index = 20; ProcessZeroFloats(dataRec, fileOffset, ref index, 9); index += 4; ProcessZeroFloats(dataRec, fileOffset, ref index, 8); index += 20; ProcessZeroFloats(dataRec, fileOffset, ref index, 19); index += 12; ProcessZeroFloats(dataRec, fileOffset, ref index, 11); index += 4; ProcessZeroFloats(dataRec, fileOffset, ref index, 5); index += 4; ProcessZeroFloat(dataRec, fileOffset, ref index); index += 8; ProcessZeroFloats(dataRec, fileOffset, ref index, 6); index += 12; ProcessZeroFloats(dataRec, fileOffset, ref index, 9); index += 32; ProcessZeroFloats(dataRec, fileOffset, ref index, 2); } }
private void ProcessLoadScreens( MajorRecordFrame majorFrame, long fileOffset) { if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.XNAM, out var xnamRec)) { ProcessZeroFloats(xnamRec, fileOffset, 3); } }
private void ProcessBooks( MajorRecordFrame majorFrame, long fileOffset) { if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { var offset = 2; ProcessZeroFloats(dataRec, fileOffset, ref offset, 2); } }
private void ProcessPlaced( MajorRecordFrame majorFrame, long fileOffset) { var sizeChange = 0; if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { ProcessZeroFloats(dataRec, fileOffset, 6); } if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.XTEL, out var xtelRec)) { var offset = 4; ProcessZeroFloats(xtelRec, fileOffset, ref offset, 6); } if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.XPRM, out var xprmRec)) { int offset = 0; ProcessZeroFloats(xprmRec, fileOffset, ref offset, 3); ProcessColorFloat(xprmRec, fileOffset, ref offset); ProcessZeroFloat(xprmRec, fileOffset, ref offset); } if (majorFrame.TryLocateSubrecordFrame(RecordTypes.XRMR, out var xrmrRec, out var xrmrIndex)) { if (xrmrRec.AsInt32() == 0) { _Instructions.SetRemove( RangeInt64.FactoryFromLength( fileOffset + xrmrIndex, 10)); sizeChange -= 10; } } ProcessLengths( majorFrame, sizeChange, fileOffset); }
private void ProcessExplosions( MajorRecordFrame majorFrame, long fileOffset) { if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { int offset = 0; ProcessFormIDOverflows(dataRec, fileOffset, ref offset, 6); ProcessZeroFloats(dataRec, fileOffset, ref offset, 5); } }
private void ProcessTransforms( MajorRecordFrame majorFrame, long fileOffset) { if (!majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { return; } int offset = 0; ProcessZeroFloats(dataRec, fileOffset, ref offset, 9); }
private void ProcessPlacedNPC( MajorRecordFrame majorFrame, long fileOffset) { int amount = 0; if (majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { ProcessZeroFloats(dataRec, fileOffset, 6); } ProcessLengths( majorFrame, amount, fileOffset); }
private void ProcessGameSettings( MajorRecordFrame majorFrame, long fileOffset) { if (!majorFrame.TryLocateSubrecordFrame("EDID", out var edidFrame)) { return; } if ((char)edidFrame.Content[0] != 'f') { return; } if (!majorFrame.TryLocateSubrecordPinFrame(RecordTypes.DATA, out var dataRec)) { return; } ProcessZeroFloat(dataRec, fileOffset); }