mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Minor change to ease video plugin merging. Made static NativeVertexFormat::Create function into a virtual function of VertexManager. I believe this is the last bit of code which is only declared in VideoCommon and defined in each of the plugins.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6479 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -26,25 +26,27 @@
|
||||
|
||||
#include "CPMemory.h"
|
||||
#include "NativeVertexFormat.h"
|
||||
#include "VertexManager.h"
|
||||
|
||||
class D3DVertexFormat : public NativeVertexFormat
|
||||
{
|
||||
LPDIRECT3DVERTEXDECLARATION9 d3d_decl;
|
||||
|
||||
public:
|
||||
D3DVertexFormat();
|
||||
D3DVertexFormat() : d3d_decl(NULL) {}
|
||||
~D3DVertexFormat();
|
||||
virtual void Initialize(const PortableVertexDeclaration &_vtx_decl);
|
||||
virtual void SetupVertexPointers() const;
|
||||
};
|
||||
|
||||
NativeVertexFormat *NativeVertexFormat::Create()
|
||||
namespace DX9
|
||||
{
|
||||
|
||||
NativeVertexFormat* VertexManager::CreateNativeVertexFormat()
|
||||
{
|
||||
return new D3DVertexFormat();
|
||||
}
|
||||
|
||||
D3DVertexFormat::D3DVertexFormat() : d3d_decl(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
D3DVertexFormat::~D3DVertexFormat()
|
||||
@ -93,8 +95,8 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
|
||||
{
|
||||
vertex_stride = _vtx_decl.stride;
|
||||
|
||||
D3DVERTEXELEMENT9 *elems = new D3DVERTEXELEMENT9[32];
|
||||
memset(elems, 0, sizeof(D3DVERTEXELEMENT9) * 32);
|
||||
D3DVERTEXELEMENT9 elems[32];
|
||||
memset(elems, 0, sizeof(elems));
|
||||
|
||||
// There's only one stream and it's 0, so the above memset takes care of that - no need to set Stream.
|
||||
// Same for method.
|
||||
@ -161,7 +163,6 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
|
||||
PanicAlert("Failed to create D3D vertex declaration!");
|
||||
return;
|
||||
}
|
||||
delete [] elems;
|
||||
}
|
||||
|
||||
void D3DVertexFormat::SetupVertexPointers() const
|
||||
|
Reference in New Issue
Block a user