/*
 * Copyright 2013 MovingBlocks
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.terasology.utilities;

import org.lwjgl.LWJGLUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.engine.paths.PathManager;
import org.terasology.rendering.oculusVr.OculusVrHelper;

/**
 * Helper class to have LWJGL loading logic in a central spot
 *
 * @author Rasmus 'Cervator' Praestholm - cervator@gmail.com
 */
public final class LWJGLHelper {

    private static final Logger logger = LoggerFactory.getLogger(LWJGLHelper.class);

    private LWJGLHelper() {
    }

    /**
     * Used on initializing the game environment, either for playing or for running unit tests
     */
    public static void initNativeLibs() {
        initLibraryPaths();

        try {
            initOculus();
        } catch (UnsatisfiedLinkError e) {
            logger.warn("Could not load optional TeraOVR native libraries - Oculus support disabled");
        }
    }
    
    private static void initLibraryPaths() {
        switch (LWJGLUtil.getPlatform()) {
            case LWJGLUtil.PLATFORM_MACOSX:
                NativeHelper.addLibraryPath(PathManager.getInstance().getNativesPath().resolve("macosx"));
                break;
            case LWJGLUtil.PLATFORM_LINUX:
                NativeHelper.addLibraryPath(PathManager.getInstance().getNativesPath().resolve("linux"));
                break;
            case LWJGLUtil.PLATFORM_WINDOWS:
                NativeHelper.addLibraryPath(PathManager.getInstance().getNativesPath().resolve("windows"));
                break;
            default:
                throw new UnsupportedOperationException("Unsupported operating system: " + LWJGLUtil.getPlatformName());
        }
    }

    private static void initOculus() {
        switch (LWJGLUtil.getPlatform()) {
            case LWJGLUtil.PLATFORM_WINDOWS:
                OculusVrHelper.loadNatives();
                break;
        }
    }
}

@@ -2299,38 +2299,34 @@
 lus() %7B%0A        
-switch
+if
  (LWJGLUtil.getP
@@ -2334,36 +2334,19 @@
 atform()
-) %7B%0A            case
+ ==
  LWJGLUt
@@ -2356,38 +2356,36 @@
 PLATFORM_WINDOWS
-:%0A    
+) %7B%0A
             Ocul
@@ -2410,39 +2410,16 @@
 ives();%0A
-                break;%0A
         

Replace switch with only one case with if statement