2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:09:55 +00:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-02-15 13:45:03 +00:00
|
|
|
// Top vertex loaders
|
|
|
|
// Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <string>
|
|
|
|
|
2014-09-08 01:06:58 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-12-13 00:51:14 +00:00
|
|
|
#include "VideoCommon/VertexLoaderBase.h"
|
|
|
|
|
2016-01-31 19:51:55 +00:00
|
|
|
class DataReader;
|
2014-12-13 09:57:46 +00:00
|
|
|
class VertexLoader;
|
2015-06-19 19:18:16 +00:00
|
|
|
typedef void (*TPipelineFunction)(VertexLoader* loader);
|
2014-07-08 13:58:25 +00:00
|
|
|
|
2014-12-13 00:51:14 +00:00
|
|
|
class VertexLoader : public VertexLoaderBase
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-06-24 08:43:46 +00:00
|
|
|
VertexLoader(const TVtxDesc& vtx_desc, const VAT& vtx_attr);
|
|
|
|
|
|
|
|
int RunVertices(DataReader src, DataReader dst, int count) override;
|
|
|
|
std::string GetName() const override { return "OldLoader"; }
|
|
|
|
bool IsInitialized() override { return true; } // This vertex loader supports all formats
|
|
|
|
// They are used for the communication with the loader functions
|
|
|
|
float m_posScale;
|
|
|
|
float m_tcScale[8];
|
|
|
|
int m_tcIndex;
|
|
|
|
int m_colIndex;
|
|
|
|
|
|
|
|
// Matrix components are first in GC format but later in PC format - we need to store it
|
|
|
|
// temporarily
|
|
|
|
// when decoding each vertex.
|
|
|
|
u8 m_curtexmtx[8];
|
|
|
|
int m_texmtxwrite;
|
|
|
|
int m_texmtxread;
|
|
|
|
bool m_vertexSkip;
|
|
|
|
int m_skippedVertices;
|
|
|
|
int m_counter;
|
2014-12-13 09:57:46 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
// Pipeline.
|
|
|
|
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
|
|
|
|
int m_numPipelineStages;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void CompileVertexTranslator();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void WriteCall(TPipelineFunction);
|
2013-03-20 01:51:12 +00:00
|
|
|
};
|