From e18ab1a8805eb08977aac403caa6ae7a0dd3cafc Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Fri, 17 Jun 2011 00:08:13 -0500 Subject: [PATCH] Add 'textured' option for Flat - matches color scheme tone better --- configuration.txt | 10 ++++++++++ src/main/java/org/dynmap/flat/FlatMap.java | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/configuration.txt b/configuration.txt index c42e4c88..c1f6bb39 100644 --- a/configuration.txt +++ b/configuration.txt @@ -136,6 +136,8 @@ templates: title: "Flat" prefix: flat colorscheme: default + # The textured setting makes the flat render toning much more consistent with the other maps: set to 'false' for the original flat texture + textured: true # # To render a world as a "night view", set shadowstrength and ambientlight # shadowstrength: 1.0 # ambientlight: 4 @@ -204,6 +206,8 @@ templates: colorscheme: default # Map background color (day or night) background: "#300806" + # The textured setting makes the flat render toning much more consistent with the other maps: set to 'false' for the original flat texture + textured: true - class: org.dynmap.kzedmap.KzedMap renderers: - class: org.dynmap.kzedmap.DefaultTileRenderer @@ -233,6 +237,8 @@ templates: backgroundday: "#153E7E" # Background color for map during the night backgroundnight: "#000000" + # The textured setting makes the flat render toning much more consistent with the other maps: set to 'false' for the original flat texture + textured: true - class: org.dynmap.kzedmap.KzedMap renderers: - class: org.dynmap.kzedmap.DefaultTileRenderer @@ -297,6 +303,8 @@ worlds: # title: "Flat" # prefix: flat # colorscheme: default + # # The textured setting makes the flat render toning much more consistent with the other maps: set to 'false' for the original flat texture + # textured: true # # To render a world as a "night view", set shadowstrength and ambientlight # shadowstrength: 1.0 # ambientlight: 4 @@ -364,6 +372,8 @@ worlds: # title: "Flat" # prefix: flat # colorscheme: default + # # The textured setting makes the flat render toning much more consistent with the other maps: set to 'false' for the original flat texture + # textured: true # - class: org.dynmap.kzedmap.KzedMap # renderers: # - class: org.dynmap.kzedmap.DefaultTileRenderer diff --git a/src/main/java/org/dynmap/flat/FlatMap.java b/src/main/java/org/dynmap/flat/FlatMap.java index 3dda7c16..102cbee5 100644 --- a/src/main/java/org/dynmap/flat/FlatMap.java +++ b/src/main/java/org/dynmap/flat/FlatMap.java @@ -37,6 +37,7 @@ public class FlatMap extends MapType { private int shadowscale[] = null; private boolean night_and_day; /* If true, render both day (prefix+'-day') and night (prefix) tiles */ protected boolean transparency; + private boolean textured = false; public FlatMap(ConfigurationNode configuration) { this.configuration = configuration; @@ -69,6 +70,7 @@ public class FlatMap extends MapType { } night_and_day = configuration.getBoolean("night-and-day", false); transparency = configuration.getBoolean("transparency", false); /* Default off */ + textured = configuration.getBoolean("textured", false); } @Override @@ -173,7 +175,13 @@ public class FlatMap extends MapType { } if (colors == null) continue; - Color c = colors[0]; + Color c; + if(textured && (((x+y) & 0x01) == 1)) { + c = colors[2]; + } + else { + c = colors[0]; + } if (c == null) continue;