avm2: Rename current_position -> instruction_start

This commit is contained in:
CUB3D 2021-04-03 21:49:01 +01:00 committed by kmeisthax
parent c22ebc1de3
commit e2f124ee34
1 changed files with 4 additions and 4 deletions

View File

@ -534,7 +534,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
); );
} }
let current_position = reader.pos(full_data); let instruction_start = reader.pos(full_data);
let op = reader.read_op(); let op = reader.read_op();
if let Ok(Some(op)) = op { if let Ok(Some(op)) = op {
avm_debug!(self.avm2(), "Opcode: {:?}", op); avm_debug!(self.avm2(), "Opcode: {:?}", op);
@ -688,7 +688,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
} => self.op_lookup_switch( } => self.op_lookup_switch(
default_offset, default_offset,
&case_offsets, &case_offsets,
current_position, instruction_start,
reader, reader,
full_data, full_data,
), ),
@ -2386,7 +2386,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
&mut self, &mut self,
default_offset: i32, default_offset: i32,
case_offsets: &[i32], case_offsets: &[i32],
current_pos: usize, instruction_start: usize,
reader: &mut Reader<'b>, reader: &mut Reader<'b>,
full_data: &'b [u8], full_data: &'b [u8],
) -> Result<FrameControl<'gc>, Error> { ) -> Result<FrameControl<'gc>, Error> {
@ -2396,7 +2396,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
.get(index as usize) .get(index as usize)
.copied() .copied()
.unwrap_or(default_offset) .unwrap_or(default_offset)
+ current_pos as i32 + instruction_start as i32
- reader.pos(full_data) as i32; - reader.pos(full_data) as i32;
reader.seek(full_data, offset); reader.seek(full_data, offset);