diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index f727aa136..c1f263c71 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -742,7 +742,7 @@ void GameInfoCache::WaitUntilDone(std::shared_ptr &info) { } -// Runs on the main thread. +// Runs on the main thread. Only call from render() and similar, not update()! std::shared_ptr GameInfoCache::GetInfo(Draw::DrawContext *draw, const std::string &gamePath, int wantFlags) { std::shared_ptr info; @@ -800,7 +800,7 @@ void GameInfoCache::SetupTexture(std::shared_ptr &info, Draw::DrawCont if (tex.texture) { tex.timeLoaded = time_now_d(); } else { - ERROR_LOG(G3D, "Failed creating texture"); + ERROR_LOG(G3D, "Failed creating texture (%s)", info->GetTitle().c_str()); } } if ((info->wantFlags & GAMEINFO_WANTBGDATA) == 0) { diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index d10584463..250977b32 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -189,8 +189,8 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e) return UI::EVENT_DONE; } -void GameScreen::update() { - UIScreen::update(); +void GameScreen::render() { + UIScreen::render(); I18NCategory *ga = GetI18NCategory("Game"); diff --git a/UI/GameScreen.h b/UI/GameScreen.h index 77b0c8727..bc35ab64e 100644 --- a/UI/GameScreen.h +++ b/UI/GameScreen.h @@ -33,7 +33,7 @@ public: GameScreen(const std::string &gamePath); ~GameScreen(); - void update() override; + void render() override; std::string tag() const override { return "game"; } diff --git a/UI/TextureUtil.cpp b/UI/TextureUtil.cpp index b2a41fba5..fed1fb1f7 100644 --- a/UI/TextureUtil.cpp +++ b/UI/TextureUtil.cpp @@ -110,6 +110,7 @@ bool ManagedTexture::LoadFromFileData(const uint8_t *data, size_t dataSize, Imag num_levels = 1; } + // Free the old texture, if any. if (texture_) { delete texture_; texture_ = nullptr; @@ -134,7 +135,7 @@ bool ManagedTexture::LoadFromFileData(const uint8_t *data, size_t dataSize, Imag if (image[i]) free(image[i]); } - return texture_ != nullptr; + return texture_; } bool ManagedTexture::LoadFromFile(const std::string &filename, ImageFileType type, bool generateMips) {