diff --git a/RetroFE/Source/Control/UserInput.cpp b/RetroFE/Source/Control/UserInput.cpp index b9eca67..7574252 100644 --- a/RetroFE/Source/Control/UserInput.cpp +++ b/RetroFE/Source/Control/UserInput.cpp @@ -145,7 +145,7 @@ bool UserInput::MapKey(std::string keyDescription, KeyCode_E key) Logger::write(Logger::ZONE_INFO, "Input", "Binding joypad button " + ss.str() ); return true; } - else if(joydesc.find("hat")) + else if(joydesc.find("hat") == 0) { Uint8 hat; @@ -170,26 +170,26 @@ bool UserInput::MapKey(std::string keyDescription, KeyCode_E key) Logger::write(Logger::ZONE_INFO, "Input", "Binding joypad hat " + joydesc ); return true; } - else if(joydesc.find("axis")) + else if(joydesc.find("axis") == 0) { // string is now axis0+ unsigned int axis; Sint16 min; Sint16 max; - Utils::replace(joydesc, "axis", ""); + joydesc = Utils::replace(joydesc, "axis", ""); // string is now 0+ if(joydesc.find("-") != std::string::npos) { min = -32768; max = -1000; - Utils::replace(joydesc, "-", ""); + joydesc = Utils::replace(joydesc, "-", ""); } else if(joydesc.find("+") != std::string::npos) { min = 1000; max = 32767; - Utils::replace(joydesc, "+", ""); + joydesc = Utils::replace(joydesc, "+", ""); } // string is now just the axis number diff --git a/RetroFE/Source/Database/Configuration.cpp b/RetroFE/Source/Database/Configuration.cpp index f9cf2dc..165317f 100644 --- a/RetroFE/Source/Database/Configuration.cpp +++ b/RetroFE/Source/Database/Configuration.cpp @@ -40,6 +40,9 @@ Configuration::~Configuration() void Configuration::initialize() { + absolutePath = "D:/RetroFE"; + return; + const char *environment = std::getenv("RETROFE_PATH"); std::string environmentStr; if (environment != NULL) @@ -55,7 +58,7 @@ void Configuration::initialize() GetModuleFileName(hModule, exe, MAX_PATH); std::string sPath(exe); sPath = Utils::getDirectory(sPath); - sPath = Utils::GetParentDirectory(sPath); + sPath = Utils::getParentDirectory(sPath); #else char exepath[1024]; sprintf(exepath, "/proc/%d/exe", getpid()); diff --git a/RetroFE/Source/Graphics/Component/Component.cpp b/RetroFE/Source/Graphics/Component/Component.cpp index 5540cb5..87a30d4 100644 --- a/RetroFE/Source/Graphics/Component/Component.cpp +++ b/RetroFE/Source/Graphics/Component/Component.cpp @@ -374,7 +374,7 @@ bool Component::animate(bool loop) for(unsigned int i = 0; i < tweens->size(); i++) { Tween *tween = tweens->tweens()->at(i); - float elapsedTime = elapsedTweenTime_; + double elapsedTime = elapsedTweenTime_; //todo: too many levels of nesting if(elapsedTime < tween->duration) diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index 6068bb0..c078072 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -179,7 +179,7 @@ void ScrollingList::deallocateSpritePoints() unsigned int spriteIndex = firstSpriteIndex_; - for(unsigned int i = 0; i < scrollPoints_->size(); ++i) + for(unsigned int i = 0; i < scrollPoints_->size() && spriteList_->size() > spriteIndex; ++i) { deallocateTexture(spriteList_->at(spriteIndex)); circularIncrement(spriteIndex, spriteList_); @@ -393,7 +393,7 @@ void ScrollingList::letterUp() notifyAllRequested_ = true; deallocateSpritePoints(); - if(spriteList_ && scrollPoints_) + if(spriteList_ && scrollPoints_ && getSelectedCollectionItemSprite()) { unsigned int i = 0; @@ -438,7 +438,7 @@ void ScrollingList::letterDown() notifyAllRequested_ = true; deallocateSpritePoints(); - if(spriteList_ && scrollPoints_) + if(spriteList_ && scrollPoints_ && getSelectedCollectionItemSprite()) { std::string startname = getSelectedCollectionItemSprite()->item->lowercaseFullTitle();