diff --git a/src/Font.cpp b/src/Font.cpp index efc9e3d49..a8d6c7dd7 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -127,7 +127,10 @@ void Font::init(ResourceData data) void Font::deinit() { if(textureID) + { glDeleteTextures(1, &textureID); + textureID = 0; + } } void Font::buildAtlas(ResourceData data) @@ -246,7 +249,7 @@ void Font::buildAtlas(ResourceData data) deinit(); init(data); }else{ - LOG(LogInfo) << "Created font \"" << mPath << "\" with size " << mSize << "."; + LOG(LogInfo) << "Created font \"" << mPath << "\" with size " << mSize << ". textureID: " << textureID; } } diff --git a/src/components/GuiGameList.cpp b/src/components/GuiGameList.cpp index b0e1de5b2..135dec9b5 100644 --- a/src/components/GuiGameList.cpp +++ b/src/components/GuiGameList.cpp @@ -113,7 +113,11 @@ void GuiGameList::setSystemId(int id) void GuiGameList::render(const Eigen::Affine3f& parentTrans) { Eigen::Affine3f trans = parentTrans * getTransform(); + renderChildren(trans); + + Renderer::setMatrix(trans); + mTheme->getDescriptionFont()->drawText("DESCRIPTION TEXT", Eigen::Vector2f::Zero(), 0xFF0000FF); } bool GuiGameList::input(InputConfig* config, Input input) @@ -338,6 +342,8 @@ void GuiGameList::updateTheme() mList.setCentered(true); mList.setPosition(0, mList.getPosition().y()); mList.setTextOffsetX(0); + + //mDescription.setFont(nullptr); } } @@ -490,6 +496,7 @@ void GuiGameList::updateGameLaunchEffect(int t) if(t > endTime) { //effect done + mTransitionImage.setImage(""); //fixes "tried to bind uninitialized texture!" since copyScreen()'d textures don't reinit mSystem->launchGame(mWindow, (GameData*)mList.getSelectedObject()); mEffectFunc = &GuiGameList::updateGameReturnEffect; mEffectTime = 0; diff --git a/src/components/ImageComponent.cpp b/src/components/ImageComponent.cpp index e7f990882..795e1b13b 100644 --- a/src/components/ImageComponent.cpp +++ b/src/components/ImageComponent.cpp @@ -71,9 +71,6 @@ void ImageComponent::resize() void ImageComponent::setImage(std::string path) { - if(mPath == path) - return; - mPath = path; if(mPath.empty() || !mWindow->getResourceManager()->fileExists(mPath)) diff --git a/src/resources/TextureResource.cpp b/src/resources/TextureResource.cpp index 46bef5a0e..e46992cb2 100644 --- a/src/resources/TextureResource.cpp +++ b/src/resources/TextureResource.cpp @@ -105,7 +105,11 @@ void TextureResource::bind() const std::shared_ptr TextureResource::get(ResourceManager& rm, const std::string& path) { if(path.empty()) - return std::shared_ptr(new TextureResource(rm, path)); + { + std::shared_ptr tex(new TextureResource(rm, "")); + rm.addReloadable(tex); //make sure we're deinitialized even though we do nothing on reinitialization + return tex; + } auto foundTexture = sTextureMap.find(path); if(foundTexture != sTextureMap.end())