diff --git a/config/parked.json b/config/parked.json index a968d069..164cec87 100644 --- a/config/parked.json +++ b/config/parked.json @@ -501,25 +501,6 @@ "objdiff_percent": 97.91391 } }, - { - "unit": "source/interface/hud_unit", - "function": "_hud_render_unit_interface", - "class": "unclassified", - "evidence": "Fresh ordinary typed reconstruction of January unit-HUD layering, shield overcharge/fade, health colors, motion sensor, team-color overlays, auxiliary meters and real stack-corruption guards. January and independent HCEX PDB evidence authenticate the 18-entry index arrays, one auxiliary value, five colors, genuine local meter copies and static-local overcharge_count=4. Proper owner-header APIs, tag/object macros, named draw flags and explicit return are retained. Evidence-driven corrections preserve ordered auxiliary cutoff equality, the health unordered branch, MAX operand selection, the six genuine fast_ftol_C health calls, and the exact January assertion text. Target is3493 meaningful/3504 padded bytes; candidate3460/3472, both102 relocations, but instruction/register/x87 scheduling remains nonexact. All20 inherited HUD Unit exact functions are preserved and the real renderer caller naturally retains the newly exact private initializer51 meaningful/64 padded bytes. Complete owner census finds no point_from_line3d or COMMON. The authentic existing fast_ftol helper also emits a candidate-only32-byte COMDAT; it receives no HUD Unit exact credit and its selected-owner/coalescing boundary still blocks whole-object admission. No forced inline, manual helper expansion, new renderer assembly, compiler flag change, volatile/register steering, fake lifetime, raw-offset view or nonsensical exactness control was used. Reopen only for new authentic January source/type/compiler-context evidence, not spelling or allocation searches. See docs/object_matching_logs/hud_unit_obj_renderer_independent_review_20260904.md and hud_unit_obj_renderer_integration_20260904.md. This park grants no exact renderer or whole-object completion credit.", - "measurements": { - "target": { - "size": 3504, - "relocation_count": 102, - "normalized_sha256": "b82d575e1154cad1dd27cee874e9af5cc4b86dc302ea41685b56181ba32d93bc" - }, - "base": { - "size": 3472, - "relocation_count": 102, - "normalized_sha256": "4071a4f0c7b1f808423bd5673e822e7f3c6a036e9a3a2db0fe7bd14b413b1817" - }, - "objdiff_percent": 78.98858 - } - }, { "unit": "source/input/input_xbox", "function": "_input_get_device_states", @@ -3420,17 +3401,6 @@ "objdiff_percent": 62.50114 } }, - { - "unit": "source/ai/path", - "function": "_path_state_begin", - "class": "instruction-scheduling", - "evidence": "Best reviewed natural path-search initializer from the 2026-09-09 packet. HCEA independently confirms the start validation, distance quantization and overflow rejection, initial-node setup, closest-node seed, surface-hash insertion, and heap insertion. The candidate retains all 20 target dependency identities but is 608 padded bytes versus January's 592 because VC7 layout and scheduling remain different. Zero exact credit; no compiler steering, fake branch, or raw layout access is retained.", - "measurements": { - "target": { "size": 592, "relocation_count": 20, "normalized_sha256": "039ed79debe1e371d717cdadda825e3d97de89560511aae5ba2e7a919236d357" }, - "base": { "size": 608, "relocation_count": 20, "normalized_sha256": "ad863f4591f7a5699cda9d18300fe73ceab053b88250f4084df32b0aa8eed71a" }, - "objdiff_percent": 93.61539 - } - }, { "unit": "source/ai/path", "function": "_path_state_traverse", @@ -3510,25 +3480,6 @@ "objdiff_percent": 91.88461 } }, - { - "unit": "source/interface/motion_sensor", - "function": "_blip_begin", - "class": "unclassified", - "evidence": "Best reviewed house-rule-compliant natural reconstruction retained from the 2026-09-09 reconciliation. Current canonical target/base COFF measurements remain non-identical; objdiff similarity is diagnostic only. This is a fuzzy research waypoint with zero exact-function and zero exact-byte credit. See docs/object_matching_logs/lane_reconciliation_batch5_fuzzy_ui_world_20260909.md.", - "measurements": { - "target": { - "size": 112, - "relocation_count": 10, - "normalized_sha256": "02831c4d76978889bea0fbdb6c45941bc96272e613d3005cb0d7c7cdd73d0f5e" - }, - "base": { - "size": 112, - "relocation_count": 10, - "normalized_sha256": "6a9a7351f54ec563c0c7be8deed0ac2f8b6bdf40a80f8b97aaa054aba73675e4" - }, - "objdiff_percent": 99.92 - } - }, { "unit": "source/interface/motion_sensor", "function": "_motion_sensor_update", @@ -3571,7 +3522,7 @@ "unit": "source/interface/motion_sensor", "function": "_render_motion_sensor", "class": "unclassified", - "evidence": "Best reviewed house-rule-compliant natural reconstruction retained from the 2026-09-09 reconciliation. Current canonical target/base COFF measurements remain non-identical; objdiff similarity is diagnostic only. This is a fuzzy research waypoint with zero exact-function and zero exact-byte credit. See docs/object_matching_logs/lane_reconciliation_batch5_fuzzy_ui_world_20260909.md.", + "evidence": "Best reviewed house-rule-compliant natural reconstruction retained from the 2026-09-09 reconciliation. Current canonical target/base COFF measurements remain non-identical; objdiff similarity is diagnostic only. This is a fuzzy research waypoint with zero exact-function and zero exact-byte credit. See docs/object_matching_logs/lane_reconciliation_batch5_fuzzy_ui_world_20260909.md. Re-measured 2026-09-16 with the _blip_begin signature fix: the only source change is the extra zero argument January's call pushes (push esi / push eax / push 0 / lea esi / call / add esp,0xc now match), the body is now 784 bytes against January's 768 with 40 relocations (objdiff 92.60 -> 94.25); the pre-existing x87/int interleave and stack-slot swap remain, so it stays parked (non-exact before and after).", "measurements": { "target": { "size": 768, @@ -3579,11 +3530,11 @@ "normalized_sha256": "954bdcc559c91d9e79948d1b28ce0a380e2b7cbe48030891ad5da5620dbf4cff" }, "base": { - "size": 768, + "size": 784, "relocation_count": 40, - "normalized_sha256": "fe7bcd275ed517944e3ed18c3f8f940174e8d6697e8fbaf2b4a3e8c350dd5557" + "normalized_sha256": "de9701add36aae941c423d716aa79a2424877703ac03d1ae582683e955bf397a" }, - "objdiff_percent": 92.604546 + "objdiff_percent": 94.24545 } }, { diff --git a/source/ai/path.c b/source/ai/path.c index f977c1b5..6883dcdb 100644 --- a/source/ai/path.c +++ b/source/ai/path.c @@ -1081,9 +1081,12 @@ static boolean path_state_begin( if (state->destination_valid) { - distance_to_destination = distance3d( + struct path_destination const *destination = &state->destination; + real distance_squared = distance_squared3d( &state->input.start_point, - &state->destination.point); + &destination->point); + + distance_to_destination = square_root(distance_squared); quantized_cost_estimate = (long)(distance_to_destination / PATH_COST_ESTIMATE_GRANULARITY); if (quantized_cost_estimate >= SHORT_MAX) { @@ -1093,14 +1096,16 @@ static boolean path_state_begin( state->input.start_point.x, state->input.start_point.y, state->input.start_point.z, - state->destination.point.x, - state->destination.point.y, - state->destination.point.z, + destination->point.x, + destination->point.y, + destination->point.z, distance_to_destination, SHORT_MAX * PATH_COST_ESTIMATE_GRANULARITY); - return FALSE; } - result = TRUE; + else + { + result = TRUE; + } } else { @@ -1145,9 +1150,9 @@ static boolean path_state_begin( if (state->destination_valid) { state->closest_distance = distance_to_destination; - state->closest_cost_estimate = distance_to_destination; state->closest_node_index = node_index; state->closest_point = state->input.start_point; + state->closest_cost_estimate = distance_to_destination; } state->hash_table[ diff --git a/source/interface/hud_unit.c b/source/interface/hud_unit.c index bc313829..42f5fd8a 100644 --- a/source/interface/hud_unit.c +++ b/source/interface/hud_unit.c @@ -892,10 +892,10 @@ void hud_render_unit_interface( if (player->local_player_index == render.local_player_index && player->unit_index != NONE) { - short local_player_index = player->local_player_index; struct unit_datum *unit = unit_get(player->unit_index); struct unit_definition const *unit_definition = unit_definition_get(unit->definition_index); + short local_player_index = player->local_player_index; long player_index = local_player_get_player_index(local_player_index); struct unit_hud_state *hud_state = get_hud_state(local_player_index); long unit_indices[18] = { player->unit_index }; @@ -911,7 +911,7 @@ void hud_render_unit_interface( real auxilary_values[1]; if (hud_state->last_unit_index == NONE) - initialize_hud_state(get_hud_state(local_player_index)); + initialize_hud_state(get_hud_state(player->local_player_index)); hud_state->last_unit_index = player->unit_index; if (unit->object.parent_object_index != NONE && @@ -977,23 +977,23 @@ void hud_render_unit_interface( while (unit_count) { struct unit_datum *hud_unit; - long unit_hud_index; unit_count--; hud_unit = unit_try_and_get(unit_indices[unit_count]); - unit_hud_index = unit_hud_indices[unit_count]; - if (hud_unit && unit_hud_index != NONE) + if (hud_unit && unit_hud_indices[unit_count] != NONE) { struct unit_hud_interface_definition *hud_definition = - unit_hud_interface_definition_get(unit_hud_index); + unit_hud_interface_definition_get(unit_hud_indices[unit_count]); if (hud_definition->background.interface_bitmap.index != NONE) { - short draw_flags = TEST_FLAG( - hud_unit->object.damage_flags, - _object_dead_bit) ? FLAG(_hud_draw_disabled_bit) : 0; + short draw_flags = 0; + SET_FLAG( + draw_flags, + _hud_draw_disabled_bit, + TEST_FLAG(hud_unit->object.damage_flags, _object_dead_bit)); SET_FLAG( draw_flags, _hud_draw_in_multiplayer_bit, @@ -1042,73 +1042,76 @@ void hud_render_unit_interface( if (hud_definition->shield_meter.meter.meter_bitmap.index != NONE) { real reference_shield_vitality; - short value_scale = hud_definition->shield_meter.meter.value_scale; - struct meter_hud_element_definition overcharge_meter = - hud_definition->shield_meter.meter; - pixel32 color[5] = - { - 0, - 0x00FF0000, - 0x0000FF00, - 0x00FFFF00, - 0x007F00FF, - }; - long overcharge_index; + short value_scale; + struct meter_hud_element_definition overcharge_meter; game_engine_running(); if (unit_count == 0) reference_shield_vitality = hud_state->last_shield_vitality; else reference_shield_vitality = hud_unit->object.shield_vitality; - if (value_scale == 0) - value_scale = UNSIGNED_CHAR_MAX; - - for (overcharge_index = 0; - overcharge_index <= overcharge_count; - overcharge_index++) + value_scale = hud_definition->shield_meter.meter.value_scale ? + hud_definition->shield_meter.meter.value_scale : + UNSIGNED_CHAR_MAX; + overcharge_meter = hud_definition->shield_meter.meter; { - real shield_vitality = PIN( - hud_unit->object.shield_vitality - (real)overcharge_index, - 0.0f, - 1.0f); - real last_shield_vitality = PIN( - reference_shield_vitality - (real)overcharge_index, - 0.0f, - 1.0f); - real maximum_shield_vitality = MAX( - last_shield_vitality, - shield_vitality); - real reference_time = - last_shield_vitality > shield_vitality ? - hud_state->fade_time : -1.0f; - struct meter_hud_element_definition const *meter; - - if (shield_vitality <= 0.0f && - maximum_shield_vitality <= 0.0f) + pixel32 color[5] = { - break; - } + 0, + 0x00FF0000, + 0x0000FF00, + 0x00FFFF00, + 0x007F00FF, + }; + pixel32 *overcharge_color = color; + long overcharge_index; - overcharge_meter.min_color = color[overcharge_index]; - overcharge_meter.max_color = color[overcharge_index]; - meter = overcharge_index == 0 ? - &hud_definition->shield_meter.meter : - &overcharge_meter; - hud_draw_meter( - local_player_index, - &hud_definition->absolute_placement, - meter, - (byte)PIN( - fast_ftol((real)value_scale * shield_vitality), - 0, - UNSIGNED_CHAR_MAX), - (byte)PIN( - fast_ftol((real)value_scale * maximum_shield_vitality), - 0, - UNSIGNED_CHAR_MAX), - draw_flags, - reference_time, - shield_vitality); + for (overcharge_index = 0; + overcharge_index <= overcharge_count; + overcharge_color++, overcharge_index++) + { + boolean first_meter = overcharge_index == 0; + real shield_vitality = PIN( + hud_unit->object.shield_vitality - (real)overcharge_index, + 0.0f, + 1.0f); + real last_shield_vitality = PIN( + reference_shield_vitality - (real)overcharge_index, + 0.0f, + 1.0f); + boolean shield_fading = last_shield_vitality > shield_vitality; + real maximum_shield_vitality = shield_fading ? + last_shield_vitality : + shield_vitality; + real reference_time; + + if (shield_vitality <= 0.0f && + maximum_shield_vitality <= 0.0f) + { + break; + } + + overcharge_meter.min_color = *overcharge_color; + overcharge_meter.max_color = *overcharge_color; + reference_time = shield_fading ? hud_state->fade_time : -1.0f; + hud_draw_meter( + local_player_index, + &hud_definition->absolute_placement, + first_meter ? + &hud_definition->shield_meter.meter : + &overcharge_meter, + (byte)PIN( + fast_ftol((real)value_scale * shield_vitality), + 0, + UNSIGNED_CHAR_MAX), + (byte)PIN( + fast_ftol((real)value_scale * maximum_shield_vitality), + 0, + UNSIGNED_CHAR_MAX), + draw_flags, + reference_time, + shield_vitality); + } } } @@ -1159,27 +1162,28 @@ void hud_render_unit_interface( if (hud_definition->health_meter.meter.meter_bitmap.index != NONE) { - short value_scale = hud_definition->health_meter.meter.value_scale; + short value_scale = hud_definition->health_meter.meter.value_scale ? + hud_definition->health_meter.meter.value_scale : + 8; struct meter_hud_element_definition health_meter = hud_definition->health_meter.meter; - if (value_scale == 0) - value_scale = 8; - if (!(hud_unit->object.body_vitality >= - hud_definition->health_meter.health_extras.max_cutoff)) + if (hud_unit->object.body_vitality >= + hud_definition->health_meter.health_extras.max_cutoff) { - if (hud_unit->object.body_vitality <= - hud_definition->health_meter.health_extras.min_cutoff) - { - health_meter.max_color = health_meter.min_color; - } - else - { - health_meter.max_color = - hud_definition->health_meter.health_extras.mid_color; - } + health_meter.min_color = health_meter.max_color; + } + else if (hud_unit->object.body_vitality <= + hud_definition->health_meter.health_extras.min_cutoff) + { + health_meter.max_color = health_meter.min_color; + } + else + { + health_meter.max_color = + hud_definition->health_meter.health_extras.mid_color; + health_meter.min_color = health_meter.max_color; } - health_meter.min_color = health_meter.max_color; hud_draw_meter( local_player_index, @@ -1279,7 +1283,8 @@ void hud_render_unit_interface( } { - unsigned long overlay_type_flags = game_engine_has_teams() != FALSE; + struct auxilary_panel_definition *auxilary_panel = &hud_definition->auxilary_panel; + word overlay_type_flags = game_engine_has_teams() != FALSE; short draw_flags = 0; short overlay_index; @@ -1288,11 +1293,11 @@ void hud_render_unit_interface( _hud_draw_in_multiplayer_bit, local_player_count() > 1); for (overlay_index = 0; - overlay_index < hud_definition->auxilary_panel.auxilary_overlays.count; + overlay_index < auxilary_panel->auxilary_overlays.count; overlay_index++) { struct auxilary_overlay_definition *overlay = TAG_BLOCK_GET_ELEMENT( - &hud_definition->auxilary_panel.auxilary_overlays, + &auxilary_panel->auxilary_overlays, overlay_index, struct auxilary_overlay_definition); @@ -1310,7 +1315,7 @@ void hud_render_unit_interface( hud_draw_static_element( local_player_index, - &hud_definition->auxilary_panel.absolute_placement, + &auxilary_panel->absolute_placement, &overlay->static_element, draw_flags, NONE); @@ -1345,8 +1350,6 @@ void hud_render_unit_interface( long meter_bitmap_index = verify_tag_reference( &meter->panel.meter.meter_bitmap); short draw_flags = 0; - short *flash_time = - &hud_state->auxilary_flash_time[meter->type]; SET_FLAG( draw_flags, @@ -1357,8 +1360,8 @@ void hud_render_unit_interface( _hud_draw_flashing_bit, auxilary_values[meter->type] <= meter->panel.aux_extras.min_cutoff); - *flash_time += game_time_get_elapsed(); - *flash_time %= 2 * get_flash_duration( + hud_state->auxilary_flash_time[meter->type] += game_time_get_elapsed(); + hud_state->auxilary_flash_time[meter->type] %= 2 * get_flash_duration( &meter->panel.background.colors); if (background_bitmap_index != NONE) @@ -1368,12 +1371,11 @@ void hud_render_unit_interface( &hud_definition->absolute_placement, &meter->panel.background, draw_flags, - game_time_get() - *flash_time); + game_time_get() - hud_state->auxilary_flash_time[meter->type]); } if (meter_bitmap_index != NONE) { - real value = auxilary_values[meter->type]; real value_scale = (real)meter->panel.meter.value_scale; hud_draw_meter( @@ -1381,16 +1383,16 @@ void hud_render_unit_interface( &hud_definition->absolute_placement, &meter->panel.meter, (byte)PIN( - fast_ftol(value_scale * value), + fast_ftol(value_scale * auxilary_values[meter->type]), 0, UNSIGNED_CHAR_MAX), (byte)PIN( - fast_ftol(value_scale * value), + fast_ftol(value_scale * auxilary_values[meter->type]), 0, UNSIGNED_CHAR_MAX), draw_flags, -1.0f, - value); + auxilary_values[meter->type]); } } else if (TEST_FLAG( @@ -1402,15 +1404,17 @@ void hud_render_unit_interface( { long background_bitmap_index = verify_tag_reference( &meter->panel.background.interface_bitmap); - short draw_flags = FLAG(_hud_draw_flashing_bit); - short *flash_time = - &hud_state->auxilary_flash_time[meter->type]; + short draw_flags = 0; SET_FLAG( draw_flags, _hud_draw_in_multiplayer_bit, local_player_count() > 1); - *flash_time += game_time_get_elapsed(); + SET_FLAG( + draw_flags, + _hud_draw_flashing_bit, + TRUE); + hud_state->auxilary_flash_time[meter->type] += game_time_get_elapsed(); if (background_bitmap_index != NONE) { @@ -1419,7 +1423,7 @@ void hud_render_unit_interface( &hud_definition->absolute_placement, &meter->panel.background, draw_flags, - game_time_get() - *flash_time); + game_time_get() - hud_state->auxilary_flash_time[meter->type]); } } else diff --git a/source/interface/motion_sensor.c b/source/interface/motion_sensor.c index 574c348e..7eb7b08a 100644 --- a/source/interface/motion_sensor.c +++ b/source/interface/motion_sensor.c @@ -230,6 +230,7 @@ static boolean should_track_object( long object_index); static void blip_begin( real_point2d const *reference, + long unused, boolean in_multiplayer, short local_player_index); static boolean should_draw_object( @@ -671,7 +672,7 @@ static void render_motion_sensor( hud_globals->defaults.motion_sensor_range; center.x = (real)reference->x; center.y = (real)reference->y; - blip_begin(¢er, in_multiplayer, local_player_index); + blip_begin(¢er, 0, in_multiplayer, local_player_index); for (history_index = 0; history_index < MOTION_SENSOR_HISTORY_COUNT; @@ -990,8 +991,13 @@ static boolean should_track_object( return result; } +/* January's only caller (render_motion_sensor) pushes a zero dword for the + * second parameter and this body never reads it; its original name and + * type are not recoverable (a long 0 and a real 0.0f emit identical bytes). + * The parameter name is provisional and describes that evidence. */ static void blip_begin( real_point2d const *reference, + long unused, boolean in_multiplayer, short local_player_index) { diff --git a/source/objects/widgets/flags.c b/source/objects/widgets/flags.c index cee95d6a..f33168e5 100644 --- a/source/objects/widgets/flags.c +++ b/source/objects/widgets/flags.c @@ -714,7 +714,7 @@ void flag_render_proper( struct flag_vertex_datum *corner10; struct flag_vertex_datum *corner01; struct flag_vertex_datum *corner11; - short vertex_index = 0; + short vertex_index; short i; short x; short y; @@ -726,7 +726,7 @@ void flag_render_proper( one_over_height = 1.0f / (definition->height - 1); csmemset(&vertex, 0, sizeof(vertex)); - for (x = 0; x < definition->width; x++) + for (x = 0, vertex_index = 0; x < definition->width; x++) { for (y = 0; y < definition->height; y++, vertex_index++) { @@ -757,8 +757,7 @@ void flag_render_proper( } } - i = 0; - for (x = 0; x < definition->width - 1; x++) + for (x = 0, i = 0; x < definition->width - 1; x++) { for (y = 0; y < definition->height - 1; y++) {