Merge pull request #6177 from rokuz/small-hotfixes

Hotfix in framebuffer and warning fix
This commit is contained in:
Daria Volvenkova 2017-06-01 17:47:36 +03:00 committed by GitHub
commit 7d23a05327
2 changed files with 6 additions and 5 deletions

View file

@ -75,8 +75,8 @@ Framebuffer::Framebuffer(uint32_t colorFormat)
}
Framebuffer::Framebuffer(uint32_t colorFormat, bool stencilEnabled)
: m_colorFormat(colorFormat)
, m_depthStencil(make_unique_dp<dp::Framebuffer::DepthStencil>(stencilEnabled))
: m_depthStencil(make_unique_dp<dp::Framebuffer::DepthStencil>(stencilEnabled))
, m_colorFormat(colorFormat)
{
ApplyOwnDepthStencil();
}
@ -121,7 +121,7 @@ void Framebuffer::SetSize(uint32_t width, uint32_t height)
m_colorTextureId = GLFunctions::glGenTexture();
GLFunctions::glBindTexture(m_colorTextureId);
GLFunctions::glTexImage2D(m_width, m_height, gl_const::GLRGBA, gl_const::GLUnsignedByteType,
GLFunctions::glTexImage2D(m_width, m_height, m_colorFormat, gl_const::GLUnsignedByteType,
nullptr);
GLFunctions::glTexParameter(gl_const::GLMagFilter, gl_const::GLLinear);
GLFunctions::glTexParameter(gl_const::GLMinFilter, gl_const::GLLinear);

View file

@ -49,8 +49,9 @@ void IconsInfo::SetSourceFile(std::string const & fileName)
auto const pos = icon.find(kDelimiter);
if (pos == std::string::npos)
return;
uint32_t index = 0;
strings::to_uint(icon.substr(0, pos), index);
uint32_t index;
if (!strings::to_uint(icon.substr(0, pos), index))
index = 0;
icons[static_cast<uint16_t>(index)] = icon;
});