Move #if #else #endif for convenience

This is a convenience change. The double '{' created by the #else messes
up Xcode autoindentation.
It won't that way and the fact that useClientState is a const set to
false when SUPPORT_LEGACY_OPENGL, the code inside the if should still
get optimised out by the compiler.
This commit is contained in:
Atlante45 2015-05-25 11:45:16 +02:00
parent 3d7a834356
commit 526ec3d489

View file

@ -66,22 +66,23 @@ void GLBackend::updateInput() {
newActivation.set(attrib._slot);
}
}
// Manage Activation what was and what is expected now
for (unsigned int i = 0; i < newActivation.size(); i++) {
bool newState = newActivation[i];
if (newState != _input._attributeActivation[i]) {
#if defined(SUPPORT_LEGACY_OPENGL)
if (i < NUM_CLASSIC_ATTRIBS) {
const bool useClientState = i < NUM_CLASSIC_ATTRIBS;
#else
const bool useClientState = false;
#endif
if (useClientState) {
if (newState) {
glEnableClientState(attributeSlotToClassicAttribName[i]);
} else {
glDisableClientState(attributeSlotToClassicAttribName[i]);
}
} else {
#else
{
#endif
if (newState) {
glEnableVertexAttribArray(i);
} else {
@ -89,7 +90,7 @@ void GLBackend::updateInput() {
}
}
(void) CHECK_GL_ERROR();
_input._attributeActivation.flip(i);
}
}
@ -123,8 +124,12 @@ void GLBackend::updateInput() {
GLenum type = _elementTypeToGLType[attrib._element.getType()];
GLuint stride = strides[bufferNum];
GLuint pointer = attrib._offset + offsets[bufferNum];
#if defined(SUPPORT_LEGACY_OPENGL)
if (slot < NUM_CLASSIC_ATTRIBS) {
#if defined(SUPPORT_LEGACY_OPENGL)
const bool useClientState = i < NUM_CLASSIC_ATTRIBS;
#else
const bool useClientState = false;
#endif
if (useClientState) {
switch (slot) {
case Stream::POSITION:
glVertexPointer(count, type, stride, reinterpret_cast<GLvoid*>(pointer));
@ -140,9 +145,6 @@ void GLBackend::updateInput() {
break;
};
} else {
#else
{
#endif
GLboolean isNormalized = attrib._element.isNormalized();
glVertexAttribPointer(slot, count, type, isNormalized, stride,
reinterpret_cast<GLvoid*>(pointer));