Codechange: reduce code duplication

This commit is contained in:
glx22
2022-12-22 19:41:58 +01:00
committed by Loïc Guilloux
parent 7b5edba76c
commit af3df959c2
6 changed files with 32 additions and 42 deletions

View File

@@ -70,16 +70,9 @@ bool GetFontAAState(FontSize size, bool check_blitter)
/* AA is only supported for 32 bpp */
if (check_blitter && BlitterFactory::GetCurrentBlitter()->GetScreenDepth() != 32) return false;
switch (size) {
default: NOT_REACHED();
case FS_NORMAL: return _fcsettings.medium.aa;
case FS_SMALL: return _fcsettings.small.aa;
case FS_LARGE: return _fcsettings.large.aa;
case FS_MONO: return _fcsettings.mono.aa;
}
return GetFontCacheSubSetting(size)->aa;
}
/**
* (Re)initialize the font cache related things, i.e. load the non-sprite fonts.
* @param monospace Whether to initialise the monospace or regular fonts.