just a bunch of random code cleanup i did on the train bored, plus a d3d implementation of NativeVertexFormat which isn't actually used yet.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1658 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-12-25 15:56:36 +00:00
parent 3fd665502e
commit dcc48d6c41
28 changed files with 948 additions and 679 deletions

View File

@ -48,7 +48,25 @@ DECLARE_IMPORT(glColorPointer);
DECLARE_IMPORT(glTexCoordPointer);
#endif
NativeVertexFormat::NativeVertexFormat()
class GLVertexFormat : public NativeVertexFormat
{
u8 *m_compiledCode;
PortableVertexDeclaration vtx_decl;
public:
GLVertexFormat();
~GLVertexFormat();
virtual void Initialize(const PortableVertexDeclaration &_vtx_decl);
virtual void SetupVertexPointers() const;
};
NativeVertexFormat *NativeVertexFormat::Create()
{
return new GLVertexFormat();
}
GLVertexFormat::GLVertexFormat()
{
#ifdef USE_JIT
m_compiledCode = (u8 *)AllocateExecutableMemory(COMPILED_CODE_SIZE, false);
@ -58,7 +76,7 @@ NativeVertexFormat::NativeVertexFormat()
#endif
}
NativeVertexFormat::~NativeVertexFormat()
GLVertexFormat::~GLVertexFormat()
{
#ifdef USE_JIT
FreeMemoryPages(m_compiledCode, COMPILED_CODE_SIZE);
@ -72,7 +90,7 @@ inline GLuint VarToGL(VarType t)
return lookup[t];
}
void NativeVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
void GLVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
{
using namespace Gen;
@ -148,7 +166,7 @@ void NativeVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
this->vtx_decl = _vtx_decl;
}
void NativeVertexFormat::SetupVertexPointers() const {
void GLVertexFormat::SetupVertexPointers() const {
// Cast a pointer to compiled code to a pointer to a function taking no parameters, through a (void *) cast first to
// get around type checking errors, and call it.
#ifdef USE_JIT