mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Detect scaled models that yield full blocks, and optimize to solid
This commit is contained in:
parent
ba2c3eac1c
commit
102012aa91
@ -264,11 +264,19 @@ public class HDBlockModels {
|
|||||||
row = new short[16][];
|
row = new short[16][];
|
||||||
blockmodels[m.blockid] = row;
|
blockmodels[m.blockid] = row;
|
||||||
}
|
}
|
||||||
short[] smod = null;
|
short[] smod = m.getScaledMap(scale);
|
||||||
for(int i = 0; i < 16; i++) {
|
/* See if scaled model is full block : much faster to not use it if it is */
|
||||||
if((m.databits & (1 << i)) != 0) {
|
if(smod != null) {
|
||||||
if(smod == null) smod = m.getScaledMap(scale);
|
boolean keep = false;
|
||||||
row[i] = smod;
|
for(int i = 0; (!keep) && (i < smod.length); i++) {
|
||||||
|
if(smod[i] == 0) keep = true;
|
||||||
|
}
|
||||||
|
if(keep) {
|
||||||
|
for(int i = 0; i < 16; i++) {
|
||||||
|
if((m.databits & (1 << i)) != 0) {
|
||||||
|
row[i] = smod;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user