VertexLoader_Normal.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright 2008 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "VideoCommon/NativeVertexFormat.h"
  6. class VertexLoader_Normal
  7. {
  8. public:
  9. // Init
  10. static void Init();
  11. // GetSize
  12. static unsigned int GetSize(u64 _type, unsigned int _format,
  13. unsigned int _elements, unsigned int _index3);
  14. // GetFunction
  15. static TPipelineFunction GetFunction(u64 _type,
  16. unsigned int _format, unsigned int _elements, unsigned int _index3);
  17. private:
  18. enum ENormalType
  19. {
  20. NRM_NOT_PRESENT = 0,
  21. NRM_DIRECT = 1,
  22. NRM_INDEX8 = 2,
  23. NRM_INDEX16 = 3,
  24. NUM_NRM_TYPE
  25. };
  26. enum ENormalFormat
  27. {
  28. FORMAT_UBYTE = 0,
  29. FORMAT_BYTE = 1,
  30. FORMAT_USHORT = 2,
  31. FORMAT_SHORT = 3,
  32. FORMAT_FLOAT = 4,
  33. NUM_NRM_FORMAT
  34. };
  35. enum ENormalElements
  36. {
  37. NRM_NBT = 0,
  38. NRM_NBT3 = 1,
  39. NUM_NRM_ELEMENTS
  40. };
  41. enum ENormalIndices
  42. {
  43. NRM_INDICES1 = 0,
  44. NRM_INDICES3 = 1,
  45. NUM_NRM_INDICES
  46. };
  47. struct Set
  48. {
  49. template <typename T>
  50. void operator=(const T&)
  51. {
  52. gc_size = T::size;
  53. function = T::function;
  54. }
  55. int gc_size;
  56. TPipelineFunction function;
  57. };
  58. static Set m_Table[NUM_NRM_TYPE][NUM_NRM_INDICES][NUM_NRM_ELEMENTS][NUM_NRM_FORMAT];
  59. };