Files
Cesarus85--ringfall-mjolnir-vr/source/interface/hud_sounds.c
T
Jonas VolmanandClaude Opus 5 3083f800b5 Reopen four parks: detail objects, character draw, hud sound and bink cache
Wave n1 of the next-150K lane (fresh structural portfolio at ae10935da).

- structures _structure_render_detail_objects (+1136): reopened with the natural
  array initializer, which the w2 verifier asked for when it rejected the
  hand-written a[0]=0/memset expansion (R6).
- draw_string _bitmap_draw_character (+944).
- hud_sounds _hud_play_sound (+352): closed by removing the one-use index alias
  and reading sound_indices directly (A5), NOT by the volatile/goto body that the
  park record shows was deliberately replaced.
- bink_playback _bink_free_texture_cache (+96): the park premise was the repo's
  own match_dassert wrapper; the user-supplied Bungie random_math.c spells the
  same two sites vassert, and the tree is 874 match_vassert to 14 match_dassert.
- structures _structure_get_planar_fog: zero-credit remeasure. Adding the
  discarded fog-plane lookup January provably executes (its 15th
  _tag_block_get_element_with_size relocation at +0x16d) closes both structural
  tags; 448/448 and 15/15, residual now one register-naming window.

Rejected by the verifiers and not landed: _bink_alloc@4 (exact only with an __asm
block in a pool allocator - house rule 10 allows asm only for evidenced
helper/math routines), the progress_bar _code_000d16d0 rename (standing hold),
and the _portal_hull_from_points remeasure. wind _wind_variance_get is HELD for an
owner ruling (see its ledger).

Full ninja, parks 274 active / 0 stale / 0 invalid, stable diff vs
scratch/opus5-next150-before.json: gained 4 / 2,528 padded, regressions 0; fake
scan 0 leads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 21:43:58 -07:00

117 lines
2.7 KiB
C

/*
HUD_SOUNDS.C
symbols in this file:
000C6430 0160:
_hud_play_sound (0000)
00270240 0026:
??_C@_0CG@LACJPAPB@c?3?2halo?2SOURCE?2interface?2hud_sou@ (0000)
*/
/* ---------- headers */
#include "cseries.h"
#include "interface/hud.h"
#include "objects/objects.h"
#include "sound/sound_definitions.h"
#include "sound/game_sound.h"
#include "sound/sound_manager.h"
#include "tag_files/tag_groups.h"
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
struct hud_sound_definition
{
struct tag_reference sound;
unsigned long state_flags;
real scale;
/* Reserved by the tag format; the original block accessor proves the 0x38-byte element size. */
byte reserved[32];
};
/* ---------- prototypes */
/* ---------- globals */
/* ---------- public code */
void hud_play_sound(
short local_player_index,
unsigned long state_flags,
struct tag_block const *sounds,
long *sound_indices,
word *played_flags)
{
long absolute_sound_index = 0;
short sound_index = 0;
if (sounds->count > 0)
do
{
struct hud_sound_definition const *sound =
TAG_BLOCK_GET_ELEMENT(sounds, absolute_sound_index, struct hud_sound_definition);
if (state_flags & sound->state_flags)
{
switch (sound->sound.group_tag)
{
default:
match_assert("c:\\halo\\SOURCE\\interface\\hud_sounds.c", 47, !"unreachable");
break;
case SOUND_DEFINITION_TAG:
if (sound_indices[absolute_sound_index] == NONE ||
!TEST_FLAG(*played_flags, absolute_sound_index))
{
if (sound_indices[absolute_sound_index] != NONE)
sound_stop_impulse(sound_indices[absolute_sound_index]);
sound_indices[absolute_sound_index] =
unspatialized_impulse_sound_new(sound->sound.index, sound->scale);
}
break;
case LOOPING_SOUND_DEFINITION_TAG:
if (sound_indices[absolute_sound_index] == NONE)
sound_indices[absolute_sound_index] =
unattached_looping_sound_start(sound->sound.index, NONE, sound->scale);
break;
}
SET_FLAG(*played_flags, absolute_sound_index, TRUE);
}
else
{
if (sound_indices[absolute_sound_index] != NONE)
{
switch (sound->sound.group_tag)
{
default:
match_assert("c:\\halo\\SOURCE\\interface\\hud_sounds.c", 64, !"unreachable");
break;
case SOUND_DEFINITION_TAG:
break;
case LOOPING_SOUND_DEFINITION_TAG:
unattached_looping_sound_stop(sound_indices[absolute_sound_index]);
break;
}
sound_indices[absolute_sound_index] = NONE;
SET_FLAG(*played_flags, absolute_sound_index, FALSE);
}
}
sound_index++;
absolute_sound_index = sound_index;
}
while (absolute_sound_index < sounds->count);
return;
}
/* ---------- private code */