so many bombable walls

This commit is contained in:
Demur Rumed 2025-06-03 03:39:33 +00:00
commit b019414e7e
2 changed files with 9 additions and 7 deletions

View file

@ -696,6 +696,11 @@ void ActorAccessibility_InitActors() {
ActorAccessibility_InitPolicy(&policy, "Boulder", NA_SE_EV_ROCK_BROKEN); ActorAccessibility_InitPolicy(&policy, "Boulder", NA_SE_EV_ROCK_BROKEN);
ActorAccessibility_AddSupportedActor(ACTOR_OBJ_BOMBIWA, policy); ActorAccessibility_AddSupportedActor(ACTOR_OBJ_BOMBIWA, policy);
ActorAccessibility_AddSupportedActor(ACTOR_BG_HIDAN_KOWARERUKABE, policy); ActorAccessibility_AddSupportedActor(ACTOR_BG_HIDAN_KOWARERUKABE, policy);
ActorAccessibility_AddSupportedActor(ACTOR_BG_MIZU_BWALL, policy);
ActorAccessibility_AddSupportedActor(ACTOR_BG_JYA_BOMBIWA, policy);
ActorAccessibility_AddSupportedActor(ACTOR_BG_BOMBWALL, policy);
ActorAccessibility_AddSupportedActor(ACTOR_BG_BREAKWALL, policy);
ActorAccessibility_AddSupportedActor(ACTOR_BG_SPOT17_BAKUDANKABE, policy);
ActorAccessibility_InitPolicy(&policy, "Bronze Boulder", NA_SE_IT_HAMMER_HIT); ActorAccessibility_InitPolicy(&policy, "Bronze Boulder", NA_SE_IT_HAMMER_HIT);
ActorAccessibility_AddSupportedActor(ACTOR_OBJ_HAMISHI, policy); ActorAccessibility_AddSupportedActor(ACTOR_OBJ_HAMISHI, policy);
ActorAccessibility_InitPolicy(&policy, "Time Block", NA_SE_EV_TIMETRIP_LIGHT); ActorAccessibility_InitPolicy(&policy, "Time Block", NA_SE_EV_TIMETRIP_LIGHT);
@ -835,9 +840,6 @@ void ActorAccessibility_InitActors() {
} }
}); });
ActorAccessibility_AddSupportedActor(ACTOR_BG_YDAN_MARUTA, policy); ActorAccessibility_AddSupportedActor(ACTOR_BG_YDAN_MARUTA, policy);
ActorAccessibility_InitPolicy(&policy, "bombable wall", NA_SE_EN_OCTAROCK_ROCK);
ActorAccessibility_AddSupportedActor(ACTOR_BG_BREAKWALL, policy);
ActorAccessibility_AddSupportedActor(ACTOR_BG_BOMBWALL, policy);
ActorAccessibility_InitPolicy(&policy, "231 dekus", [](AccessibleActor* actor) { ActorAccessibility_InitPolicy(&policy, "231 dekus", [](AccessibleActor* actor) {
if (actor->actor->params == 1) { if (actor->actor->params == 1) {
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EN_NUTS_FAINT, false); ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EN_NUTS_FAINT, false);

View file

@ -153,7 +153,7 @@ void AccessibleAudioEngine::doPrepare(SoundAction& action) {
// Even if we get fewer frames than expected, we should still submit a full buffer of silence. // Even if we get fewer frames than expected, we should still submit a full buffer of silence.
if (framesRead < nextChunk) if (framesRead < nextChunk)
ma_silence_pcm_frames(chunk + (framesRead * 2), (nextChunk - framesRead), ma_format_f32, 2); ma_silence_pcm_frames(chunk + (framesRead * 2), (nextChunk - framesRead), ma_format_f32, 2);
ma_pcm_rb_commit_write(&preparedOutput, (uint32_t)nextChunk); ma_pcm_rb_commit_write(&preparedOutput, nextChunk);
nFrames -= nextChunk; nFrames -= nextChunk;
} }
} }
@ -243,7 +243,7 @@ void AccessibleAudioEngine::runThread() {
} }
SoundSlot* AccessibleAudioEngine::findSound(SoundAction& action) { SoundSlot* AccessibleAudioEngine::findSound(SoundAction& action) {
if (action.slot < 0 || action.slot >= AAE_SLOTS_PER_HANDLE) if (action.slot >= AAE_SLOTS_PER_HANDLE)
return NULL; return NULL;
auto i = sounds.find(action.handle); auto i = sounds.find(action.handle);
if (i == sounds.end()) if (i == sounds.end())
@ -475,11 +475,11 @@ void AccessibleAudioEngine::mix(int16_t* ogBuffer, uint32_t nFrames) {
ma_mix_pcm_frames_f32(mixedChunk, sourceChunk, nextChunk, AAE_CHANNELS, 1.0); ma_mix_pcm_frames_f32(mixedChunk, sourceChunk, nextChunk, AAE_CHANNELS, 1.0);
// If we've gone over 1.0, we'll need to scale back before we go back to 16-bit or we'll distort. // If we've gone over 1.0, we'll need to scale back before we go back to 16-bit or we'll distort.
float scalar = 1.0; float scalar = 1.0;
for (int i = 0; i < nextChunk * AAE_CHANNELS; i++) for (uint32_t i = 0; i < nextChunk * AAE_CHANNELS; i++)
scalar = std::max(scalar, mixedChunk[i]); scalar = std::max(scalar, mixedChunk[i]);
if (scalar > 1.0) { if (scalar > 1.0) {
scalar = 1.0 / scalar; scalar = 1.0 / scalar;
for (int i = 0; i < nextChunk * AAE_CHANNELS; i++) for (uint32_t i = 0; i < nextChunk * AAE_CHANNELS; i++)
mixedChunk[i] *= scalar; mixedChunk[i] *= scalar;
} }
// Chunk is ready to go out via the game's usual channels // Chunk is ready to go out via the game's usual channels