From da2e34f69b29b4a57e66f325b67d95cd1b5b04d8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 23 Mar 2017 08:34:35 -0400 Subject: [PATCH] VertexLoaderBase: In-class initialize class members where applicable Same thing, less code. --- Source/Core/VideoCommon/VertexLoaderBase.cpp | 9 +-------- Source/Core/VideoCommon/VertexLoaderBase.h | 10 +++++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Source/Core/VideoCommon/VertexLoaderBase.cpp b/Source/Core/VideoCommon/VertexLoaderBase.cpp index 0975b2c172..ce637401ac 100644 --- a/Source/Core/VideoCommon/VertexLoaderBase.cpp +++ b/Source/Core/VideoCommon/VertexLoaderBase.cpp @@ -24,16 +24,9 @@ #endif VertexLoaderBase::VertexLoaderBase(const TVtxDesc& vtx_desc, const VAT& vtx_attr) + : m_VtxDesc{vtx_desc}, m_vat{vtx_attr} { - m_numLoadedVertices = 0; - m_VertexSize = 0; - m_native_vertex_format = nullptr; - m_native_components = 0; - memset(&m_native_vtx_decl, 0, sizeof(m_native_vtx_decl)); - SetVAT(vtx_attr); - m_VtxDesc = vtx_desc; - m_vat = vtx_attr; } void VertexLoaderBase::SetVAT(const VAT& vat) diff --git a/Source/Core/VideoCommon/VertexLoaderBase.h b/Source/Core/VideoCommon/VertexLoaderBase.h index 38fa66c371..0c1c3c50cb 100644 --- a/Source/Core/VideoCommon/VertexLoaderBase.h +++ b/Source/Core/VideoCommon/VertexLoaderBase.h @@ -72,13 +72,13 @@ public: virtual std::string GetName() const = 0; // per loader public state - int m_VertexSize; // number of bytes of a raw GC vertex - PortableVertexDeclaration m_native_vtx_decl; - u32 m_native_components; + int m_VertexSize = 0; // number of bytes of a raw GC vertex + PortableVertexDeclaration m_native_vtx_decl{}; + u32 m_native_components = 0; // used by VertexLoaderManager - NativeVertexFormat* m_native_vertex_format; - int m_numLoadedVertices; + NativeVertexFormat* m_native_vertex_format = nullptr; + int m_numLoadedVertices = 0; protected: VertexLoaderBase(const TVtxDesc& vtx_desc, const VAT& vtx_attr);