From df3027dc8a2a280c774cdf5ce550381cde427eca Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 10 Sep 2011 23:42:21 -0500 Subject: [PATCH] Fix glass pane tops --- src/main/java/org/dynmap/hdmap/TexturePack.java | 13 ++++++++++++- src/main/resources/texture.txt | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/dynmap/hdmap/TexturePack.java b/src/main/java/org/dynmap/hdmap/TexturePack.java index bec264d8..a452672c 100644 --- a/src/main/java/org/dynmap/hdmap/TexturePack.java +++ b/src/main/java/org/dynmap/hdmap/TexturePack.java @@ -74,6 +74,7 @@ public class TexturePack { private static final int BLOCKINDEX_BLANK = -1; private static final int BLOCKINDEX_GRASSMASK = 38; private static final int BLOCKINDEX_PISTONSIDE = 108; + private static final int BLOCKINDEX_GLASSPANETOP = 148; private static final int BLOCKINDEX_REDSTONE_NSEW_TONE = 164; private static final int BLOCKINDEX_REDSTONE_EW_TONE = 165; private static final int BLOCKINDEX_REDSTONE_NSEW = 180; @@ -84,7 +85,8 @@ public class TexturePack { private static final int BLOCKINDEX_MOVINGLAVA = 260; private static final int BLOCKINDEX_PISTONEXTSIDE = 261; private static final int BLOCKINDEX_PISTONSIDE_EXT = 262; - private static final int MAX_BLOCKINDEX = 262; + private static final int BLOCKINDEX_PANETOP_X = 263; + private static final int MAX_BLOCKINDEX = 263; private static final int BLOCKTABLELEN = MAX_BLOCKINDEX+1; private static class LoadedImage { @@ -433,6 +435,15 @@ public class TexturePack { terrain_argb[BLOCKINDEX_PISTONSIDE][native_scale*i + j]; } } + /* Build glass pane top in NSEW config (we use model to clip it) */ + terrain_argb[BLOCKINDEX_PANETOP_X] = new int[native_scale*native_scale]; + System.arraycopy(terrain_argb[BLOCKINDEX_GLASSPANETOP], 0, terrain_argb[BLOCKINDEX_PANETOP_X], 0, native_scale*native_scale); + for(i = native_scale*7/16; i < native_scale*9/16; i++) { + for(j = 0; j < native_scale; j++) { + terrain_argb[BLOCKINDEX_PANETOP_X][native_scale*i + j] = terrain_argb[BLOCKINDEX_PANETOP_X][native_scale*j + i]; + } + } + img.flush(); } diff --git a/src/main/resources/texture.txt b/src/main/resources/texture.txt index 27746bc7..69ec5e10 100644 --- a/src/main/resources/texture.txt +++ b/src/main/resources/texture.txt @@ -1,7 +1,7 @@ # Mapping of texture resources to block ID and data values # block:id=,data=,top=,bottom=,north=,south=,east=,west=,allfaces=,allsides= # =0-255 (index of patch in terrain.png), -1=clear, 1xxx=biome tint from grasscolor.png,257=stationary water,258=moving water, -# 259=stationary lava,260=moving lava,261=extended piston side,262=piston side while extended,2xxx=biome tint from foliagecolor.png,4xxx=rotate texture 90, +# 259=stationary lava,260=moving lava,261=extended piston side,262=piston side while extended,263=glass pane top,2xxx=biome tint from foliagecolor.png,4xxx=rotate texture 90, # 5xxx=rotate texture 180, 6xxx=rotate texture 270, 7xxx=flip texture horizontally, 8xxx=shift down 1/2 block, 9=shift down 1/2,flip horiz, # 10xxx=inclined-torch,11xxx=grass-side,12xxx=clear if same block ###### @@ -462,7 +462,7 @@ block:id=100,allfaces=125 # Iron bars block:id=101,allsides=85,topbottom=22,transparency=TRANSPARENT # Glass pane -block:id=102,allsides=12049,topbottom=12148,transparency=TRANSPARENT +block:id=102,allsides=12049,topbottom=12263,transparency=TRANSPARENT # Watermellon block:id=103,allsides=136,topbottom=137 # Pumpkin stem (104)