| 62 | |
| 63 | #if WITH_GRANNY |
| 64 | void GetMeshVertexPosition( granny_mesh* grannyMesh, unsigned index, Vector3& position, unsigned grannyBytesPerVertex, unsigned positionOffset, Tr2VertexDefinition::DataType positionType ) |
| 65 | { |
| 66 | if( !grannyBytesPerVertex ) |
| 67 | { |
| 68 | return; |
| 69 | } |
| 70 | |
| 71 | granny_uint8* positionPtr = grannyMesh->PrimaryVertexData->Vertices + index * grannyBytesPerVertex + positionOffset; |
| 72 | |
| 73 | switch( positionType ) |
| 74 | { |
| 75 | case Tr2VertexDefinition::FLOAT16_4: |
| 76 | position = *reinterpret_cast<const Vector3_16*>( positionPtr ); |
| 77 | break; |
| 78 | |
| 79 | case Tr2VertexDefinition::FLOAT32_3: |
| 80 | memcpy( &position, positionPtr, 12 ); |
| 81 | break; |
| 82 | |
| 83 | case Tr2VertexDefinition::SHORT_4: |
| 84 | ConvertShort4ToVector3( positionPtr, &position ); |
| 85 | break; |
| 86 | |
| 87 | default: |
| 88 | CCP_ASSERT_M( false, "Unsupported position type in GetMeshVertexPosition" ); |
| 89 | break; |
| 90 | } |
| 91 | } |
| 92 | #endif |
| 93 | |
| 94 | const char* VertexDeclTypeToString( Tr2VertexDefinition::DataType type ) |
no test coverage detected