From 6de5ff8f7d54e3fc7db0f91ff7599fb0540e2133 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Mon, 30 Dec 2019 08:30:34 -0500 Subject: [PATCH] Fixed UV coordinate swapped twice in big endian. --- code/MD3/MD3Loader.cpp | 2 +- code/MDC/MDCLoader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/MD3/MD3Loader.cpp b/code/MD3/MD3Loader.cpp index 1e78b6e05..7d6c7ef4b 100644 --- a/code/MD3/MD3Loader.cpp +++ b/code/MD3/MD3Loader.cpp @@ -973,7 +973,7 @@ void MD3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOS AI_SWAP2( pcVertices[i].Z ); AI_SWAP4( pcUVs[i].U ); - AI_SWAP4( pcUVs[i].U ); + AI_SWAP4( pcUVs[i].V ); } for (uint32_t i = 0; i < pcSurfaces->NUM_TRIANGLES;++i) { AI_SWAP4(pcTriangles[i].INDEXES[0]); diff --git a/code/MDC/MDCLoader.cpp b/code/MDC/MDCLoader.cpp index 084ec6024..42e1877f3 100644 --- a/code/MDC/MDCLoader.cpp +++ b/code/MDC/MDCLoader.cpp @@ -355,7 +355,7 @@ void MDCImporter::InternReadFile( // swap all texture coordinates for (unsigned int i = 0; i < pcSurface->ulNumVertices;++i) { - AI_SWAP4( pcUVs->v ); + AI_SWAP4( pcUVs->u ); AI_SWAP4( pcUVs->v ); }