1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-16 08:42:23 +00:00

Merge branch 'sizeof_float' into 'master'

Use sizeof(GLfloat) instead of sizeof(GL_FLOAT)

See merge request OpenMW/openmw!928
This commit is contained in:
psi29a 2021-06-06 09:37:17 +00:00
commit c7f8a4faae

View File

@ -158,7 +158,7 @@ namespace SceneUtil
static constexpr int queryBlockSize(int sz) static constexpr int queryBlockSize(int sz)
{ {
return 3 * osg::Vec4::num_components * sizeof(GL_FLOAT) * sz; return 3 * osg::Vec4::num_components * sizeof(GLfloat) * sz;
} }
void setCachedSunPos(const osg::Vec4& pos) void setCachedSunPos(const osg::Vec4& pos)
@ -215,9 +215,9 @@ namespace SceneUtil
} }
Offsets(int offsetColors, int offsetPosition, int offsetAttenuationRadius, int stride) Offsets(int offsetColors, int offsetPosition, int offsetAttenuationRadius, int stride)
: mStride((offsetAttenuationRadius + sizeof(GL_FLOAT) * osg::Vec4::num_components + stride) / 4) : mStride((offsetAttenuationRadius + sizeof(GLfloat) * osg::Vec4::num_components + stride) / 4)
{ {
constexpr auto sizeofFloat = sizeof(GL_FLOAT); constexpr auto sizeofFloat = sizeof(GLfloat);
const auto diffuseOffset = offsetColors / sizeofFloat; const auto diffuseOffset = offsetColors / sizeofFloat;
mValues[Diffuse] = diffuseOffset; mValues[Diffuse] = diffuseOffset;