From 186aa04c9ed3a5a4d755bdcdd48ac6c942b577e3 Mon Sep 17 00:00:00 2001 From: CrushedPixel Date: Fri, 30 Oct 2015 12:35:01 +0100 Subject: [PATCH] Replace switch statement in ods.vert with if/else chain to support certain Intel Graphics Drivers --- .../assets/replaymod/shader/ods.vert | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/main/resources/assets/replaymod/shader/ods.vert b/src/main/resources/assets/replaymod/shader/ods.vert index 61fa8450..18912c3e 100644 --- a/src/main/resources/assets/replaymod/shader/ods.vert +++ b/src/main/resources/assets/replaymod/shader/ods.vert @@ -38,34 +38,27 @@ void main() { // Rotate for different cubic views float z; - switch (direction) { - case 0: // LEFT + if (direction == 0) { // LEFT z = position.z; position.z = position.x; position.x = -z; - break; - case 1: // RIGHT + } else if (direction == 1) { // RIGHT z = position.z; position.z = -position.x; position.x = z; - break; - case 2: // FRONT + } else if (direction == 2) { // FRONT // No changes required - break; - case 3: // BACK + } else if (direction == 3) { // BACK position.x = -position.x; position.z = -position.z; - break; - case 4: // TOP + } else if (direction == 4) { // TOP z = position.z; position.z = -position.y; position.y = z; - break; - case 5: // BOTTOM + } else if (direction == 5) { // BOTTOM z = position.z; position.z = position.y; position.y = -z; - break; } // Transform to screen space