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