NzString::Clear now takes an optional argument

Fixed NzString::ToDouble rejecting legal strings
NzString::Clear can now keep the internal buffer to improve performances
NzStringToNumber now takes an optional argument to check if the
conversion went well
Optimized NzString::ToInteger
This commit is contained in:
Lynix
2012-07-01 00:44:53 +02:00
parent d97e4a7f43
commit 7ed9e16664
5 changed files with 37 additions and 13 deletions

View File

@@ -98,6 +98,7 @@ bool NzGLSLShader::Compile()
glGetProgramiv(m_program, GL_INFO_LOG_LENGTH, &length);
if (length > 1)
{
m_log.Clear(true);
m_log.Reserve(length+19-1); // La taille retournée est celle du buffer (Avec caractère de fin)
m_log.Prepend("Linkage error: ");
m_log.Resize(length+19-1); // Extension du buffer d'écriture pour ajouter le log
@@ -129,7 +130,7 @@ bool NzGLSLShader::Create()
glBindAttribLocation(m_program, attribIndex[nzElementUsage_Diffuse], "Diffuse");
glBindAttribLocation(m_program, attribIndex[nzElementUsage_Tangent], "Tangent");
NzString uniformName = "TexCoordi";
NzString uniformName = "TexCoord*";
for (unsigned int i = 0; i < 8; ++i)
{
uniformName[8] = '0'+i;
@@ -242,6 +243,7 @@ bool NzGLSLShader::Load(nzShaderType type, const NzString& source)
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
if (length > 1)
{
m_log.Clear(true);
m_log.Reserve(length+19-1); // La taille retournée est celle du buffer (Avec caractère de fin)
m_log.Prepend("Compilation error: ");
m_log.Resize(length+19-1); // Extension du buffer d'écriture pour ajouter le log