gsdx-osd: Update m_font to use unique_ptr

This commit is contained in:
Kojin 2018-12-14 17:53:28 -05:00 committed by lightningterror
parent a4f794f3a6
commit e51eadaf16
4 changed files with 14 additions and 9 deletions

View File

@ -412,7 +412,10 @@ bool GSDevice11::Create(const std::shared_ptr<GSWnd> &wnd)
}
GSVector2i tex_font = m_osd.get_texture_font_size();
m_font = CreateSurface(GSTexture::Texture, tex_font.x, tex_font.y, false, DXGI_FORMAT_R8_UNORM);
m_font = std::unique_ptr<GSTexture>(
CreateSurface(GSTexture::Texture, tex_font.x, tex_font.y, false, DXGI_FORMAT_R8_UNORM)
);
return true;
}
@ -821,11 +824,11 @@ void GSDevice11::RenderOsd(GSTexture* dt)
OMSetRenderTargets(dt, NULL);
if(m_osd.m_texture_dirty) {
m_osd.upload_texture_atlas(m_font);
m_osd.upload_texture_atlas(m_font.get());
}
// ps
PSSetShaderResource(0, m_font);
PSSetShaderResource(0, m_font.get());
PSSetSamplerState(m_convert.pt, NULL);
PSSetShader(m_convert.ps[ShaderConvert_OSD], NULL);

View File

@ -159,7 +159,7 @@ public: // TODO
GSConstantBuffer m_gs_cb_cache;
PSConstantBuffer m_ps_cb_cache;
GSTexture* m_font;
std::unique_ptr<GSTexture> m_font;
bool CreateTextureFX();

View File

@ -64,7 +64,6 @@ GSDeviceOGL::GSDeviceOGL()
, m_palette_ss(0)
, m_vs_cb(NULL)
, m_ps_cb(NULL)
, m_font(NULL)
, m_shader(NULL)
{
memset(&m_merge_obj, 0, sizeof(m_merge_obj));
@ -549,7 +548,10 @@ bool GSDeviceOGL::Create(const std::shared_ptr<GSWnd> &wnd)
// Texture Font (OSD)
// ****************************************************************
GSVector2i tex_font = m_osd.get_texture_font_size();
m_font = new GSTextureOGL(GSTextureOGL::Texture, tex_font.x, tex_font.y, GL_R8, m_fbo_read, false);
m_font = std::unique_ptr<GSTexture>(
new GSTextureOGL(GSTextureOGL::Texture, tex_font.x, tex_font.y, GL_R8, m_fbo_read, false)
);
// ****************************************************************
// Finish window setup and backbuffer
@ -1389,10 +1391,10 @@ void GSDeviceOGL::RenderOsd(GSTexture* dt)
OMSetRenderTargets(dt, NULL);
if(m_osd.m_texture_dirty) {
m_osd.upload_texture_atlas(m_font);
m_osd.upload_texture_atlas(m_font.get());
}
PSSetShaderResource(0, m_font);
PSSetShaderResource(0, m_font.get());
PSSetSamplerState(m_convert.pt);
IASetPrimitiveTopology(GL_TRIANGLES);

View File

@ -491,7 +491,7 @@ public:
PSConstantBuffer m_ps_cb_cache;
MiscConstantBuffer m_misc_cb_cache;
GSTextureOGL* m_font;
std::unique_ptr<GSTexture> m_font;
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);