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
|
|
|
|
2016-01-17 21:54:31 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2017-03-03 19:43:52 +00:00
|
|
|
#include "VideoCommon/VertexLoader.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
class VertexLoader_Normal
|
|
|
|
{
|
|
|
|
public:
|
2016-06-24 08:43:46 +00:00
|
|
|
// Init
|
|
|
|
static void Init();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
// GetSize
|
|
|
|
static unsigned int GetSize(u64 _type, unsigned int _format, unsigned int _elements,
|
|
|
|
unsigned int _index3);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
// GetFunction
|
|
|
|
static TPipelineFunction GetFunction(u64 _type, unsigned int _format, unsigned int _elements,
|
|
|
|
unsigned int _index3);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
enum ENormalType
|
|
|
|
{
|
|
|
|
NRM_NOT_PRESENT = 0,
|
|
|
|
NRM_DIRECT = 1,
|
|
|
|
NRM_INDEX8 = 2,
|
|
|
|
NRM_INDEX16 = 3,
|
|
|
|
NUM_NRM_TYPE
|
|
|
|
};
|
2013-03-20 01:51:12 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
enum ENormalFormat
|
|
|
|
{
|
|
|
|
FORMAT_UBYTE = 0,
|
|
|
|
FORMAT_BYTE = 1,
|
|
|
|
FORMAT_USHORT = 2,
|
|
|
|
FORMAT_SHORT = 3,
|
|
|
|
FORMAT_FLOAT = 4,
|
|
|
|
NUM_NRM_FORMAT
|
|
|
|
};
|
2013-03-20 01:51:12 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
enum ENormalElements
|
|
|
|
{
|
|
|
|
NRM_NBT = 0,
|
|
|
|
NRM_NBT3 = 1,
|
|
|
|
NUM_NRM_ELEMENTS
|
|
|
|
};
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
enum ENormalIndices
|
|
|
|
{
|
|
|
|
NRM_INDICES1 = 0,
|
|
|
|
NRM_INDICES3 = 1,
|
|
|
|
NUM_NRM_INDICES
|
|
|
|
};
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
struct Set
|
|
|
|
{
|
|
|
|
template <typename T>
|
|
|
|
void operator=(const T&)
|
|
|
|
{
|
|
|
|
gc_size = T::size;
|
|
|
|
function = T::function;
|
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
int gc_size;
|
|
|
|
TPipelineFunction function;
|
|
|
|
};
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
static Set m_Table[NUM_NRM_TYPE][NUM_NRM_INDICES][NUM_NRM_ELEMENTS][NUM_NRM_FORMAT];
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|