Package org.terasology.config

Examples of org.terasology.config.Config


public class ShaderParametersDebug extends ShaderParametersBase {

    public void applyParameters(Material program) {
        super.applyParameters(program);

        Config config = CoreRegistry.get(Config.class);

        int texId = 0;

        switch (config.getRendering().getDebug().getStage()) {
            case SHADOW_MAP:
                GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
                DefaultRenderingProcess.getInstance().bindFboDepthTexture("sceneShadowMap");
                program.setInt("texDebug", texId++, true);
                break;
View Full Code Here


        if (Files.isRegularFile(Config.getConfigFile())) {
            try {
                config = Config.load(Config.getConfigFile());
            } catch (IOException e) {
                logger.error("Failed to load config", e);
                config = new Config();
            }
        } else {
            config = new Config();
        }
        if (!config.getDefaultModSelection().hasModule(TerasologyConstants.CORE_MODULE)) {
            config.getDefaultModSelection().addModule(TerasologyConstants.CORE_MODULE);
        }
View Full Code Here

        try {
            if (state) {
                Display.setDisplayMode(Display.getDesktopDisplayMode());
                Display.setFullscreen(true);
            } else {
                Config config = CoreRegistry.get(Config.class);
                Display.setDisplayMode(config.getRendering().getDisplayMode());
                Display.setResizable(true);
            }
        } catch (LWJGLException e) {
            throw new RuntimeException("Can not initialize graphics device.", e);
        }
View Full Code Here

        moduleManager = ModuleManagerFactory.create();
        networkSystem = mock(NetworkSystem.class);
        when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
        CoreRegistry.put(ModuleManager.class, moduleManager);
        CoreRegistry.put(Config.class, new Config());
        CoreRegistry.put(AssetManager.class, new AssetManager(moduleManager.getEnvironment()));
        CoreRegistry.put(NetworkSystem.class, networkSystem);

        entityManager = new EntitySystemBuilder().build(moduleManager.getEnvironment(), networkSystem,
                new ReflectionReflectFactory());
View Full Code Here

            channelHandlerContext.getChannel().write(builder.build());
        }
    }

    private void sendJoin() {
        Config config = CoreRegistry.get(Config.class);
        NetData.JoinMessage.Builder bldr = NetData.JoinMessage.newBuilder();
        NetData.Color.Builder clrbldr = NetData.Color.newBuilder();

        bldr.setName(config.getPlayer().getName());
        bldr.setViewDistanceLevel(config.getRendering().getViewDistance().getIndex());
        bldr.setColor(clrbldr.setRgba(config.getPlayer().getColor().rgba()).build());

        channelHandlerContext.getChannel().write(NetData.NetMessage.newBuilder().setJoin(bldr).build());
    }
View Full Code Here

    public IntMathTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
        Config config = new Config();
        CoreRegistry.put(Config.class, config);
    }
View Full Code Here

        CoreRegistry.put(AudioManager.class, audioManager);
    }

    @Override
    protected void setupConfig() {
        Config config = new Config();
        CoreRegistry.put(Config.class, config);
    }
View Full Code Here

        }
    }

    @Test
    public void regionPositions() {
        CoreRegistry.put(Config.class, new Config());

        assertEquals(1, TeraMath.calcChunkPos(Region3i.createFromMinMax(new Vector3i(0, 0, 0), new Vector3i(0, 0, 0))).length);
        assertEquals(1, TeraMath.calcChunkPos(Region3i.createFromMinMax(new Vector3i(0, 0, 0), new Vector3i(31, 63, 31))).length);
        assertEquals(2, TeraMath.calcChunkPos(Region3i.createFromMinMax(new Vector3i(0, 0, 0), new Vector3i(32, 63, 31))).length);
        assertEquals(4, TeraMath.calcChunkPos(Region3i.createFromMinMax(new Vector3i(0, 0, 0), new Vector3i(32, 63, 32))).length);
View Full Code Here

    }

    @Override
    public boolean step() {
        try {
            Config config = CoreRegistry.get(Config.class);
            int port = config.getNetwork().getServerPort();
            CoreRegistry.get(NetworkSystem.class).host(port, dedicated);
        } catch (HostingFailedException e) {
            CoreRegistry.get(NUIManager.class).pushScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage("Failed to Host",
                    e.getMessage() + " - Reverting to single player");
        }
View Full Code Here

        preProcessorPreamble += "#define SSAO_KERNEL_ELEMENTS " + ShaderParametersSSAO.SSAO_KERNEL_ELEMENTS + "\n";
        preProcessorPreamble += "#define SSAO_NOISE_SIZE " + ShaderParametersSSAO.SSAO_NOISE_SIZE + "\n";
        // TODO: This shouldn't be hardcoded
        preProcessorPreamble += "#define TEXTURE_OFFSET_EFFECTS " + 0.0625f + "\n";

        Config config = CoreRegistry.get(Config.class);
        StringBuilder builder = new StringBuilder().append(preProcessorPreamble);
        if (config.getRendering().isAnimateGrass()) {
            builder.append("#define ANIMATED_GRASS \n");
        }
        if (config.getRendering().isAnimateWater()) {
            builder.append("#define ANIMATED_WATER \n");
        }
        if (config.getRendering().getBlurIntensity() == 0) {
            builder.append("#define NO_BLUR \n");
        }
        if (config.getRendering().isFlickeringLight()) {
            builder.append("#define FLICKERING_LIGHT \n");
        }
        if (config.getRendering().isVignette()) {
            builder.append("#define VIGNETTE \n");
        }
        if (config.getRendering().isBloom()) {
            builder.append("#define BLOOM \n");
        }
        if (config.getRendering().isMotionBlur()) {
            builder.append("#define MOTION_BLUR \n");
        }
        if (config.getRendering().isSsao()) {
            builder.append("#define SSAO \n");
        }
        if (config.getRendering().isFilmGrain()) {
            builder.append("#define FILM_GRAIN \n");
        }
        if (config.getRendering().isOutline()) {
            builder.append("#define OUTLINE \n");
        }
        if (config.getRendering().isLightShafts()) {
            builder.append("#define LIGHT_SHAFTS \n");
        }
        if (config.getRendering().isDynamicShadows()) {
            builder.append("#define DYNAMIC_SHADOWS \n");
        }
        if (config.getRendering().isNormalMapping()) {
            builder.append("#define NORMAL_MAPPING \n");
        }
        if (config.getRendering().isParallaxMapping()) {
            builder.append("#define PARALLAX_MAPPING \n");
        }
        if (config.getRendering().isDynamicShadowsPcfFiltering()) {
            builder.append("#define DYNAMIC_SHADOWS_PCF \n");
        }
        if (config.getRendering().isCloudShadows()) {
            builder.append("#define CLOUD_SHADOWS \n");
        }
        if (config.getRendering().isLocalReflections()) {
            builder.append("#define LOCAL_REFLECTIONS \n");
        }
        if (config.getRendering().isInscattering()) {
            builder.append("#define INSCATTERING \n");
        }
        // TODO A 3D wizard should take a look at this. Configurable for the moment to make better comparisons possible.
        if (config.getRendering().isClampLighting()) {
            builder.append("#define CLAMP_LIGHTING \n");
        }

        for (RenderingDebugConfig.DebugRenderingStage stage : RenderingDebugConfig.DebugRenderingStage.values()) {
            builder.append("#define ").append(stage.getDefineName()).append(" int(").append(stage.getIndex()).append(") \n");
View Full Code Here

TOP

Related Classes of org.terasology.config.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.