summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/font/font_manager.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-09-03 13:30:42 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-09-03 13:30:42 +0200
commitd193abb0ad0827d5ecc0915d65b67faf68a87097 (patch)
tree9a750cfbd4d229c4607f4d9aaf76dea89944a0bd /3rdparty/bgfx/examples/common/font/font_manager.cpp
parentd8cd5ca1346607349be6777d29358acef1e4517c (diff)
Update BGFX and BX packages and update MAME code to support new API (nw)
Generated missing shaders (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/font/font_manager.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/font/font_manager.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/3rdparty/bgfx/examples/common/font/font_manager.cpp b/3rdparty/bgfx/examples/common/font/font_manager.cpp
index 1d688a81503..40fbe5a5ec5 100644
--- a/3rdparty/bgfx/examples/common/font/font_manager.cpp
+++ b/3rdparty/bgfx/examples/common/font/font_manager.cpp
@@ -466,7 +466,7 @@ FontManager::FontManager(Atlas* _atlas)
init();
}
-FontManager::FontManager(uint32_t _textureSideWidth)
+FontManager::FontManager(uint16_t _textureSideWidth)
: m_ownAtlas(true)
, m_atlas(new Atlas(_textureSideWidth) )
{
@@ -546,8 +546,8 @@ FontHandle FontManager::createFontByPixelSize(TrueTypeHandle _ttfHandle, uint32_
CachedFont& font = m_cachedFonts[fontIdx];
font.trueTypeFont = ttf;
font.fontInfo = ttf->getFontInfo();
- font.fontInfo.fontType = _fontType;
- font.fontInfo.pixelSize = _pixelSize;
+ font.fontInfo.fontType = int16_t(_fontType);
+ font.fontInfo.pixelSize = uint16_t(_pixelSize);
font.cachedGlyphs.clear();
font.masterFontHandle.idx = bx::HandleAlloc::invalid;
@@ -561,15 +561,15 @@ FontHandle FontManager::createScaledFontToPixelSize(FontHandle _baseFontHandle,
CachedFont& baseFont = m_cachedFonts[_baseFontHandle.idx];
FontInfo& fontInfo = baseFont.fontInfo;
- FontInfo newFontInfo = fontInfo;
- newFontInfo.pixelSize = _pixelSize;
- newFontInfo.scale = (float)_pixelSize / (float) fontInfo.pixelSize;
- newFontInfo.ascender = (newFontInfo.ascender * newFontInfo.scale);
+ FontInfo newFontInfo = fontInfo;
+ newFontInfo.pixelSize = uint16_t(_pixelSize);
+ newFontInfo.scale = (float)_pixelSize / (float) fontInfo.pixelSize;
+ newFontInfo.ascender = (newFontInfo.ascender * newFontInfo.scale);
newFontInfo.descender = (newFontInfo.descender * newFontInfo.scale);
- newFontInfo.lineGap = (newFontInfo.lineGap * newFontInfo.scale);
- newFontInfo.maxAdvanceWidth = (newFontInfo.maxAdvanceWidth * newFontInfo.scale);
+ newFontInfo.lineGap = (newFontInfo.lineGap * newFontInfo.scale);
+ newFontInfo.maxAdvanceWidth = (newFontInfo.maxAdvanceWidth * newFontInfo.scale);
newFontInfo.underlineThickness = (newFontInfo.underlineThickness * newFontInfo.scale);
- newFontInfo.underlinePosition = (newFontInfo.underlinePosition * newFontInfo.scale);
+ newFontInfo.underlinePosition = (newFontInfo.underlinePosition * newFontInfo.scale);
uint16_t fontIdx = m_fontHandles.alloc();
BX_CHECK(fontIdx != bx::HandleAlloc::invalid, "Invalid handle used");