From d36fd4f42ba52ccc03eb6d81d4af8b9a477088be Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 28 May 2021 00:46:19 +0200 Subject: [PATCH] - fixed: GetColorTranslation did not handle translation-less single pic 'fonts' properly. --- src/common/fonts/font.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/fonts/font.cpp b/src/common/fonts/font.cpp index 8421ab92b6..ff2279e348 100644 --- a/src/common/fonts/font.cpp +++ b/src/common/fonts/font.cpp @@ -656,6 +656,10 @@ int FFont::GetLuminosity (uint32_t *colorsused, TArray &Luminosity, int* int FFont::GetColorTranslation (EColorRange range, PalEntry *color) const { + // Single pic fonts don not set up their translation table and must always return 0. + if (Translations.Size() == 0) return 0; + assert(Translations.Size() == NumTextColors); + if (noTranslate) { PalEntry retcolor = PalEntry(255, 255, 255, 255);