mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
VertexManagerBase: Make CreateNativeVertexFormat return a unique_ptr
Much safer as opposed to just returning raw allocated memory.
This commit is contained in:
@ -63,10 +63,10 @@ bool VertexManager::Initialize()
|
||||
return true;
|
||||
}
|
||||
|
||||
NativeVertexFormat*
|
||||
std::unique_ptr<NativeVertexFormat>
|
||||
VertexManager::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
|
||||
{
|
||||
return new VertexFormat(vtx_decl);
|
||||
return std::make_unique<VertexFormat>(vtx_decl);
|
||||
}
|
||||
|
||||
void VertexManager::PrepareDrawBuffers(u32 stride)
|
||||
|
@ -24,7 +24,8 @@ public:
|
||||
|
||||
bool Initialize();
|
||||
|
||||
NativeVertexFormat* CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) override;
|
||||
std::unique_ptr<NativeVertexFormat>
|
||||
CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) override;
|
||||
|
||||
protected:
|
||||
void PrepareDrawBuffers(u32 stride);
|
||||
|
Reference in New Issue
Block a user