v0.6.3b: removed some unnecessary allocations, and disabled unused fonts

This commit is contained in:
Evan Debenham 2018-02-28 21:10:23 -05:00
parent d36c063ba8
commit 099a75d19e
3 changed files with 11 additions and 5 deletions

View File

@ -91,7 +91,9 @@ public class Camera extends Gizmo {
}
public static synchronized void updateAll() {
for (Camera c : all) {
int length = all.size();
for (int i=0; i < length; i++) {
Camera c = all.get( i );
if (c.exists && c.active) {
c.update();
}

View File

@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
import com.watabou.glwrap.Blending;
import com.watabou.glwrap.Texture;
import com.watabou.input.Touchscreen;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.BitmapText.Font;
@ -112,8 +111,11 @@ public class PixelScene extends Scene {
pixelFont.baseLine = 6;
pixelFont.tracking = -1;
//Fonts disabled to save memory (~1mb of texture data just sitting there unused)
//uncomment if you wish to enable these again.
// 9x15 (18)
font1x = Font.colorMarked(
/*font1x = Font.colorMarked(
BitmapCache.get( Assets.FONT1X), 22, 0x00000000, BitmapText.Font.LATIN_FULL );
font1x.baseLine = 17;
font1x.tracking = -2;
@ -124,7 +126,7 @@ public class PixelScene extends Scene {
BitmapCache.get( Assets.FONT2X), 44, 0x00000000, BitmapText.Font.LATIN_FULL );
font2x.baseLine = 38;
font2x.tracking = -4;
font2x.texture.filter(Texture.LINEAR, Texture.NEAREST);
font2x.texture.filter(Texture.LINEAR, Texture.NEAREST);*/
}
}

View File

@ -169,6 +169,8 @@ public class StatusPane extends Component {
btnMenu.setPos( width - btnMenu.width(), 1 );
}
private static final int[] warningColors = new int[]{0x660000, 0xCC0000, 0x660000};
@Override
public void update() {
@ -183,7 +185,7 @@ public class StatusPane extends Component {
} else if ((health/max) < 0.3f) {
warning += Game.elapsed * 5f *(0.4f - (health/max));
warning %= 1f;
avatar.tint(ColorMath.interpolate(warning, 0x660000, 0xCC0000, 0x660000), 0.5f );
avatar.tint(ColorMath.interpolate(warning, warningColors), 0.5f );
} else {
avatar.resetColor();
}