Fix non-power-of-two scaling on models and textures

This commit is contained in:
Mike Primm 2011-07-15 09:29:27 -05:00
parent c958da0ae0
commit a91060dc95
2 changed files with 4 additions and 3 deletions

View File

@ -133,6 +133,7 @@ public class HDBlockModels {
} }
else { /* Else, see how much is in first one */ else { /* Else, see how much is in first one */
weights[idx] = (offsets[idx] + res) - v; weights[idx] = (offsets[idx] + res) - v;
weights[idx] = (offsets[idx]*res + res) - v;
} }
} }
/* Now, use weights and indices to fill in scaled map */ /* Now, use weights and indices to fill in scaled map */
@ -182,7 +183,7 @@ public class HDBlockModels {
weights[idx] = res; weights[idx] = res;
} }
else { /* Else, see how much is in first one */ else { /* Else, see how much is in first one */
weights[idx] = (offsets[idx] + nativeres) - v; weights[idx] = (offsets[idx]*nativeres + nativeres) - v;
} }
} }
/* Now, use weights and indices to fill in scaled map */ /* Now, use weights and indices to fill in scaled map */

View File

@ -279,7 +279,7 @@ public class TexturePack {
weights[idx] = nativeres; weights[idx] = nativeres;
} }
else { /* Else, see how much is in first one */ else { /* Else, see how much is in first one */
weights[idx] = (offsets[idx] + res) - v; weights[idx] = (offsets[idx]*res + res) - v;
} }
} }
/* Now, use weights and indices to fill in scaled map */ /* Now, use weights and indices to fill in scaled map */
@ -328,7 +328,7 @@ public class TexturePack {
weights[idx] = res; weights[idx] = res;
} }
else { /* Else, see how much is in first one */ else { /* Else, see how much is in first one */
weights[idx] = (offsets[idx] + nativeres) - v; weights[idx] = (offsets[idx]*nativeres + nativeres) - v;
} }
} }
int accum_red[] = new int[res*res]; int accum_red[] = new int[res*res];