GSTextureCache: Refactor code to avoid using local shared pointer.

This commit is contained in:
Alessandro Vetere 2018-12-10 21:54:05 +01:00 committed by lightningterror
parent 894ce5b7d6
commit c183368d72
1 changed files with 2 additions and 5 deletions

View File

@ -2036,11 +2036,8 @@ void GSTextureCache::SourceMap::RemoveAt(Source* s)
void GSTextureCache::AttachPaletteToSource(Source* s, uint16 pal, bool need_gs_texture) void GSTextureCache::AttachPaletteToSource(Source* s, uint16 pal, bool need_gs_texture)
{ {
std::shared_ptr<Palette> p = m_palette_map.LookupPalette(pal, need_gs_texture); s->m_palette_obj = m_palette_map.LookupPalette(pal, need_gs_texture);
s->m_palette_obj = p; s->m_palette = need_gs_texture ? s->m_palette_obj->GetPaletteGSTexture() : nullptr;
if (need_gs_texture) {
s->m_palette = p->GetPaletteGSTexture();
}
} }
// GSTextureCache::Palette // GSTextureCache::Palette