mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Render: Get rid of explicit new and delete
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user