Merge pull request #289 from mikeprimm/hdrender

Fix wool coloring in texture support
This commit is contained in:
mikeprimm 2011-07-18 23:48:36 -07:00
commit 06b7a5dd57
2 changed files with 4 additions and 3 deletions

View File

@ -164,7 +164,7 @@ public class HDBlockModels {
} }
} }
} }
map[off] = (short)((255*raw_w) / (nativeres*nativeres*nativeres)); map[off] = (short)((255*raw_w) / (res*res*res));
if(map[off] > 255) map[off] = 255; if(map[off] > 255) map[off] = 255;
if(map[off] < 0) map[off] = 0; if(map[off] < 0) map[off] = 0;
} }

View File

@ -463,8 +463,8 @@ public class TexturePack {
} }
} }
/* Generate weighted compnents into color */ /* Generate weighted compnents into color */
c.setRGBA(accum_red / (nativeres*nativeres), accum_green / (nativeres*nativeres), c.setRGBA(accum_red / (res*res), accum_green / (res*res),
accum_blue / (nativeres*nativeres), accum_alpha / (nativeres*nativeres)); accum_blue / (res*res), accum_alpha / (res*res));
dest_argb[(y*res) + x] = c.getARGB(); dest_argb[(y*res) + x] = c.getARGB();
} }
} }
@ -581,6 +581,7 @@ public class TexturePack {
blkids.add(Integer.parseInt(av[1])); blkids.add(Integer.parseInt(av[1]));
} }
else if(av[0].equals("data")) { else if(av[0].equals("data")) {
if(databits < 0) databits = 0;
if(av[1].equals("*")) if(av[1].equals("*"))
databits = 0xFFFF; databits = 0xFFFF;
else else