From 9fdebdce7a8448f35c67e7c97580d77375266d2e Mon Sep 17 00:00:00 2001 From: widelec-BB <5738944+widelec-BB@users.noreply.github.com> Date: Sun, 24 Apr 2022 15:02:24 +0200 Subject: [PATCH] Fix loading tranlations on big endian platforms --- Source/utils/language.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/utils/language.cpp b/Source/utils/language.cpp index c243289bc..58db5c3fa 100644 --- a/Source/utils/language.cpp +++ b/Source/utils/language.cpp @@ -363,11 +363,13 @@ void LanguageInitialize() SDL_RWclose(rw); return; } - // FIXME: Endianness. if (static_cast(SDL_RWread(rw, src.get(), sizeof(MoEntry), head.nbMappings)) != head.nbMappings) { SDL_RWclose(rw); return; } + for (size_t i = 0; i < head.nbMappings; ++i) { + SwapLE(src[i]); + } // Read entries of target strings std::unique_ptr dst { new MoEntry[head.nbMappings] };