Skip to content

Commit

Permalink
Misc fixes in boot mode
Browse files Browse the repository at this point in the history
- Made the sounds loaded only once, triggering less crashes on app quit
so far.
- Made the development version string not translatable anymore.
  • Loading branch information
Yohann Ferreira committed Jan 29, 2013
1 parent 4ab42dd commit f2b1dbb
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/modes/boot/boot.cpp
Expand Up @@ -79,10 +79,11 @@ BootMode::BootMode() :
IF_PRINT_DEBUG(BOOT_DEBUG) << "BootMode constructor invoked" << std::endl;
mode_type = MODE_MANAGER_BOOT_MODE;

_version_text.SetStyle(TextStyle("text20"));
std::string date_string = " - ";
date_string.append(__DATE__);
_version_text.SetText(UTranslate("Development Release") + MakeUnicodeString(date_string));
// Note: Not translated on purpose.
_version_text.SetStyle(TextStyle("text18"));
std::string version_string = "Development Release - ";
version_string.append(__DATE__);
_version_text.SetText(MakeUnicodeString(version_string));

// Get rid of the old table to make sure no old data is used.
ScriptManager->DropGlobalTable("boot");
Expand Down Expand Up @@ -126,6 +127,14 @@ BootMode::BootMode() :

// make sure message window is not visible
_message_window.Hide();

// Preload test sound
AudioManager->LoadSound("snd/volume_test.wav", this);
// Preload main sounds
AudioManager->LoadSound("snd/confirm.wav", this);
AudioManager->LoadSound("snd/cancel.wav", this);
AudioManager->LoadSound("snd/bump.wav", this);
AudioManager->LoadSound("snd/new_game.wav", this);
} // BootMode::BootMode()


Expand Down Expand Up @@ -410,11 +419,6 @@ void BootMode::_SetupMainMenu()
} else {
_main_menu.SetSelection(1);
}

// Preload main sounds
AudioManager->LoadSound("snd/confirm.wav");
AudioManager->LoadSound("snd/cancel.wav");
AudioManager->LoadSound("snd/bump.wav");
}


Expand Down Expand Up @@ -481,9 +485,6 @@ void BootMode::_SetupAudioOptionsMenu()
_audio_options_menu.AddOption(UTranslate("Music Volume: "), NULL, NULL, NULL, &BootMode::_OnMusicLeft, &BootMode::_OnMusicRight);

_audio_options_menu.SetSelection(0);

// Preload test sound
AudioManager->LoadSound("snd/volume_test.wav", this);
}


Expand Down

0 comments on commit f2b1dbb

Please sign in to comment.