mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 17:58:53 +01:00
Fixed minor sound and animation issues when switching layout.
This commit is contained in:
parent
efe9e323cc
commit
4da301802b
@ -183,16 +183,19 @@ Page *PageBuilder::buildPage( std::string collectionName )
|
||||
// load sounds
|
||||
for(xml_node<> *sound = root->first_node("sound"); sound; sound = sound->next_sibling("sound"))
|
||||
{
|
||||
xml_attribute<> *src = sound->first_attribute("src");
|
||||
xml_attribute<> *src = sound->first_attribute("src");
|
||||
xml_attribute<> *type = sound->first_attribute("type");
|
||||
std::string file = Configuration::convertToAbsolutePath(layoutPath, src->value());
|
||||
std::string file = Configuration::convertToAbsolutePath(layoutPath, src->value());
|
||||
std::string layoutName;
|
||||
config_.getProperty("layout", layoutName);
|
||||
std::string altfile = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, std::string(src->value()));
|
||||
if(!type)
|
||||
{
|
||||
Logger::write(Logger::ZONE_ERROR, "Layout", "Sound tag missing type attribute");
|
||||
}
|
||||
else
|
||||
{
|
||||
Sound *sound = new Sound(file);
|
||||
Sound *sound = new Sound(file, altfile);
|
||||
std::string soundType = type->value();
|
||||
|
||||
if(!soundType.compare("load"))
|
||||
|
||||
@ -414,7 +414,10 @@ void RetroFE::run()
|
||||
|
||||
currentPage_->onNewItemSelected();
|
||||
currentPage_->reallocateMenuSpritePoints();
|
||||
currentPage_->enterMenu();
|
||||
if (currentPage_->getMenuDepth() != 1 )
|
||||
{
|
||||
currentPage_->enterMenu();
|
||||
}
|
||||
|
||||
state = RETROFE_NEXT_PAGE_MENU_ENTER;
|
||||
|
||||
|
||||
@ -18,13 +18,17 @@
|
||||
|
||||
#include "../Utility/Log.h"
|
||||
|
||||
Sound::Sound(std::string file)
|
||||
Sound::Sound(std::string file, std::string altfile)
|
||||
: file_(file)
|
||||
, chunk_(NULL)
|
||||
{
|
||||
if(!allocate())
|
||||
{
|
||||
Logger::write(Logger::ZONE_ERROR, "Sound", "Cannot load " + file_);
|
||||
file_ = altfile;
|
||||
if (!allocate())
|
||||
{
|
||||
Logger::write(Logger::ZONE_ERROR, "Sound", "Cannot load " + file_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
class Sound
|
||||
{
|
||||
public:
|
||||
Sound(std::string file);
|
||||
Sound(std::string file, std::string altfile);
|
||||
virtual ~Sound();
|
||||
void play();
|
||||
bool allocate();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user