Replace switch statement in ods.vert with if/else chain to support certain Intel Graphics Drivers
This commit is contained in:
@@ -38,34 +38,27 @@ void main() {
|
|||||||
|
|
||||||
// Rotate for different cubic views
|
// Rotate for different cubic views
|
||||||
float z;
|
float z;
|
||||||
switch (direction) {
|
if (direction == 0) { // LEFT
|
||||||
case 0: // LEFT
|
|
||||||
z = position.z;
|
z = position.z;
|
||||||
position.z = position.x;
|
position.z = position.x;
|
||||||
position.x = -z;
|
position.x = -z;
|
||||||
break;
|
} else if (direction == 1) { // RIGHT
|
||||||
case 1: // RIGHT
|
|
||||||
z = position.z;
|
z = position.z;
|
||||||
position.z = -position.x;
|
position.z = -position.x;
|
||||||
position.x = z;
|
position.x = z;
|
||||||
break;
|
} else if (direction == 2) { // FRONT
|
||||||
case 2: // FRONT
|
|
||||||
// No changes required
|
// No changes required
|
||||||
break;
|
} else if (direction == 3) { // BACK
|
||||||
case 3: // BACK
|
|
||||||
position.x = -position.x;
|
position.x = -position.x;
|
||||||
position.z = -position.z;
|
position.z = -position.z;
|
||||||
break;
|
} else if (direction == 4) { // TOP
|
||||||
case 4: // TOP
|
|
||||||
z = position.z;
|
z = position.z;
|
||||||
position.z = -position.y;
|
position.z = -position.y;
|
||||||
position.y = z;
|
position.y = z;
|
||||||
break;
|
} else if (direction == 5) { // BOTTOM
|
||||||
case 5: // BOTTOM
|
|
||||||
z = position.z;
|
z = position.z;
|
||||||
position.z = position.y;
|
position.z = position.y;
|
||||||
position.y = -z;
|
position.y = -z;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transform to screen space
|
// Transform to screen space
|
||||||
|
|||||||
Reference in New Issue
Block a user