Render: Get rid of explicit new and delete

This commit is contained in:
Lioncash
2015-12-22 18:47:20 -05:00
parent 14e976a5f1
commit da0e647346
6 changed files with 19 additions and 24 deletions

View File

@ -4,6 +4,7 @@
#include <cinttypes>
#include <cmath>
#include <memory>
#include <string>
#include <strsafe.h>
#include <unordered_map>
@ -86,7 +87,7 @@ static void SetupDeviceObjects()
{
s_television.Init();
g_framebuffer_manager = new FramebufferManager;
g_framebuffer_manager = std::make_unique<FramebufferManager>();
HRESULT hr;
float colmat[20]= {0.0f};
@ -169,7 +170,7 @@ static void SetupDeviceObjects()
// Kill off all device objects
static void TeardownDeviceObjects()
{
delete g_framebuffer_manager;
g_framebuffer_manager.reset();
SAFE_RELEASE(access_efb_cbuf);
SAFE_RELEASE(clearblendstates[0]);
@ -999,8 +1000,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), nullptr);
delete g_framebuffer_manager;
g_framebuffer_manager = new FramebufferManager;
g_framebuffer_manager = std::make_unique<FramebufferManager>();
float clear_col[4] = { 0.f, 0.f, 0.f, 1.f };
D3D::context->ClearRenderTargetView(FramebufferManager::GetEFBColorTexture()->GetRTV(), clear_col);
D3D::context->ClearDepthStencilView(FramebufferManager::GetEFBDepthTexture()->GetDSV(), D3D11_CLEAR_DEPTH, 0.f, 0);