Skip to content

Commit

Permalink
Merge pull request #5138 from lioncash/init
Browse files Browse the repository at this point in the history
VertexLoaderBase: In-class initialize class members where applicable
  • Loading branch information
degasus committed Mar 23, 2017
2 parents 6d065a0 + da2e34f commit 4b5995a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
9 changes: 1 addition & 8 deletions Source/Core/VideoCommon/VertexLoaderBase.cpp
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/VideoCommon/VertexLoaderBase.h
Expand Up @@ -72,13 +72,13 @@ class VertexLoaderBase
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);
Expand Down

0 comments on commit 4b5995a

Please sign in to comment.