mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-25 03:35:18 +01:00
Merge pull request #224 from mikeprimm/master
Alter 'textured' setting on flat map to have 'none'/'smooth'/'dither' choices
This commit is contained in:
commit
6ecb271576
@ -136,8 +136,8 @@ templates:
|
|||||||
title: "Flat"
|
title: "Flat"
|
||||||
prefix: flat
|
prefix: flat
|
||||||
colorscheme: default
|
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
|
# The textured setting makes the flat render toning much more consistent with the other maps: set to 'none' for the original flat texture, 'smooth' for blended tile top colors, 'dither' for dither pattern
|
||||||
textured: true
|
textured: smooth
|
||||||
# # To render a world as a "night view", set shadowstrength and ambientlight
|
# # To render a world as a "night view", set shadowstrength and ambientlight
|
||||||
# shadowstrength: 1.0
|
# shadowstrength: 1.0
|
||||||
# ambientlight: 4
|
# ambientlight: 4
|
||||||
@ -206,8 +206,8 @@ templates:
|
|||||||
colorscheme: default
|
colorscheme: default
|
||||||
# Map background color (day or night)
|
# Map background color (day or night)
|
||||||
background: "#300806"
|
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
|
# The textured setting makes the flat render toning much more consistent with the other maps: set to 'none' for the original flat texture, 'smooth' for blended tile top colors, 'dither' for dither pattern
|
||||||
textured: true
|
textured: smooth
|
||||||
- class: org.dynmap.kzedmap.KzedMap
|
- class: org.dynmap.kzedmap.KzedMap
|
||||||
renderers:
|
renderers:
|
||||||
- class: org.dynmap.kzedmap.DefaultTileRenderer
|
- class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||||
@ -237,8 +237,8 @@ templates:
|
|||||||
backgroundday: "#153E7E"
|
backgroundday: "#153E7E"
|
||||||
# Background color for map during the night
|
# Background color for map during the night
|
||||||
backgroundnight: "#000000"
|
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
|
# The textured setting makes the flat render toning much more consistent with the other maps: set to 'none' for the original flat texture, 'smooth' for blended tile top colors, 'dither' for dither pattern
|
||||||
textured: true
|
textured: smooth
|
||||||
- class: org.dynmap.kzedmap.KzedMap
|
- class: org.dynmap.kzedmap.KzedMap
|
||||||
renderers:
|
renderers:
|
||||||
- class: org.dynmap.kzedmap.DefaultTileRenderer
|
- class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||||
@ -303,8 +303,8 @@ worlds:
|
|||||||
# title: "Flat"
|
# title: "Flat"
|
||||||
# prefix: flat
|
# prefix: flat
|
||||||
# colorscheme: default
|
# 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
|
# # The textured setting makes the flat render toning much more consistent with the other maps: set to 'none' for the original flat texture, 'smooth' for blended tile top colors, 'dither' for dither pattern
|
||||||
# textured: true
|
# textured: smooth
|
||||||
# # To render a world as a "night view", set shadowstrength and ambientlight
|
# # To render a world as a "night view", set shadowstrength and ambientlight
|
||||||
# shadowstrength: 1.0
|
# shadowstrength: 1.0
|
||||||
# ambientlight: 4
|
# ambientlight: 4
|
||||||
@ -372,8 +372,8 @@ worlds:
|
|||||||
# title: "Flat"
|
# title: "Flat"
|
||||||
# prefix: flat
|
# prefix: flat
|
||||||
# colorscheme: default
|
# 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
|
# # The textured setting makes the flat render toning much more consistent with the other maps: set to 'none' for the original flat texture, 'smooth' for blended tile top colors, 'dither' for dither pattern
|
||||||
# textured: true
|
# textured: smooth
|
||||||
# - class: org.dynmap.kzedmap.KzedMap
|
# - class: org.dynmap.kzedmap.KzedMap
|
||||||
# renderers:
|
# renderers:
|
||||||
# - class: org.dynmap.kzedmap.DefaultTileRenderer
|
# - class: org.dynmap.kzedmap.DefaultTileRenderer
|
||||||
|
@ -69,14 +69,16 @@ public class ColorScheme {
|
|||||||
else {
|
else {
|
||||||
id = new Integer(split[0]);
|
id = new Integer(split[0]);
|
||||||
}
|
}
|
||||||
Color[] c = new Color[4];
|
Color[] c = new Color[5];
|
||||||
|
|
||||||
/* store colors by raycast sequence number */
|
/* store colors by raycast sequence number */
|
||||||
c[0] = new Color(Integer.parseInt(split[1]), Integer.parseInt(split[2]), Integer.parseInt(split[3]), Integer.parseInt(split[4]));
|
c[0] = new Color(Integer.parseInt(split[1]), Integer.parseInt(split[2]), Integer.parseInt(split[3]), Integer.parseInt(split[4]));
|
||||||
c[3] = new Color(Integer.parseInt(split[5]), Integer.parseInt(split[6]), Integer.parseInt(split[7]), Integer.parseInt(split[8]));
|
c[3] = new Color(Integer.parseInt(split[5]), Integer.parseInt(split[6]), Integer.parseInt(split[7]), Integer.parseInt(split[8]));
|
||||||
c[1] = new Color(Integer.parseInt(split[9]), Integer.parseInt(split[10]), Integer.parseInt(split[11]), Integer.parseInt(split[12]));
|
c[1] = new Color(Integer.parseInt(split[9]), Integer.parseInt(split[10]), Integer.parseInt(split[11]), Integer.parseInt(split[12]));
|
||||||
c[2] = new Color(Integer.parseInt(split[13]), Integer.parseInt(split[14]), Integer.parseInt(split[15]), Integer.parseInt(split[16]));
|
c[2] = new Color(Integer.parseInt(split[13]), Integer.parseInt(split[14]), Integer.parseInt(split[15]), Integer.parseInt(split[16]));
|
||||||
|
/* Blended color - for 'smooth' option on flat map */
|
||||||
|
c[4] = new Color((c[0].getRed()+c[2].getRed())/2, (c[0].getGreen()+c[2].getGreen())/2, (c[0].getBlue()+c[2].getBlue())/2, (c[0].getAlpha()+c[2].getAlpha())/2);
|
||||||
|
|
||||||
if(dat != null) {
|
if(dat != null) {
|
||||||
Color[][] dcolor = datacolors[id]; /* Existing list? */
|
Color[][] dcolor = datacolors[id]; /* Existing list? */
|
||||||
if(dcolor == null) {
|
if(dcolor == null) {
|
||||||
|
@ -37,7 +37,8 @@ public class FlatMap extends MapType {
|
|||||||
private int shadowscale[] = null;
|
private int shadowscale[] = null;
|
||||||
private boolean night_and_day; /* If true, render both day (prefix+'-day') and night (prefix) tiles */
|
private boolean night_and_day; /* If true, render both day (prefix+'-day') and night (prefix) tiles */
|
||||||
protected boolean transparency;
|
protected boolean transparency;
|
||||||
private boolean textured = false;
|
private enum Texture { NONE, SMOOTH, DITHER };
|
||||||
|
private Texture textured = Texture.NONE;
|
||||||
|
|
||||||
public FlatMap(ConfigurationNode configuration) {
|
public FlatMap(ConfigurationNode configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
@ -70,7 +71,13 @@ public class FlatMap extends MapType {
|
|||||||
}
|
}
|
||||||
night_and_day = configuration.getBoolean("night-and-day", false);
|
night_and_day = configuration.getBoolean("night-and-day", false);
|
||||||
transparency = configuration.getBoolean("transparency", false); /* Default off */
|
transparency = configuration.getBoolean("transparency", false); /* Default off */
|
||||||
textured = configuration.getBoolean("textured", false);
|
String tex = configuration.getString("textured", "none");
|
||||||
|
if(tex.equals("none"))
|
||||||
|
textured = Texture.NONE;
|
||||||
|
else if(tex.equals("dither"))
|
||||||
|
textured = Texture.DITHER;
|
||||||
|
else
|
||||||
|
textured = Texture.SMOOTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -176,7 +183,9 @@ public class FlatMap extends MapType {
|
|||||||
if (colors == null)
|
if (colors == null)
|
||||||
continue;
|
continue;
|
||||||
Color c;
|
Color c;
|
||||||
if(textured && (((x+y) & 0x01) == 1)) {
|
if(textured == Texture.SMOOTH)
|
||||||
|
c = colors[4];
|
||||||
|
else if((textured == Texture.DITHER) && (((x+y) & 0x01) == 1)) {
|
||||||
c = colors[2];
|
c = colors[2];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user