| 
									
										
										
										
											2015-05-24 06:55:12 +02:00
										 |  |  | // Copyright 2008 Dolphin Emulator Project
 | 
					
						
							| 
									
										
										
										
											2015-05-18 01:08:10 +02:00
										 |  |  | // Licensed under GPLv2+
 | 
					
						
							| 
									
										
										
										
											2013-04-17 23:09:55 -04:00
										 |  |  | // Refer to the license.txt file included.
 | 
					
						
							| 
									
										
										
										
											2008-12-08 04:46:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-10 13:54:46 -05:00
										 |  |  | #pragma once
 | 
					
						
							| 
									
										
										
										
											2008-12-08 04:46:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-17 16:54:31 -05:00
										 |  |  | #include "Common/CommonTypes.h"
 | 
					
						
							| 
									
										
										
										
											2008-12-08 04:46:09 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class VertexLoader_Normal | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |   // Init
 | 
					
						
							|  |  |  |   static void Init(); | 
					
						
							| 
									
										
										
										
											2008-12-08 04:46:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02: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 10:43:46 +02: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 10:43:46 +02:00
										 |  |  |   enum ENormalType | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     NRM_NOT_PRESENT = 0, | 
					
						
							|  |  |  |     NRM_DIRECT = 1, | 
					
						
							|  |  |  |     NRM_INDEX8 = 2, | 
					
						
							|  |  |  |     NRM_INDEX16 = 3, | 
					
						
							|  |  |  |     NUM_NRM_TYPE | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2013-03-19 21:51:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |   enum ENormalFormat | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     FORMAT_UBYTE = 0, | 
					
						
							|  |  |  |     FORMAT_BYTE = 1, | 
					
						
							|  |  |  |     FORMAT_USHORT = 2, | 
					
						
							|  |  |  |     FORMAT_SHORT = 3, | 
					
						
							|  |  |  |     FORMAT_FLOAT = 4, | 
					
						
							|  |  |  |     NUM_NRM_FORMAT | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2013-03-19 21:51:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |   enum ENormalElements | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     NRM_NBT = 0, | 
					
						
							|  |  |  |     NRM_NBT3 = 1, | 
					
						
							|  |  |  |     NUM_NRM_ELEMENTS | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2008-12-08 04:46:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |   enum ENormalIndices | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     NRM_INDICES1 = 0, | 
					
						
							|  |  |  |     NRM_INDICES3 = 1, | 
					
						
							|  |  |  |     NUM_NRM_INDICES | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2008-12-08 04:46:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |   struct Set | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     template <typename T> | 
					
						
							|  |  |  |     void operator=(const T&) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       gc_size = T::size; | 
					
						
							|  |  |  |       function = T::function; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2013-10-29 01:23:17 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |     int gc_size; | 
					
						
							|  |  |  |     TPipelineFunction function; | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2008-12-08 04:46:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02: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
										 |  |  | }; |