Removed redundant statements
This commit is contained in:
@@ -30,7 +30,7 @@ public class Reader {
|
||||
public List<object> GetObjects() => objects.Values.ToList();
|
||||
public List<T> GetObjects<T>() => objects.Values.OfType<T>().ToList();
|
||||
|
||||
private SortedDictionary<long, Kaitai.BlendFile.FileBlock> memBlocks = new();
|
||||
private SortedDictionary<long, FileBlock> memBlocks = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the block at the specified memory address
|
||||
@@ -73,7 +73,7 @@ public class Reader {
|
||||
|
||||
Console.WriteLine($"Start offset: 0x{blend.Blocks[0].MemAddr.ToPointer():X}");
|
||||
|
||||
bool isLe = blend.Hdr.Endian == Kaitai.BlendFile.Endian.Le;
|
||||
bool isLe = blend.Hdr.Endian == Endian.Le;
|
||||
//TODO: two blocks somehow have the same mem address... this sounds wrong.
|
||||
blend.Blocks.ForEach(block => memBlocks.TryAdd(block.MemAddr.ToMemAddr(isLe), block));
|
||||
|
||||
@@ -242,12 +242,11 @@ public class Reader {
|
||||
array[i / itemLenght] = ConvertFieldData(itemData, attrib.OriginalType);
|
||||
}
|
||||
return array;
|
||||
} else {
|
||||
//Convert the data to the correct type if it's a base type
|
||||
object? value = ConvertFieldData(data, attrib.OriginalType);
|
||||
if (value != null) return value;
|
||||
}
|
||||
|
||||
//Convert the data to the correct type if it's a base type
|
||||
object? value = ConvertFieldData(data, attrib.OriginalType);
|
||||
if (value != null) return value;
|
||||
|
||||
//Check if the field is a pointer to another DNA structure
|
||||
if (dnaTypesDb.ContainsKey(attrib.OriginalType)) {
|
||||
if (!attrib.IsPointer) { //It's a structure
|
||||
|
||||
Reference in New Issue
Block a user