mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
so many bombable walls
This commit is contained in:
parent
49c562c158
commit
b019414e7e
2 changed files with 9 additions and 7 deletions
|
@ -696,6 +696,11 @@ void ActorAccessibility_InitActors() {
|
|||
ActorAccessibility_InitPolicy(&policy, "Boulder", NA_SE_EV_ROCK_BROKEN);
|
||||
ActorAccessibility_AddSupportedActor(ACTOR_OBJ_BOMBIWA, 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_AddSupportedActor(ACTOR_OBJ_HAMISHI, policy);
|
||||
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_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) {
|
||||
if (actor->actor->params == 1) {
|
||||
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EN_NUTS_FAINT, false);
|
||||
|
|
|
@ -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.
|
||||
if (framesRead < nextChunk)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ void AccessibleAudioEngine::runThread() {
|
|||
}
|
||||
|
||||
SoundSlot* AccessibleAudioEngine::findSound(SoundAction& action) {
|
||||
if (action.slot < 0 || action.slot >= AAE_SLOTS_PER_HANDLE)
|
||||
if (action.slot >= AAE_SLOTS_PER_HANDLE)
|
||||
return NULL;
|
||||
auto i = sounds.find(action.handle);
|
||||
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);
|
||||
// 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;
|
||||
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]);
|
||||
if (scalar > 1.0) {
|
||||
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;
|
||||
}
|
||||
// Chunk is ready to go out via the game's usual channels
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue