diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index 725c6b56c..b302cd9b0 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -325,19 +325,19 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md, scraperParams.system->getSystemEnvData()->mLaunchCommands.size() > 1) { row.makeAcceptInputHandler([this, title, scraperParams, ed, updateVal, originalValue] { - GuiSettings* s {nullptr}; - - bool singleEntry { + const bool singleEntry { scraperParams.system->getSystemEnvData()->mLaunchCommands.size() == 1}; + if (!mInvalidEmulatorEntry && ed->getValue() == "" && singleEntry) + return; + + GuiSettings* s {nullptr}; + if (mInvalidEmulatorEntry && singleEntry) s = new GuiSettings("CLEAR INVALID ENTRY"); else s = new GuiSettings(title); - if (!mInvalidEmulatorEntry && ed->getValue() == "" && singleEntry) - return; - std::vector> launchCommands { scraperParams.system->getSystemEnvData()->mLaunchCommands}; diff --git a/es-core/src/components/ComponentGrid.cpp b/es-core/src/components/ComponentGrid.cpp index 98de624d6..1c6eb508c 100644 --- a/es-core/src/components/ComponentGrid.cpp +++ b/es-core/src/components/ComponentGrid.cpp @@ -477,6 +477,8 @@ std::vector ComponentGrid::getHelpPrompts() const GridEntry* e {getCellAt(mCursor)}; if (e) prompts = e->component->getHelpPrompts(); + else + return prompts; bool canScrollVert {false}; diff --git a/es-core/src/components/GIFAnimComponent.cpp b/es-core/src/components/GIFAnimComponent.cpp index 2b453fda6..3d3d3d2b6 100644 --- a/es-core/src/components/GIFAnimComponent.cpp +++ b/es-core/src/components/GIFAnimComponent.cpp @@ -236,12 +236,12 @@ void GIFAnimComponent::setAnimation(const std::string& path) mFrameRate = 1000.0 / static_cast(mFrameTime); mFrameSize = mFileWidth * mFileHeight * 4; mTargetPacing = static_cast((1000.0 / mFrameRate) / static_cast(mSpeedModifier)); - int duration {mTargetPacing * mTotalFrames}; if (mDirection == "reverse") mFrameNum = mTotalFrames - 1; if (DEBUG_ANIMATION) { + const int duration {mTargetPacing * mTotalFrames}; LOG(LogDebug) << "GIFAnimComponent::setAnimation(): Width: " << mFileWidth; LOG(LogDebug) << "GIFAnimComponent::setAnimation(): Height: " << mFileHeight; LOG(LogDebug) << "GIFAnimComponent::setAnimation(): Total number of frames: " diff --git a/es-core/src/components/LottieAnimComponent.cpp b/es-core/src/components/LottieAnimComponent.cpp index a62d5eb3e..ce2b57490 100644 --- a/es-core/src/components/LottieAnimComponent.cpp +++ b/es-core/src/components/LottieAnimComponent.cpp @@ -192,7 +192,6 @@ void LottieAnimComponent::setAnimation(const std::string& path) } // Some statistics for the file. - double duration {mAnimation->duration()}; mTotalFrames = mAnimation->totalFrame(); mFrameRate = mAnimation->frameRate(); mFrameSize = width * height * 4; @@ -204,6 +203,7 @@ void LottieAnimComponent::setAnimation(const std::string& path) mFrameNum = mTotalFrames - 1; if (DEBUG_ANIMATION) { + const double duration {mAnimation->duration()}; LOG(LogDebug) << "LottieAnimComponent::setAnimation(): Rasterized width: " << mSize.x; LOG(LogDebug) << "LottieAnimComponent::setAnimation(): Rasterized height: " << mSize.y; LOG(LogDebug) << "LottieAnimComponent::setAnimation(): Total number of frames: " diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index 1254295e2..0329cb057 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -297,8 +297,6 @@ std::string Font::wrapText(const std::string& text, continue; } - charWidth = 0.0f; - byteCount = 0; cursor = i; // Needed to handle multi-byte Unicode characters. diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index c8f56de7c..accc3df82 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -198,7 +198,9 @@ namespace Utils #else if (!homePath.length()) { - const std::string& envHome {getenv("HOME")}; + std::string envHome; + if (getenv("HOME") != nullptr) + envHome = getenv("HOME"); if (envHome.length()) homePath = getGenericPath(envHome); } @@ -231,7 +233,10 @@ namespace Utils return getGenericPath(Utils::String::wideStringToString(envHomeDrive) + "/" + Utils::String::wideStringToString(envHomePath)); #else - return getenv("HOME"); + std::string envHome; + if (getenv("HOME") != nullptr) + envHome = getenv("HOME"); + return envHome; #endif return ""; } @@ -294,10 +299,12 @@ namespace Utils return emulatorPath; #else - const std::string& pathVariable {std::string {getenv("PATH")}}; + std::string envPath; + if (getenv("PATH") != nullptr) + envPath = getenv("PATH"); const std::vector& pathList { - Utils::String::delimitedStringToVector(pathVariable, ":")}; + Utils::String::delimitedStringToVector(envPath, ":")}; std::string pathTest;