mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-24 16:48:18 -05:00
Fixed GCC warnings.
This commit is contained in:
parent
88162a78cc
commit
45e14926d2
2 changed files with 9 additions and 9 deletions
|
@ -59,7 +59,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
|
||||
TrueTypeHandle fontFiles[fontCount];
|
||||
FontHandle fonts[fontCount];
|
||||
for (int32_t ii = 0; ii < fontCount; ++ii)
|
||||
for (uint32_t ii = 0; ii < fontCount; ++ii)
|
||||
{
|
||||
//instantiate a usable font
|
||||
fontFiles[ii] = fontManager->loadTrueTypeFromFile(fontNames[ii]);
|
||||
|
@ -83,7 +83,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
//the pen position represent the top left of the box of the first line of text
|
||||
textBufferManager->setPenPosition(staticText, 24.0f, 100.0f);
|
||||
|
||||
for (int32_t ii = 0; ii < fontCount; ++ii)
|
||||
for (uint32_t ii = 0; ii < fontCount; ++ii)
|
||||
{
|
||||
//add some text to the buffer
|
||||
textBufferManager->appendText(staticText, fonts[ii], L"The quick brown fox jumps over the lazy dog\n");
|
||||
|
|
|
@ -278,16 +278,16 @@ void TextBuffer::appendText(FontHandle _fontHandle, const char* _string)
|
|||
m_lineAscender = 0; //font.m_ascender;
|
||||
}
|
||||
|
||||
uint32_t codepoint;
|
||||
CodePoint_t codepoint = 0;
|
||||
uint32_t state = 0;
|
||||
|
||||
for (; *_string; ++_string)
|
||||
{
|
||||
if (!utf8_decode(&state, &codepoint, *_string) )
|
||||
if (!utf8_decode(&state, (uint32_t*)&codepoint, *_string) )
|
||||
{
|
||||
if (m_fontManager->getGlyphInfo(_fontHandle, (CodePoint_t)codepoint, glyph) )
|
||||
if (m_fontManager->getGlyphInfo(_fontHandle, codepoint, glyph) )
|
||||
{
|
||||
appendGlyph( (CodePoint_t)codepoint, font, glyph);
|
||||
appendGlyph(codepoint, font, glyph);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -296,8 +296,6 @@ void TextBuffer::appendText(FontHandle _fontHandle, const char* _string)
|
|||
}
|
||||
}
|
||||
|
||||
//printf("U+%04X\n", codepoint);
|
||||
|
||||
if (state != UTF8_ACCEPT)
|
||||
{
|
||||
// assert(false && "The string is not well-formed");
|
||||
|
@ -558,7 +556,9 @@ void TextBuffer::verticalCenterLastLine(float _dy, float _top, float _bottom)
|
|||
}
|
||||
}
|
||||
|
||||
TextBufferManager::TextBufferManager(FontManager* _fontManager) : m_fontManager(_fontManager), m_textBufferHandles(MAX_TEXT_BUFFER_COUNT)
|
||||
TextBufferManager::TextBufferManager(FontManager* _fontManager)
|
||||
: m_textBufferHandles(MAX_TEXT_BUFFER_COUNT)
|
||||
, m_fontManager(_fontManager)
|
||||
{
|
||||
m_textBuffers = new BufferCache[MAX_TEXT_BUFFER_COUNT];
|
||||
|
||||
|
|
Loading…
Reference in a new issue