lib/mikunyan/asset.rb in mikunyan-3.9.7 vs lib/mikunyan/asset.rb in mikunyan-3.9.8
- old
+ new
@@ -173,10 +173,18 @@
br.adv(3)
else
br.pos = file_size - meta_size
@endian = br.bool ? :big : :little
end
+
+ if @format >= 22
+ meta_size = br.i32u
+ file_size = br.i64u
+ data_offset = br.i64u
+ br.adv(8)
+ end
+
br.endian = @endian
@generator_version = br.cstr if @format >= 7
@target_platform = br.i32 if @format >= 8
has_type_trees = @format >= 13 ? br.bool : true
@@ -196,11 +204,12 @@
object_count = br.i32u
@objects = Array.new(object_count) do
br.align(4) if @format >= 14
if @format >= 16
ObjectEntry.new(
- path_id: wide_path_id ? br.i64s : br.i32s, offset: br.i32u, size: br.i32u,
+ path_id: wide_path_id ? br.i64s : br.i32s,
+ offset: @format >= 22 ? br.i64u : br.i32u, size: br.i32u,
class_idx: br.i32u, stripped?: @format == 16 ? br.bool : nil,
parent_asset: self
)
else
ObjectEntry.new(
@@ -225,9 +234,10 @@
@references = Array.new(reference_count) do
Reference.new(@format >= 6 ? br.cstr : nil, @format >= 5 ? br.read(16) : nil, @format >= 5 ? br.i32s : nil, br.cstr)
end
@comment = br.cstr if @format >= 5
+ # _ = br.i32 if @format >= 21
@objects.each do |e|
br.jmp(data_offset + e.offset)
e.data = br.read(e.size)
e.klass = e.class_idx ? @klasses[e.class_idx] : @klasses.find{|e2| e2.class_id == e.class_id} || @klasses.find{|e2| e2.class_id == e.type_id}