cleanup aisle jabu

This commit is contained in:
Demur Rumed 2025-04-21 18:36:24 +00:00
parent 8a5e118ab7
commit 925bc540b4
3 changed files with 70 additions and 83 deletions

View file

@ -5,35 +5,26 @@
#include <random> #include <random>
#include <functions.h> #include <functions.h>
#include <overlays/actors/ovl_Obj_Switch/z_obj_switch.h>
#include <macros.h> #include <macros.h>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include <float.h> #include <float.h>
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
std::vector<uint32_t> buttonList = { BTN_A, BTN_B, BTN_CUP, BTN_CDOWN, BTN_CLEFT, BTN_CRIGHT, BTN_L,
BTN_Z, BTN_R, BTN_START, BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT };
// Declarations specific to chests.
#include "overlays/actors/ovl_En_Box/z_en_box.h"
extern "C" { extern "C" {
#include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h"
#include "overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h"
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
#include "overlays/actors/ovl_En_Karebaba/z_en_karebaba.h"
#include "overlays/actors/ovl_En_Box/z_en_box.h"
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
#include "overlays/actors/ovl_En_Dog/z_en_dog.h"
void EnBox_WaitOpen(EnBox*, PlayState*); void EnBox_WaitOpen(EnBox*, PlayState*);
}
// Declarations specific to Babas.
#include "overlays/actors/ovl_En_Karebaba/z_en_karebaba.h"
extern "C" {
void EnKarebaba_DeadItemDrop(EnKarebaba*, PlayState*); void EnKarebaba_DeadItemDrop(EnKarebaba*, PlayState*);
}
// Declarations specific to Torches
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
// Declarations specific to dogs
#include "overlays/actors/ovl_En_Dog/z_en_dog.h"
extern "C" {
void EnDog_FollowPlayer(EnDog*, PlayState*); void EnDog_FollowPlayer(EnDog*, PlayState*);
s8 EnDog_CanFollow(EnDog*, PlayState*); s8 EnDog_CanFollow(EnDog*, PlayState*);
} }
// User data for the general helper VA. // User data for the general helper VA.
typedef struct { typedef struct {
s16 currentScene; s16 currentScene;
@ -240,14 +231,17 @@ void accessible_larva(AccessibleActor* actor) {
} }
} }
void accessible_eiyer(AccessibleActor* actor) {
if (GET_PLAYER(actor->play)->actor.world.pos.y > actor->actor->world.pos.y - 8) {
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_IT_FISHING_REEL_SLOW, false);
} else {
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_IT_FISHING_REEL_HIGH, false);
}
}
void accessible_door(AccessibleActor* actor) { void accessible_door(AccessibleActor* actor) {
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_OC_DOOR_OPEN, false); ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_OC_DOOR_OPEN, false);
} }
void accessible_va_prototype(AccessibleActor* actor) {
Player* player = GET_PLAYER(actor->play);
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_IT_BOMB_EXPLOSION, false);
}
void accessible_maruta(AccessibleActor* actor) { void accessible_maruta(AccessibleActor* actor) {
if (actor->actor->params == 1) { if (actor->actor->params == 1) {
@ -551,6 +545,13 @@ void accessible_sticks(AccessibleActor* actor) {
} }
} }
void accessible_jabu_switch(AccessibleActor* actor) {
int type = actor->actor->params & 0xFF;
if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) {
actor->policy.aimAssist.isProvider = true;
}
}
void accessible_jabu_elevator(AccessibleActor* actor) { void accessible_jabu_elevator(AccessibleActor* actor) {
if ((actor->actor->params & 0xFF) == 2 && actor->xzDistToPlayer > 50) { if ((actor->actor->params & 0xFF) == 2 && actor->xzDistToPlayer > 50) {
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_PL_LAND_LADDER, false); ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_PL_LAND_LADDER, false);
@ -627,8 +628,8 @@ void accessible_audio_compass(AccessibleActor* actor) {
OSContPad* trackerButtonsPressed = OSContPad* trackerButtonsPressed =
std::dynamic_pointer_cast<LUS::ControlDeck>(Ship::Context::GetInstance()->GetControlDeck())->GetPads(); std::dynamic_pointer_cast<LUS::ControlDeck>(Ship::Context::GetInstance()->GetControlDeck())->GetPads();
AudioCompassData* data = (AudioCompassData*)actor->userData; AudioCompassData* data = (AudioCompassData*)actor->userData;
bool compassCombo = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & buttonList[11] && bool compassCombo = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & BTN_DDOWN &&
trackerButtonsPressed[0].button & buttonList[6]; trackerButtonsPressed[0].button & BTN_L;
actor->world.pos = player->actor.world.pos; actor->world.pos = player->actor.world.pos;
actor->world.pos.z -= 50; actor->world.pos.z -= 50;
@ -786,7 +787,7 @@ void ActorAccessibility_InitActors() {
ActorAccessibility_InitPolicy(&policy, "Ruto", NULL, NA_SE_VO_RT_LAUGH_0); ActorAccessibility_InitPolicy(&policy, "Ruto", NULL, NA_SE_VO_RT_LAUGH_0);
policy.n = 40; policy.n = 40;
policy.pitch = 0.7; policy.pitch = 1.1;
ActorAccessibility_AddSupportedActor(ACTOR_EN_RU1, policy); ActorAccessibility_AddSupportedActor(ACTOR_EN_RU1, policy);
ActorAccessibility_InitPolicy(&policy, "Bean patch", NULL, NA_SE_EN_MUSI_SINK); ActorAccessibility_InitPolicy(&policy, "Bean patch", NULL, NA_SE_EN_MUSI_SINK);
@ -835,7 +836,7 @@ void ActorAccessibility_InitActors() {
ActorAccessibility_AddSupportedActor(ACTOR_OBJ_SWITCH, policy); ActorAccessibility_AddSupportedActor(ACTOR_OBJ_SWITCH, policy);
ActorAccessibility_InitPolicy(&policy, "Jabu Switch", NULL, NA_SE_EV_DIAMOND_SWITCH); ActorAccessibility_InitPolicy(&policy, "Jabu Switch", NULL, NA_SE_EV_DIAMOND_SWITCH);
policy.volume = 0.6; policy.volume = 0.6;
policy.distance = 2000; policy.distance = 1000;
policy.ydist = 300; policy.ydist = 300;
ActorAccessibility_AddSupportedActor(ACTOR_BG_BDAN_SWITCH, policy); ActorAccessibility_AddSupportedActor(ACTOR_BG_BDAN_SWITCH, policy);
ActorAccessibility_InitPolicy(&policy, "Jabu Elevator", accessible_jabu_elevator, 0); ActorAccessibility_InitPolicy(&policy, "Jabu Elevator", accessible_jabu_elevator, 0);
@ -897,6 +898,14 @@ void ActorAccessibility_InitActors() {
ActorAccessibility_AddSupportedActor(ACTOR_EN_GOMA, policy); ActorAccessibility_AddSupportedActor(ACTOR_EN_GOMA, policy);
ActorAccessibility_InitPolicy(&policy, "small jellyfish", NULL, NA_SE_EN_BIRI_FLY); ActorAccessibility_InitPolicy(&policy, "small jellyfish", NULL, NA_SE_EN_BIRI_FLY);
ActorAccessibility_AddSupportedActor(ACTOR_EN_BILI, policy); ActorAccessibility_AddSupportedActor(ACTOR_EN_BILI, policy);
ActorAccessibility_InitPolicy(&policy, "stinger", accessible_eiyer, 0);
policy.n = 1;
policy.distance = 1000;
policy.ydist = 200;
ActorAccessibility_AddSupportedActor(ACTOR_EN_EIYER, policy);
ActorAccessibility_InitPolicy(&policy, "bubble", NULL, NA_SE_EN_DAIOCTA_SPLASH);
policy.ydist = 200;
ActorAccessibility_AddSupportedActor(ACTOR_EN_BUBBLE, policy);
ActorAccessibility_InitPolicy(&policy, "tentacle obstacle", NULL, NA_SE_EN_BALINADE_THUNDER); ActorAccessibility_InitPolicy(&policy, "tentacle obstacle", NULL, NA_SE_EN_BALINADE_THUNDER);
policy.distance = 100; policy.distance = 100;
ActorAccessibility_AddSupportedActor(ACTOR_EN_BX, policy); ActorAccessibility_AddSupportedActor(ACTOR_EN_BX, policy);
@ -1000,9 +1009,12 @@ void ActorAccessibility_InitActors() {
ActorAccessibility_AddVirtualActor(list, VA_MARKER, { { -1958, 20, -1297 } }); ActorAccessibility_AddVirtualActor(list, VA_MARKER, { { -1958, 20, -1297 } });
list = ActorAccessibility_GetVirtualActorList(SCENE_JABU_JABU, 2); list = ActorAccessibility_GetVirtualActorList(SCENE_JABU_JABU, 2);
AccessibleActor* temp = ActorAccessibility_AddVirtualActor(list, VA_MARKER, { { -260, -445, -3377 } }); // green tentacle hole AccessibleActor* temp = ActorAccessibility_AddVirtualActor(list, VA_MARKER, { { -260, -400, -3377 } }); // green tentacle hole
temp->policy.distance = 100; temp->policy.distance = 200;
temp->policy.sound = NA_SE_EN_OCTAROCK_BUBLE; temp->policy.sound = NA_SE_EN_DAIOCTA_DEAD;
temp = ActorAccessibility_AddVirtualActor(list, VA_MARKER, { { 230, -400, -3211 } }); // ruto hole
temp->policy.distance = 200;
temp->policy.sound = NA_SE_VO_RT_FALL;
list = ActorAccessibility_GetVirtualActorList(SCENE_CASTLE_COURTYARD_GUARDS_DAY, 0); // hyrule courtyard list = ActorAccessibility_GetVirtualActorList(SCENE_CASTLE_COURTYARD_GUARDS_DAY, 0); // hyrule courtyard
ActorAccessibility_AddVirtualActor(list, VA_MARKER, { { 1734.0, 0.0, 140.514 } }); ActorAccessibility_AddVirtualActor(list, VA_MARKER, { { 1734.0, 0.0, 140.514 } });

View file

@ -20,9 +20,6 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/audio/AudioDecoder.h" #include "soh/Enhancements/audio/AudioDecoder.h"
std::vector<uint32_t> buttons = { BTN_A, BTN_B, BTN_CUP, BTN_CDOWN, BTN_CLEFT, BTN_CRIGHT, BTN_L,
BTN_Z, BTN_R, BTN_START, BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT };
extern "C" { extern "C" {
extern PlayState* gPlayState; extern PlayState* gPlayState;
extern bool freezeGame; extern bool freezeGame;
@ -102,9 +99,7 @@ class ActorAccessibility {
static ActorAccessibility* aa; static ActorAccessibility* aa;
uint64_t ActorAccessibility_GetNextID() { uint64_t ActorAccessibility_GetNextID() {
uint64_t result = aa->nextActorID; return aa->nextActorID++;
aa->nextActorID++;
return result;
} }
// Hooks for game-interactor. // Hooks for game-interactor.
@ -128,8 +123,8 @@ void ActorAccessibility_OnGameStillFrozen() {
if (aa->extractSfx) if (aa->extractSfx)
ActorAccessibility_HandleSoundExtractionMode(gPlayState); ActorAccessibility_HandleSoundExtractionMode(gPlayState);
} }
void ActorAccessibility_Init() {
void ActorAccessibility_Init() {
aa = new ActorAccessibility(); aa = new ActorAccessibility();
aa->glossary = new AudioGlossaryData(); aa->glossary = new AudioGlossaryData();
aa->isOn = CVarGetInteger(CVAR_SETTING("A11yAudioInteraction"), 0); aa->isOn = CVarGetInteger(CVAR_SETTING("A11yAudioInteraction"), 0);
@ -342,18 +337,14 @@ void ActorAccessibility_StopAllVirtualActors(VirtualActorList* list) {
ActorAccessibility_StopAllSounds((void*)&(*i)); ActorAccessibility_StopAllSounds((void*)&(*i));
} }
void ActorAccessibility_RunAccessibilityForActor(PlayState* play, AccessibleActor* actor) { void ActorAccessibility_RunAccessibilityForActor(PlayState* play, AccessibleActor* actor) {
Player* player = GET_PLAYER(play);
actor->play = play; actor->play = play;
if (ActorAccessibility_IsRealActor(actor)) if (ActorAccessibility_IsRealActor(actor)) {
ActorAccessibility_CopyParamsFromRealActor(actor); ActorAccessibility_CopyParamsFromRealActor(actor);
} else {
else { Player* player = GET_PLAYER(play);
// Perform calculations that the game would normally take care of for real actors.
f32 w = 0.0f; f32 w = 0.0f;
// Set actor->projectedPos. // Set actor->projectedPos.
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &actor->world.pos, &actor->projectedPos, &w); SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &actor->world.pos, &actor->projectedPos, &w);
// Set actor->xzDistToPlayer.
actor->xzDistToPlayer = Math_Vec3f_DistXZ(&actor->world.pos, &player->actor.world.pos); actor->xzDistToPlayer = Math_Vec3f_DistXZ(&actor->world.pos, &player->actor.world.pos);
actor->xyzDistToPlayer = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos); actor->xyzDistToPlayer = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos);
actor->yDistToPlayer = fabs((actor->world.pos.y) - (player->actor.world.pos.y)); actor->yDistToPlayer = fabs((actor->world.pos.y) - (player->actor.world.pos.y));
@ -375,14 +366,15 @@ void ActorAccessibility_RunAccessibilityForActor(PlayState* play, AccessibleActo
if (aa->glossary->GlossaryStarted) { if (aa->glossary->GlossaryStarted) {
aa->glossary->frameCount++; aa->glossary->frameCount++;
} }
if (actor->frameCount != 1 && (actor->frameCount - 1) % actor->policy.n != 0) if (actor->frameCount % actor->policy.n)
return; return;
if (!actor->policy.runsAlways && actor->xyzDistToPlayer > actor->policy.distance) { if (!actor->policy.runsAlways && actor->xyzDistToPlayer > actor->policy.distance) {
return; return;
} }
if (actor->isDrawn == 0 && actor->actor->id != 406 && actor->actor->id != 302 && !aa->glossary->GlossaryStarted) if (actor->isDrawn == 0 && actor->actor->id != ACTOR_EN_IT && actor->actor->id != ACTOR_EN_OKARINA_TAG && !aa->glossary->GlossaryStarted)
return; return;
if (actor->policy.aimAssist.isProvider) { if (actor->policy.aimAssist.isProvider) {
Player* player = GET_PLAYER(play);
if (player->stateFlags1 & PLAYER_STATE1_FIRST_PERSON && if (player->stateFlags1 & PLAYER_STATE1_FIRST_PERSON &&
(player->stateFlags1 & PLAYER_STATE1_USING_BOOMERANG || player->stateFlags1 & PLAYER_STATE1_ITEM_IN_HAND)) { (player->stateFlags1 & PLAYER_STATE1_USING_BOOMERANG || player->stateFlags1 & PLAYER_STATE1_ITEM_IN_HAND)) {
ActorAccessibility_SetSoundPitch(actor, 9, actor->aimAssist.pitch); ActorAccessibility_SetSoundPitch(actor, 9, actor->aimAssist.pitch);
@ -395,9 +387,10 @@ void ActorAccessibility_RunAccessibilityForActor(PlayState* play, AccessibleActo
actor->aimAssist.framesSinceAimAssist = 0; actor->aimAssist.framesSinceAimAssist = 0;
ActorAccessibility_PlaySoundForActor(actor, 9, actor->policy.aimAssist.sfx, false); ActorAccessibility_PlaySoundForActor(actor, 9, actor->policy.aimAssist.sfx, false);
} }
} else } else {
actor->aimAssist.framesSinceAimAssist = // Make sure there's no delay the next time you draw your bow or whatever.
32768; // Make sure there's no delay the next time you draw your bow or whatever. actor->aimAssist.framesSinceAimAssist = 32768;
}
} }
if (actor->policy.callback != NULL) if (actor->policy.callback != NULL)
@ -406,7 +399,6 @@ void ActorAccessibility_RunAccessibilityForActor(PlayState* play, AccessibleActo
ActorAccessibility_PlaySoundForActor(actor, 0, actor->policy.sound, false); ActorAccessibility_PlaySoundForActor(actor, 0, actor->policy.sound, false);
} }
void ActorAccessibility_RunAccessibilityForAllActors(PlayState* play) { void ActorAccessibility_RunAccessibilityForAllActors(PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (play->sceneNum != aa->currentScene) { if (play->sceneNum != aa->currentScene) {
ActorAccessibility_StopAllVirtualActors(aa->currentEverywhere); ActorAccessibility_StopAllVirtualActors(aa->currentEverywhere);
@ -461,9 +453,7 @@ void ActorAccessibility_RunAccessibilityForAllActors(PlayState* play) {
} }
void ActorAccessibility_AudioGlossary(PlayState* play) { void ActorAccessibility_AudioGlossary(PlayState* play) {
if (aa->glossary->GlossaryStarted) { if (aa->glossary->GlossaryStarted) {
freezeActors = true; freezeActors = true;
AccessibleActor glossaryActor = (*aa->glossary->current).second; AccessibleActor glossaryActor = (*aa->glossary->current).second;
ActorAccessibility_CopyParamsFromRealActor(&glossaryActor); ActorAccessibility_CopyParamsFromRealActor(&glossaryActor);
@ -479,8 +469,8 @@ void ActorAccessibility_AudioGlossary(PlayState* play) {
OSContPad* trackerButtonsPressed = OSContPad* trackerButtonsPressed =
std::dynamic_pointer_cast<LUS::ControlDeck>(Ship::Context::GetInstance()->GetControlDeck())->GetPads(); std::dynamic_pointer_cast<LUS::ControlDeck>(Ship::Context::GetInstance()->GetControlDeck())->GetPads();
bool comboStartGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & buttons[10] && bool comboStartGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & BTN_DUP &&
trackerButtonsPressed[0].button & buttons[6]; trackerButtonsPressed[0].button & BTN_L;
if (comboStartGlossary) { if (comboStartGlossary) {
aa->glossary->GlossaryStarted = true; aa->glossary->GlossaryStarted = true;
aa->glossary->current = aa->accessibleActorList.begin(); aa->glossary->current = aa->accessibleActorList.begin();
@ -489,8 +479,8 @@ void ActorAccessibility_AudioGlossary(PlayState* play) {
SpeechSynthesizer::Instance->Speak((*aa->glossary->current).second.policy.englishName, GetLanguageCode()); SpeechSynthesizer::Instance->Speak((*aa->glossary->current).second.policy.englishName, GetLanguageCode());
return; return;
} }
bool comboNextGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & buttons[13] && bool comboNextGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & BTN_DRIGHT &&
trackerButtonsPressed[0].button & buttons[6]; trackerButtonsPressed[0].button & BTN_L;
if (comboNextGlossary && aa->glossary->GlossaryStarted) { if (comboNextGlossary && aa->glossary->GlossaryStarted) {
aa->glossary->current++; aa->glossary->current++;
if (aa->glossary->current == aa->accessibleActorList.end()) { if (aa->glossary->current == aa->accessibleActorList.end()) {
@ -499,8 +489,8 @@ void ActorAccessibility_AudioGlossary(PlayState* play) {
aa->glossary->cooldown = 5; aa->glossary->cooldown = 5;
SpeechSynthesizer::Instance->Speak((*aa->glossary->current).second.policy.englishName, GetLanguageCode()); SpeechSynthesizer::Instance->Speak((*aa->glossary->current).second.policy.englishName, GetLanguageCode());
} }
bool comboPrevGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & buttons[12] && bool comboPrevGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & BTN_DLEFT &&
trackerButtonsPressed[0].button & buttons[6]; trackerButtonsPressed[0].button & BTN_L;
if (comboPrevGlossary && aa->glossary->GlossaryStarted) { if (comboPrevGlossary && aa->glossary->GlossaryStarted) {
if (aa->glossary->current != aa->accessibleActorList.begin()) { if (aa->glossary->current != aa->accessibleActorList.begin()) {
aa->glossary->current--; aa->glossary->current--;
@ -509,8 +499,8 @@ void ActorAccessibility_AudioGlossary(PlayState* play) {
SpeechSynthesizer::Instance->Speak((*aa->glossary->current).second.policy.englishName, GetLanguageCode()); SpeechSynthesizer::Instance->Speak((*aa->glossary->current).second.policy.englishName, GetLanguageCode());
} }
bool comboDisableGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & buttons[11] && bool comboDisableGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & BTN_DDOWN &&
trackerButtonsPressed[0].button & buttons[6]; trackerButtonsPressed[0].button & BTN_L;
if (comboDisableGlossary) { if (comboDisableGlossary) {
aa->glossary->cooldown = 0; aa->glossary->cooldown = 0;
aa->glossary->GlossaryStarted = false; aa->glossary->GlossaryStarted = false;
@ -626,7 +616,6 @@ void ActorAccessibility_AnnounceRoomNumber(PlayState* play) {
// Aim cue support. // Aim cue support.
void ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* actor) { void ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* actor) {
Player* player = GET_PLAYER(actor->play); Player* player = GET_PLAYER(actor->play);
// 16384
s32 angle = player->actor.focus.rot.x; s32 angle = player->actor.focus.rot.x;
angle = angle / -14000.0 * 16384; angle = angle / -14000.0 * 16384;
f32 slope = Math_SinS(angle) / Math_CosS(angle) * 1.0; f32 slope = Math_SinS(angle) / Math_CosS(angle) * 1.0;
@ -666,15 +655,15 @@ bool ActorAccessibility_InitAudio() {
return true; return true;
} }
void ActorAccessibility_ShutdownAudio() { void ActorAccessibility_ShutdownAudio() {
if (aa->isOn == 0) if (aa->isOn) {
return; delete aa->audioEngine;
delete aa->audioEngine; aa->isOn = 0;
}
} }
void ActorAccessibility_MixAccessibleAudioWithGameAudio(int16_t* ogBuffer, uint32_t nFrames) { void ActorAccessibility_MixAccessibleAudioWithGameAudio(int16_t* ogBuffer, uint32_t nFrames) {
if (aa->isOn == 0) if (aa->isOn) {
return; aa->audioEngine->mix(ogBuffer, nFrames);
}
aa->audioEngine->mix(ogBuffer, nFrames);
} }
// Map one of the game's sfx to a path which as understood by the external audio engine. The returned token is a // Map one of the game's sfx to a path which as understood by the external audio engine. The returned token is a
// short hex string that can be passed directly to the audio engine. // short hex string that can be passed directly to the audio engine.

View file

@ -115,12 +115,6 @@ class Incline : protected TerrainCueSound {
return; return;
} }
ActorAccessibility_SetSoundPitch(this, 0, 0.5 + (1 - pitchModifier)); ActorAccessibility_SetSoundPitch(this, 0, 0.5 + (1 - pitchModifier));
/*currentPitch += 0.1;
if (currentPitch >= 2.0) {
stop();
currentPitch = 0.5;
restFrames = 5;
}*/
} }
void setPitchModifier(float modifier) { void setPitchModifier(float modifier) {
pitchModifier = modifier; pitchModifier = modifier;
@ -1251,8 +1245,7 @@ class TerrainCueDirection {
} }
if (pos.y < prevPos.y && fabs(pos.y - prevPos.y) < 20 && fabs(pos.y - prevPos.y) > 1.2 && if (pos.y < prevPos.y && fabs(pos.y - prevPos.y) < 20 && fabs(pos.y - prevPos.y) > 1.2 &&
player->stateFlags1 != PLAYER_STATE1_CLIMBING_LADDER) { player->stateFlags1 != PLAYER_STATE1_CLIMBING_LADDER) {
// This is a decline. // This is a decline. discover top
// discorver top
Vec3f_ top = pos; Vec3f_ top = pos;
while ((pos.y < prevPos.y && fabs(pos.y - prevPos.y) < 20 && fabs(pos.y - prevPos.y) > 1.2 && while ((pos.y < prevPos.y && fabs(pos.y - prevPos.y) < 20 && fabs(pos.y - prevPos.y) > 1.2 &&
@ -1398,9 +1391,6 @@ void accessible_va_terrain_cue(AccessibleActor* actor) {
Player* player = GET_PLAYER(actor->play); Player* player = GET_PLAYER(actor->play);
if (state->previousAction != currentState) { if (state->previousAction != currentState) {
// Audio_PlaySoundGeneral(NA_SE_EV_DIAMOND_SWITCH, &player->actor.world.pos, 4, &actor->basePitch,
// &actor->baseVolume,
// &actor->currentReverb);
switch (currentState) { switch (currentState) {
case DO_ACTION_CHECK: case DO_ACTION_CHECK:
SpeechSynthesizer::Instance->Speak("Check", GetLanguageCode()); SpeechSynthesizer::Instance->Speak("Check", GetLanguageCode());
@ -1421,11 +1411,7 @@ void accessible_va_terrain_cue(AccessibleActor* actor) {
SpeechSynthesizer::Instance->Speak("Speak", GetLanguageCode()); SpeechSynthesizer::Instance->Speak("Speak", GetLanguageCode());
break; break;
case DO_ACTION_STOP: case DO_ACTION_STOP:
SpeechSynthesizer::Instance->Speak("Stop", SpeechSynthesizer::Instance->Speak("Stop", GetLanguageCode());
GetLanguageCode()); // possibly disable? not sure what it does
break;
default:
SpeechSynthesizer::Instance->Speak(" ", GetLanguageCode());
break; break;
} }