fixed: don't render anything at all if a char can't be found, this also prevents allocating an extra element in the map
This commit is contained in:
parent
4c368d2735
commit
f175fa9b3c
1 changed files with 17 additions and 13 deletions
|
@ -366,7 +366,10 @@ void CBitVis::SetText(uint8_t* buff, const char* str, int offset /*= 0*/)
|
|||
int pixlength = 0;
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
vector<unsigned int>& dchar = m_glyphs[str[i]];
|
||||
map<char, vector<unsigned int> >::iterator it = m_glyphs.find(str[i]);
|
||||
vector<unsigned int>& dchar = it->second;
|
||||
if (it != m_glyphs.end())
|
||||
{
|
||||
for (size_t j = 0; j < dchar.size(); j++)
|
||||
{
|
||||
if (charpos >= 0 && charpos < m_nrcolumns)
|
||||
|
@ -387,6 +390,7 @@ void CBitVis::SetText(uint8_t* buff, const char* str, int offset /*= 0*/)
|
|||
pixlength++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pixlength > m_nrcolumns && GetTimeUs() - m_songupdatetime > 2000000)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue