Files
dolphin/Source/Core/VideoCommon/VertexLoader.h
T

52 lines
1.3 KiB
C++
Raw Normal View History

// Copyright 2008 Dolphin Emulator Project
2015-05-18 01:08:10 +02:00
// Licensed under GPLv2+
// Refer to the license.txt file included.
2008-12-08 04:46:09 +00:00
#pragma once
2008-12-08 04:46:09 +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-07 20:06:58 -05:00
#include "Common/CommonTypes.h"
#include "VideoCommon/VertexLoaderBase.h"
class DataReader;
class VertexLoader;
2015-06-19 15:18:16 -04:00
typedef void (*TPipelineFunction)(VertexLoader* loader);
2014-07-08 15:58:25 +02:00
class VertexLoader : public VertexLoaderBase
2008-12-08 04:46:09 +00:00
{
public:
VertexLoader(const TVtxDesc& vtx_desc, const VAT& vtx_attr);
2008-12-08 04:46:09 +00:00
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;
2014-08-24 23:53:28 -04:00
// 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;
2008-12-08 04:46:09 +00:00
private:
// Pipeline.
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
int m_numPipelineStages;
2008-12-08 04:46:09 +00:00
void CompileVertexTranslator();
2008-12-08 04:46:09 +00:00
void WriteCall(TPipelineFunction);
};