73 if (normals_or_list_1)
83 void *aux_84_1 = node->
aux_84;
102 if (!material_ref_fixup_disabled)
107 (void)native_node->
aux_84;
137 if (animation_state_table)
149 if (material_indices_or_polygons)
160 if (relocation_list_b0)
162 int32_t *relative_pointer_cursor = (int32_t *)((
char *)relocation_list_b0 + (uintptr_t)
g_levelBlobPtr);
166 for (
void *relative_pointer_offset = (
void *)(*(uint32_t *)relative_pointer_cursor); relative_pointer_offset; relative_pointer_offset = (
void *)(*(uint32_t *)relative_pointer_cursor))
168 relative_pointer_cursor = &relative_pointer_cursor[1];
169 relative_pointer_cursor[-1] = (uintptr_t)relative_pointer_offset + (uintptr_t)node->
relocation_list_b0;
191 int32_t channel_index = 0;
200 int32_t frame_count = (int32_t)animation_data->
channel_counts[channel_index];
208 *channel_array_slot = channel_cursor;
215 if (keyframes_or_minus_one_sentinel && (uintptr_t)keyframes_or_minus_one_sentinel != UINT32_MAX
227 if (!channel_is_not_nested)
230 int32_t nested_channel_index = 0;
236 int32_t nested_channel_count;
247 nested_channel_index += 1;
249 nested_channel = &nested_channel[1];
250 }
while (nested_channel_index < nested_channel_count);
255 channel_cursor = &channel_cursor[1];
256 }
while (--frame_count);
260 channel_array_slot = &channel_array_slot[1];
373 if (uv_or_child_list)
377 void *aux_84 = node->
aux_84;
389 (void)native_node->
aux_84;
421 typed_entry_cursor = &typed_entry_cursor[1];
422 }
while (--entry_count_f2);
425 void *aux_80 = node->
aux_80;
436 if (material_refs_for_noop)
453 if (secondary_entries)
455 void *relocated_secondary_entries = (
char *)secondary_entries + (uintptr_t)
g_levelBlobPtr;
465 secondary_entry_cursor = &secondary_entry_cursor[1];
466 }
while (--secondary_entries_remaining);
473 if (material_indices_or_polygons)
484 if (relocation_list_b0)
486 int32_t *relocation_b0_cursor = (int32_t *)((
char *)relocation_list_b0 + (uintptr_t)
g_levelBlobPtr);
490 int32_t relative_offset_or_sentinel = *(uint32_t *)relocation_b0_cursor;
492 while (relative_offset_or_sentinel)
495 *(uint32_t *)relocation_b0_cursor = (uint32_t)((uint8_t *)node->
relocation_list_b0 + relative_offset_or_sentinel);
497 *(uint32_t *)relocation_b0_cursor = relative_offset_or_sentinel;
499 relative_offset_or_sentinel = relocation_b0_cursor[1];
500 relocation_b0_cursor = &relocation_b0_cursor[1];
506 if (relocation_list_100)
508 int32_t *relocation_100_cursor = (int32_t *)((
char *)relocation_list_100 + (uintptr_t)
g_levelBlobPtr);
512 for (
void *relative_record_offset = (
void *)(*(uint32_t *)relocation_100_cursor); relative_record_offset; relative_record_offset = (
void *)(*(uint32_t *)relocation_100_cursor))
514 relocation_100_cursor = &relocation_100_cursor[1];
515 relocation_100_cursor[-1] = (uintptr_t)relative_record_offset + (uintptr_t)node->
relocation_list_100;
523 int32_t *linked_record_array = (int32_t *)((
char *)linked_records + (uintptr_t)
g_levelBlobPtr);
527 int32_t linked_record_offset = *(uint32_t *)linked_record_array;
528 int32_t *linked_record_cursor = &linked_record_array[1];
530 for (; linked_record_offset; linked_record_offset = (uint32_t)linked_record_cursor[-1])
532 linked_record_cursor += 1;
534 void *relocated_linked_record = &
g_levelBlobPtr[linked_record_offset];
536 linked_record_cursor[-2] = (uint32_t)(relocated_linked_record);
543 if (component_or_owner)
545 void *relocated_component_owner = (
char *)component_or_owner + (uintptr_t)
g_levelBlobPtr;
563 void *component_record_offset = (
void *)(owner_payload_cursor->
blob_payload);
565 if (component_record_offset)
568 owner_payload_cursor = &owner_payload_cursor[1];
569 }
while (--component_records_remaining);
580 if (!global_texture_refs)
583 void *relocated_global_texture_refs = (
char *)global_texture_refs + (uintptr_t)
g_levelBlobPtr;
614 int32_t *normal_list_cursor = (int32_t *)((
char *)normals_or_list + (uintptr_t)
g_levelBlobPtr);
618 for (; normal_list_cursor; normal_list_cursor = (int32_t *)(*(uint32_t *)normal_list_cursor))
620 void *normal_list_next_offset = (
void *)(*(uint32_t *)normal_list_cursor);
622 if (normal_list_next_offset)
623 *(uint32_t *)normal_list_cursor = (uint32_t)(uintptr_t)((
char *)normal_list_next_offset + (uintptr_t)
g_levelBlobPtr);
629 if (uv_or_child_list)
646 }
while (node_type_1);
657 node->
aux_80 = index_list_raw;
674 int32_t *list_a4_cursor = (int32_t *)((
char *)list_head_a4 + (uintptr_t)
g_levelBlobPtr);
678 for (; list_a4_cursor; list_a4_cursor = (int32_t *)(*(uint32_t *)list_a4_cursor))
680 void *list_a4_next_offset = (
void *)(*(uint32_t *)list_a4_cursor);
682 if (list_a4_next_offset)
683 *(uint32_t *)list_a4_cursor = (uint32_t)(uintptr_t)((
char *)list_a4_next_offset + (uintptr_t)
g_levelBlobPtr);
691 int32_t *list_9c_cursor = (int32_t *)((
char *)list_head_9c + (uintptr_t)
g_levelBlobPtr);
695 for (; list_9c_cursor; list_9c_cursor = (int32_t *)(*(uint32_t *)list_9c_cursor))
697 void *list_9c_next_offset = (
void *)(*(uint32_t *)list_9c_cursor);
699 if (list_9c_next_offset)
700 *(uint32_t *)list_9c_cursor = (uint32_t)(uintptr_t)((
char *)list_9c_next_offset + (uintptr_t)
g_levelBlobPtr);
704 void **auxiliary_list_slot = &node->
aux_84;
709 void *aux_84 = *auxiliary_list_slot;
713 void **auxiliary_list_cursor = (
void **)((
char *)aux_84 + (uintptr_t)
g_levelBlobPtr);
715 *auxiliary_list_slot = auxiliary_list_cursor;
717 for (; auxiliary_list_cursor; auxiliary_list_cursor = (
void **)(*(uint32_t *)auxiliary_list_cursor))
719 void *auxiliary_next_offset = (
void *)(*(uint32_t *)auxiliary_list_cursor);
721 if (auxiliary_next_offset)
722 *(uint32_t *)auxiliary_list_cursor = (uint32_t)(uintptr_t)((
char *)auxiliary_next_offset + (uintptr_t)
g_levelBlobPtr);
726 auxiliary_list_slot = &auxiliary_list_slot[1];
727 }
while (--lists_remaining);
736 for (uint32_t node_offset = *(uint32_t *)node_pointer_cursor; node_offset; node_offset = *(uint32_t *)node_pointer_cursor)
740 *(uint32_t *)node_pointer_cursor = (uint32_t)(node);
742 if (list_entries_are_inline)
749 node_pointer_cursor = &node_pointer_cursor[1];
758 if (normals_or_list_1)
768 void *aux_84_1 = node->
aux_84;
779 bool material_ref_count_nonpositive = *(
const volatile int16_t *)&node->
field_68 <= 0;
783 if (!material_ref_count_nonpositive)
787 (void)native_node->
aux_84;
808 if (material_indices_or_polygons_1->
entry_count > 0)
812 uint32_t *polygon_pointer_array = (uint32_t *)material_indices_or_polygons_1->
entries_offset;
814 polygon_pointer_array[j] =
818 }
while (j < (int32_t)material_indices_or_polygons_1->
entry_count);
822 void *aux_80 = node->
aux_80;
829 bool auxiliary_ref_count_nonpositive = *(
const volatile int16_t *)&native_node->
field_68 <= 0;
833 if (!auxiliary_ref_count_nonpositive)
855 Debug_Log(
"FixUpLevel(): level == NULL!", (
const char *)(level));
858 Debug_Log(
"FixUpLevel(): levelBase == NULL!", NULL);
861 Debug_Log(
"level->cam_default = ABS_ADDR(...);", NULL);
864 char *camera_fixup_message;
868 if (debug_logging_enabled)
870 Debug_Log(
"level->cam_default: get abs address.", NULL);
876 camera_fixup_message =
"level->cam_default != NULL";
885 else if (debug_logging_enabled)
887 camera_fixup_message =
"level->cam_default = NULL";
898 if (entity_count <= 0)
899 Debug_Log(
"level->actor_ct <= 0!", NULL);
908 if (entity_array_offset == -(uintptr_t)(level_blob_ptr))
914 Debug_Log(
"level->actor_list != NULL", NULL);
920 Debug_Log(
"cycle thru actor list.", NULL);
922 if (entity_count > 0)
925 int32_t entities_remaining = entity_count;
931 if (bonus_respawn_target_pos)
937 if (actor_template_header_ref)
980 (*component_ref_slot) = component_data;
991 component_ref_slot = &component_ref_slot[1];
992 }
while (--component_refs_remaining);
994 actor_record = &actor_record[1];
995 }
while (--entities_remaining);
1004 if (sound_definition_list_offset)
1012 if (var_list_offset)
1017 Debug_Log(
"level->powerup_ct ... ", NULL);
1019 int32_t powerups_remaining = (uint16_t)(level->
powerup_count);
1021 if (powerups_remaining)
1027 int32_t *powerup_record_cursor = powerup_list;
1029 if (powerups_remaining > 0)
1033 void *powerup_node_offset = (
void *)(*(uint32_t *)powerup_record_cursor);
1035 if (powerup_node_offset)
1036 *(uint32_t *)powerup_record_cursor = (uint32_t)((uintptr_t)powerup_node_offset +
g_levelBlobPtr);
1038 powerup_record_cursor = &powerup_record_cursor[7];
1039 }
while (--powerups_remaining);
1048 if (sprite_list_offset)
1056 char sprite_list_flags;
1071 sprite_list_flags = (char)sprite_cursor->
state_flags;
1072 sprite_cursor = &sprite_cursor[1];
1088 uint32_t theme_reference = (*theme_slot);
1090 if (theme_reference)
1098 theme_slot = &theme_slot[1];
1099 }
while (--themes_remaining);
1104 int32_t trail_index = 0;
1111 void *trail_payload_offset = trail_list[trail_index].
data_ptr;
1113 if (trail_payload_offset)
1127 if (animation_state_table)
1156 uint32_t powerup_template_offset = *powerup_template_slot;
1158 if (powerup_template_offset)
1162 *powerup_template_slot = (uint32_t)(actor_template_1);
1166 ++powerup_template_slot;
1167 }
while (--templates_remaining);
1181 void *navigation_nodes_offset = (
void *)(navigation_header->
nodes);
1183 if (navigation_nodes_offset)
1185 uint32_t navigation_node_index = 0;
1189 if ((uint32_t)navigation_header->
node_count > 0)
1193 struct Nav_Node *navigation_nodes = navigation_header->
nodes;
1194 void *navigation_links_offset = navigation_nodes[navigation_node_index].
neighbor_list;
1196 if (navigation_links_offset)
1199 navigation_node_index += 1;
1200 }
while (navigation_node_index < (uint32_t)navigation_header->
node_count);
1210 if (usable_materials_offset)
1212 int32_t usable_material_byte_offset = 0;
1219 int32_t usable_material_index = useable_mat_entry[1];
1221 if (usable_material_index)
1225 int32_t usable_frame_set_offset = *(uint32_t *)useable_mat_entry;
1227 if (usable_frame_set_offset)
1231 *(uint32_t *)useable_mat_entry = (uint32_t)(frame_set);
1236 usable_material_byte_offset += 0xc;
1237 }
while (usable_material_byte_offset < 0x60);
1244 if (debug_logging_enabled_2)
struct Material_Entry * texture_db1