Fixed several detail mesh issues. Fixed issue 106.

This commit is contained in:
Mikko Mononen
2010-09-17 10:20:08 +00:00
parent 8a2963bce0
commit e1355c4a33
11 changed files with 1403 additions and 161 deletions

View File

@@ -43,14 +43,16 @@ void BuildContext::doLog(const rcLogCategory category, const char* msg, const in
int n = TEXT_POOL_SIZE - m_textPoolSize;
if (n < 2)
return;
char* cat = dst;
char* text = dst+1;
const int maxtext = n-1;
// Store category
*dst = (char)category;
n--;
*cat = (char)category;
// Store message
const int count = rcMin(len+1, n);
memcpy(dst+1, msg, count);
dst[count+1] = '\0';
m_textPoolSize += count+1;
const int count = rcMin(len+1, maxtext);
memcpy(text, msg, count);
text[count-1] = '\0';
m_textPoolSize += 1 + count;
m_messages[m_messageCount++] = dst;
}