From ec6c80d170c4a30e76abc22c889aa8cf27fb45a4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Sep 2017 04:57:15 +0300 Subject: Remove default parameter from font constructor and load function. --- src/gui/fonts/font.h | 4 ++-- src/gui/gui.cpp | 16 ++++++++-------- src/progs/manaplus/actions/actions.cpp | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/fonts/font.h b/src/gui/fonts/font.h index f4f30a8be..4f3670374 100644 --- a/src/gui/fonts/font.h +++ b/src/gui/fonts/font.h @@ -90,7 +90,7 @@ class Font final public: Font(std::string filename, int size, - const int style = 0); + const int style); A_DELETE_COPY(Font) @@ -98,7 +98,7 @@ class Font final void loadFont(std::string filename, const int size, - const int style = 0) restrict2; + const int style) restrict2; int getWidth(const std::string &text) const restrict2 A_WARN_UNUSED; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 706a5f0b8..c5d6bc95c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -193,7 +193,7 @@ void Gui::postInit(Graphics *const graphics) if (fontFile.empty()) fontFile = branding.getStringValue("font"); - mGuiFont = new Font(fontFile, fontSize); + mGuiFont = new Font(fontFile, fontSize, TTF_STYLE_NORMAL); // Set particle font fontFile = config.getValue("particleFont", ""); @@ -219,21 +219,21 @@ void Gui::postInit(Graphics *const graphics) if (fontFile.empty()) fontFile = branding.getStringValue("boldFont"); - boldFont = new Font(fontFile, fontSize); + boldFont = new Font(fontFile, fontSize, TTF_STYLE_NORMAL); // Set help font fontFile = config.getValue("helpFont", ""); if (fontFile.empty()) fontFile = branding.getStringValue("helpFont"); - mHelpFont = new Font(fontFile, fontSize); + mHelpFont = new Font(fontFile, fontSize, TTF_STYLE_NORMAL); // Set secure font fontFile = config.getValue("secureFont", ""); if (fontFile.empty()) fontFile = branding.getStringValue("secureFont"); - mSecureFont = new Font(fontFile, fontSize); + mSecureFont = new Font(fontFile, fontSize, TTF_STYLE_NORMAL); // Set npc font const int npcFontSize = config.getIntValue("npcfontSize"); @@ -253,7 +253,7 @@ void Gui::postInit(Graphics *const graphics) if (fontFile.empty()) fontFile = branding.getStringValue("npcFont"); - mNpcFont = new Font(fontFile, npcFontSize); + mNpcFont = new Font(fontFile, npcFontSize, TTF_STYLE_NORMAL); Widget::setGlobalFont(mGuiFont); @@ -816,7 +816,7 @@ void Gui::updateFonts() if (fontFile.empty()) fontFile = branding.getStringValue("font"); - mGuiFont->loadFont(fontFile, fontSize); + mGuiFont->loadFont(fontFile, fontSize, TTF_STYLE_NORMAL); fontFile = config.getValue("particleFont", ""); if (fontFile.empty()) @@ -828,7 +828,7 @@ void Gui::updateFonts() if (fontFile.empty()) fontFile = branding.getStringValue("boldFont"); - boldFont->loadFont(fontFile, fontSize); + boldFont->loadFont(fontFile, fontSize, TTF_STYLE_NORMAL); const int npcFontSize = config.getIntValue("npcfontSize"); @@ -836,7 +836,7 @@ void Gui::updateFonts() if (fontFile.empty()) fontFile = branding.getStringValue("npcFont"); - mNpcFont->loadFont(fontFile, npcFontSize); + mNpcFont->loadFont(fontFile, npcFontSize, TTF_STYLE_NORMAL); } void Gui::distributeMouseEvent(Widget *const source, diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp index 458332fb0..0827418c7 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaplus/actions/actions.cpp @@ -1478,7 +1478,7 @@ impHandler(dumpMods) #if defined USE_OPENGL && defined DEBUG_SDLFONT impHandler0(testSdlFont) { - Font *font = new Font("fonts/dejavusans.ttf", 18); + Font *font = new Font("fonts/dejavusans.ttf", 18, TTF_STYLE_NORMAL); timespec time1; timespec time2; NullOpenGLGraphics *nullGraphics = new NullOpenGLGraphics; -- cgit v1.2.3-60-g2f50