This commit is contained in:
Attila Uygun 2023-07-13 10:56:33 +02:00
parent 38813f98b4
commit 34a73082a6
6 changed files with 13 additions and 13 deletions

View File

@ -109,10 +109,10 @@ bool Demo::Initialize() {
} }
music_.SetSound("music"); music_.SetSound("music");
music_.SetMaxAplitude(0.5f); music_.SetMaxAmplitude(0.5f);
boss_music_.SetSound("boss_music"); boss_music_.SetSound("boss_music");
boss_music_.SetMaxAplitude(0.5f); boss_music_.SetMaxAmplitude(0.5f);
if (!saved_data_.root().get("audio", Json::Value(true)).asBool()) if (!saved_data_.root().get("audio", Json::Value(true)).asBool())
Engine::Get().SetEnableAudio(false); Engine::Get().SetEnableAudio(false);

View File

@ -734,29 +734,29 @@ void Enemy::SpawnUnit(EnemyType enemy_type,
e.explosion.SetSound("powerup-pick"); e.explosion.SetSound("powerup-pick");
e.spawn.SetSound("powerup-spawn"); e.spawn.SetSound("powerup-spawn");
e.spawn.SetMaxAplitude(2.0f); e.spawn.SetMaxAmplitude(2.0f);
e.spawn.Play(false); e.spawn.Play(false);
} else { } else {
e.explosion.SetSound("explosion"); e.explosion.SetSound("explosion");
e.explosion.SetVariate(true); e.explosion.SetVariate(true);
e.explosion.SetSimulateStereo(true); e.explosion.SetSimulateStereo(true);
e.explosion.SetMaxAplitude(0.9f); e.explosion.SetMaxAmplitude(0.9f);
} }
e.stealth.SetSound("stealth"); e.stealth.SetSound("stealth");
e.stealth.SetVariate(false); e.stealth.SetVariate(false);
e.stealth.SetSimulateStereo(false); e.stealth.SetSimulateStereo(false);
e.stealth.SetMaxAplitude(0.7f); e.stealth.SetMaxAmplitude(0.7f);
e.shield_on.SetSound("shield"); e.shield_on.SetSound("shield");
e.shield_on.SetVariate(false); e.shield_on.SetVariate(false);
e.shield_on.SetSimulateStereo(false); e.shield_on.SetSimulateStereo(false);
e.shield_on.SetMaxAplitude(0.5f); e.shield_on.SetMaxAmplitude(0.5f);
e.hit.SetSound("hit"); e.hit.SetSound("hit");
e.hit.SetVariate(true); e.hit.SetVariate(true);
e.hit.SetSimulateStereo(false); e.hit.SetSimulateStereo(false);
e.hit.SetMaxAplitude(0.5f); e.hit.SetMaxAmplitude(0.5f);
} }
void Enemy::SpawnBoss() { void Enemy::SpawnBoss() {
@ -834,7 +834,7 @@ void Enemy::SpawnBoss() {
e.hit.SetSound("hit"); e.hit.SetSound("hit");
e.hit.SetVariate(true); e.hit.SetVariate(true);
e.hit.SetSimulateStereo(false); e.hit.SetSimulateStereo(false);
e.hit.SetMaxAplitude(0.5f); e.hit.SetMaxAmplitude(0.5f);
}); });
boss_animator_.Play(Animator::kFrames, true); boss_animator_.Play(Animator::kFrames, true);
boss_animator_.Play(Animator::kMovement, false); boss_animator_.Play(Animator::kMovement, false);

View File

@ -149,7 +149,7 @@ bool Menu::Initialize() {
click_.SetSound(click_sound_); click_.SetSound(click_sound_);
click_.SetVariate(false); click_.SetVariate(false);
click_.SetSimulateStereo(false); click_.SetSimulateStereo(false);
click_.SetMaxAplitude(1.5f); click_.SetMaxAmplitude(1.5f);
logo_[0].Create("logo_tex0", {3, 8}); logo_[0].Create("logo_tex0", {3, 8});
logo_[0].SetZOrder(41); logo_[0].SetZOrder(41);

View File

@ -75,7 +75,7 @@ bool Player::Initialize() {
nuke_explosion_.SetSound("nuke"); nuke_explosion_.SetSound("nuke");
nuke_explosion_.SetVariate(false); nuke_explosion_.SetVariate(false);
nuke_explosion_.SetSimulateStereo(false); nuke_explosion_.SetSimulateStereo(false);
nuke_explosion_.SetMaxAplitude(0.8f); nuke_explosion_.SetMaxAmplitude(0.8f);
no_nuke_.SetSound("no_nuke"); no_nuke_.SetSound("no_nuke");
@ -306,7 +306,7 @@ void Player::SetupWeapons() {
laser_shot_[i].SetSound("laser"); laser_shot_[i].SetSound("laser");
laser_shot_[i].SetVariate(true); laser_shot_[i].SetVariate(true);
laser_shot_[i].SetSimulateStereo(false); laser_shot_[i].SetSimulateStereo(false);
laser_shot_[i].SetMaxAplitude(0.4f); laser_shot_[i].SetMaxAmplitude(0.4f);
} }
} }

View File

@ -69,7 +69,7 @@ void SoundPlayer::SetSimulateStereo(bool simulate) {
input_->SetSimulateStereo(simulate); input_->SetSimulateStereo(simulate);
} }
void SoundPlayer::SetMaxAplitude(float max_amplitude) { void SoundPlayer::SetMaxAmplitude(float max_amplitude) {
max_amplitude_ = max_amplitude; max_amplitude_ = max_amplitude;
input_->SetMaxAmplitude(max_amplitude); input_->SetMaxAmplitude(max_amplitude);
} }

View File

@ -32,7 +32,7 @@ class SoundPlayer {
// Enable or disable stereo simulation effect. Disabled by default. // Enable or disable stereo simulation effect. Disabled by default.
void SetSimulateStereo(bool simulate); void SetSimulateStereo(bool simulate);
void SetMaxAplitude(float max_amplitude); // TODO: typo void SetMaxAmplitude(float max_amplitude);
// Set callback to be called once playback stops. // Set callback to be called once playback stops.
void SetEndCallback(base::Closure cb); void SetEndCallback(base::Closure cb);