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,14 +264,22 @@ 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);
|
||||||
|
/* See if scaled model is full block : much faster to not use it if it is */
|
||||||
|
if(smod != null) {
|
||||||
|
boolean keep = false;
|
||||||
|
for(int i = 0; (!keep) && (i < smod.length); i++) {
|
||||||
|
if(smod[i] == 0) keep = true;
|
||||||
|
}
|
||||||
|
if(keep) {
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < 16; i++) {
|
||||||
if((m.databits & (1 << i)) != 0) {
|
if((m.databits & (1 << i)) != 0) {
|
||||||
if(smod == null) smod = m.getScaledMap(scale);
|
|
||||||
row[i] = smod;
|
row[i] = smod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
model.modelvectors = blockmodels;
|
model.modelvectors = blockmodels;
|
||||||
scaled_models_by_scale.put(scale, model);
|
scaled_models_by_scale.put(scale, model);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user