29 uint8_t **instruction_pointer = ip;
30 uint32_t relative_skip = 0;
32 uint8_t *operand_cursor = (*instruction_pointer + 2);
34 *instruction_pointer = (operand_cursor);
35 relative_skip = (uint32_t)(operand_cursor[-2]) << 8;
36 relative_skip |= operand_cursor[-1];
37 *instruction_pointer = (&operand_cursor[1]);
39 char sprite_index = *(uint8_t *)operand_cursor;
41 *instruction_pointer = (&operand_cursor[2]);
43 char negate_target_x = operand_cursor[1];
45 *instruction_pointer = (&operand_cursor[6]);
47 int32_t target_x_high_word_value = (uint32_t)(operand_cursor[2]) << 24;
49 target_x_high_word_value |= (uint32_t)(operand_cursor[4]) << 8;
50 target_x_high_word_value |= (uint32_t)(operand_cursor[3]) << 16;
51 target_x_high_word_value |= operand_cursor[5];
53 int32_t target_x = target_x_high_word_value;
55 *instruction_pointer = (&operand_cursor[7]);
57 uint8_t negate_target_y = operand_cursor[6];
59 *instruction_pointer = (&operand_cursor[0xb]);
61 int32_t target_y_high_word_value = (uint32_t)(operand_cursor[7]) << 24;
63 target_y_high_word_value |= (uint32_t)(operand_cursor[8]) << 16;
64 target_y_high_word_value |= (uint32_t)(operand_cursor[9]) << 8;
65 target_y_high_word_value |= operand_cursor[0xa];
66 *instruction_pointer = (&operand_cursor[0xf]);
68 int32_t raw_target_y = target_y_high_word_value;
69 int32_t duration_high_word_value = (uint32_t)(operand_cursor[0xb]) << 24;
71 duration_high_word_value |= (uint32_t)(operand_cursor[0xc]) << 16;
72 duration_high_word_value |= (uint32_t)(operand_cursor[0xd]) << 8;
74 int32_t target_y = raw_target_y;
76 duration_high_word_value |= operand_cursor[0xe];
77 *instruction_pointer = (&operand_cursor[0x10]);
79 char ease_start_percent = operand_cursor[0xf];
81 *instruction_pointer = (&operand_cursor[0x11]);
83 char ease_end_percent = operand_cursor[0x10];
85 if (negate_target_x == 1)
86 target_x = -(target_x);
88 if (negate_target_y == 1)
89 target_y = -(raw_target_y);
92 int16_t x = sprite_list[(uint8_t)sprite_index].
move_target.
x;
95 if ((int32_t)x != target_x || (int32_t)sprite->
move_target.
y != target_y)
107 .
x = (uint16_t)target_x,
108 .y = (uint16_t)target_y};
126 *instruction_pointer = (&operand_cursor[relative_skip]);
136 uint8_t *branch_target = code + 2 + ((uint32_t)code[0] << 8 | code[1]);
138 unsigned sprite_index = code[2];
140 uint32_t scale_and_duration_operands[3];
142 for (
int i = 0; i < 3; ++i)
144 const uint8_t *operand_bytes = code + 3 + i * 4;
146 scale_and_duration_operands[i] = (uint32_t)operand_bytes[0] << 24 | (uint32_t)operand_bytes[1] << 16 | (uint32_t)operand_bytes[2] << 8 | operand_bytes[3];
149 int32_t scale_x = (int32_t)(scale_and_duration_operands[0] <<
MATH_Q12_SHIFT) / 100;
150 int32_t scale_y = (int32_t)(scale_and_duration_operands[1] <<
MATH_Q12_SHIFT) / 100;
152 unsigned ease_a = code[15], ease_b = code[16];
188 int64_t rotation_conversion_product;
189 uint8_t **instruction_pointer = ip;
190 uint32_t relative_skip = 0;
191 uint8_t *operand_cursor = &(*instruction_pointer)[2];
193 *instruction_pointer = operand_cursor;
194 relative_skip = (uint32_t)(operand_cursor[-2]) << 8;
195 relative_skip |= operand_cursor[-1];
196 *instruction_pointer = &operand_cursor[1];
198 char sprite_index = *(uint8_t *)operand_cursor;
200 *instruction_pointer = &operand_cursor[2];
202 char negate_rotation = operand_cursor[1];
204 *instruction_pointer = &operand_cursor[6];
206 int32_t rotation_high_word_value = (uint32_t)(operand_cursor[2]) << 24;
208 rotation_high_word_value |= (uint32_t)(operand_cursor[4]) << 8;
209 rotation_high_word_value |= (uint32_t)(operand_cursor[3]) << 16;
210 rotation_high_word_value |= operand_cursor[5];
211 *instruction_pointer = &operand_cursor[0xa];
213 int32_t raw_rotation_target_1 = rotation_high_word_value;
214 int32_t duration_high_word_value = (uint32_t)(operand_cursor[6]) << 24;
216 duration_high_word_value |= (uint32_t)(operand_cursor[7]) << 16;
217 duration_high_word_value |= (uint32_t)(operand_cursor[8]) << 8;
218 duration_high_word_value |= operand_cursor[9];
220 int32_t raw_rotation_target = raw_rotation_target_1;
222 *instruction_pointer = &operand_cursor[0xb];
224 char ease_start_percent = operand_cursor[0xa];
226 *instruction_pointer = &operand_cursor[0xc];
228 char ease_end_percent = operand_cursor[0xb];
230 if (negate_rotation == 1)
231 raw_rotation_target = -(raw_rotation_target_1);
235 int32_t target_rotation_angle = (int32_t)((rotation_conversion_product) >>
MATH_Q12_SHIFT);
240 if (prior_target_rotation != target_rotation_angle)
256 if (!negate_rotation && wrapped_start_angle)
274 *instruction_pointer = &operand_cursor[relative_skip];
282 uint8_t *operands = *ip + 2;
286 uint32_t relative_skip = ((uint32_t)operands[-2] << 8) | operands[-1];
290 uint8_t sprite_index = operands[0];
294 uint32_t target_color = operands[1];
297 target_color |= (uint32_t)operands[2] << 8;
299 target_color |= (uint32_t)operands[3] << 16;
302 uint32_t duration = ((uint32_t)operands[4] << 24) |
303 ((uint32_t)operands[5] << 16) |
304 ((uint32_t)operands[6] << 8) | operands[7];
308 uint8_t ease_a = operands[8];
312 uint8_t ease_b = operands[9];
324 int32_t frame_delta = (int32_t)(duration * 30u) >>
MATH_Q12_SHIFT;
333 *ip = operands + relative_skip;
340 uint8_t **instruction_pointer = ip;
341 uint8_t *operand_cursor = (*instruction_pointer + 1);
343 *instruction_pointer = operand_cursor;
345 uint8_t sprite_index = operand_cursor[-1];
346 int32_t *resolved_storage = (int32_t *)(((uintptr_t)ip & ~UINT32_C(0xff)) | sprite_index);
348 *instruction_pointer = &operand_cursor[4];
350 int32_t property_high_word_value = (uint32_t)(*(uint8_t *)operand_cursor) << 24;
352 property_high_word_value |= (uint32_t)(operand_cursor[1]) << 16;
353 property_high_word_value |= (uint32_t)(operand_cursor[2]) << 8;
354 property_high_word_value |= operand_cursor[3];
356 int32_t encoded_property = property_high_word_value;
360 int32_t property_selector_or_control_flags = encoded_property - ref_id;
378 int32_t prior_link_index = (uint8_t)(sprite->
link_index);
380 if (ref_id != prior_link_index)
402 int32_t prior_anchor_code = (uint8_t)(sprite->
anchor_code);
404 if (ref_id != prior_anchor_code)
417 int32_t prior_layer_index = (uint8_t)(sprite->
layer_index);
419 if (ref_id != prior_layer_index)
425 else if (!property_selector_or_control_flags)
427 bool disable_sprite = !ref_id;
int32_t rotation_start_angle
uint8_t color_start_reserved_high
struct Math_EasePairI32 color_ease
struct Math_RangeI32 color_frame_range
struct Math_Vec2I16 move_start
struct Math_RangeI32 scale_frame_range
struct Math_EasePairI32 rotation_ease
struct Math_Vec2I16 move_target
uint8_t current_color_reserved_high
struct Math_Vec2I32 scale_target
struct Math_Vec2I32 scale_start
int32_t rotation_target_angle
int32_t color_target_word
struct Math_EasePairI32 move_ease
struct Math_EasePairI32 scale_ease
struct Math_ColorRGB8 color_start
struct Math_RectI16 bounds
struct Math_RangeI32 rotation_frame_range
struct Math_RangeI32 move_frame_range
struct Math_ColorRGB8 current_color