Merge remote-tracking branch 'origin/master' into bumpy

This commit is contained in:
hiker 2014-08-04 14:29:31 +10:00
commit 7e65d4d346
4 changed files with 22 additions and 2 deletions

View File

@ -598,6 +598,11 @@ void glUniform1fWrapper(GLuint a, float b)
glUniform1f(a, b);
}
bool needsUBO()
{
return irr_driver->needUBOWorkaround();
}
namespace MeshShader
{
// Solid Normal and depth pass shaders

View File

@ -53,6 +53,7 @@ void glUniformMatrix4fvWraper(GLuint, size_t, unsigned, const float *mat);
void glUniform3fWraper(GLuint, float, float, float);
void glUniform2fWraper(GLuint a, float b, float c);
void glUniform1fWrapper(GLuint, float);
bool needsUBO();
struct UniformHelper
{
@ -128,7 +129,7 @@ public:
void setUniforms(const Args & ... args) const
{
if (irr_driver->needUBOWorkaround())
if (needsUBO())
bypassUBO(Program);
UniformHelper::setUniformsHelper(uniforms, args...);
}
@ -158,7 +159,7 @@ public:
void setUniforms(const Args & ... args) const
{
if (irr_driver->needUBOWorkaround())
if (needsUBO())
bypassUBO(Program);
UniformHelper::setUniformsHelper(uniforms, args...);
}

View File

@ -33,6 +33,18 @@ STKTextBillboard::STKTextBillboard(core::stringw text, gui::ScalableFont* font,
updateAbsolutePosition();
}
void STKTextBillboard::updateAbsolutePosition()
{
if (Parent)
{
// Override to not use the parent's rotation
AbsoluteTransformation = getRelativeTransformation();
AbsoluteTransformation.setTranslation(AbsoluteTransformation.getTranslation() + Parent->getAbsolutePosition());
}
else
AbsoluteTransformation = getRelativeTransformation();
}
scene::IMesh* STKTextBillboard::getTextMesh(core::stringw text, gui::ScalableFont* font)
{
font->doDraw(text, core::rect<s32>(0, 0, 1000, 1000), video::SColor(255,255,255,255),

View File

@ -62,6 +62,8 @@ public:
const irr::core::rect<irr::s32>& destRect,
const irr::core::rect<irr::s32>& sourceRect,
const irr::video::SColor* const colors);
virtual void updateAbsolutePosition() OVERRIDE;
};
#endif