summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoDX9/Src/NativeVertexFormat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX9/Src/NativeVertexFormat.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/NativeVertexFormat.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoDX9/Src/NativeVertexFormat.cpp
index 13a7c37d36..a05883bab1 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/NativeVertexFormat.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/NativeVertexFormat.cpp
@@ -37,6 +37,11 @@ public:
~D3DVertexFormat();
virtual void Initialize(const PortableVertexDeclaration &_vtx_decl);
virtual void SetupVertexPointers() const;
+
+#if defined(_DEBUG) || defined(DEBUGFAST)
+ D3DVERTEXELEMENT9 elements[32];
+ int num_elements;
+#endif
};
namespace DX9
@@ -49,6 +54,17 @@ NativeVertexFormat* VertexManager::CreateNativeVertexFormat()
}
+void DX9::VertexManager::GetElements(NativeVertexFormat* format, D3DVERTEXELEMENT9** elems, int* num)
+{
+#if defined(_DEBUG) || defined(DEBUGFAST)
+ *elems = ((D3DVertexFormat*)format)->elements;
+ *num = ((D3DVertexFormat*)format)->num_elements;
+#else
+ *elems = NULL;
+ *num = 0;
+#endif
+}
+
D3DVertexFormat::~D3DVertexFormat()
{
if (d3d_decl)
@@ -163,6 +179,10 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
PanicAlert("Failed to create D3D vertex declaration!");
return;
}
+#if defined(_DEBUG) || defined(DEBUGFAST)
+ memcpy(&elements, elems, sizeof(elems));
+ num_elements = elem_idx;
+#endif
}
void D3DVertexFormat::SetupVertexPointers() const