v0.6.0: removed some unneeded allocations when frames were being drawn

This commit is contained in:
Evan Debenham 2017-06-01 02:10:30 -04:00
parent 1b2a0eafd7
commit 0225143d01
2 changed files with 6 additions and 6 deletions

View File

@ -21,13 +21,13 @@
package com.watabou.noosa;
import java.util.ArrayList;
import com.watabou.glwrap.Matrix;
import com.watabou.utils.Point;
import com.watabou.utils.PointF;
import com.watabou.utils.Random;
import java.util.ArrayList;
public class Camera extends Gizmo {
protected static ArrayList<Camera> all = new ArrayList<Camera>();
@ -161,7 +161,7 @@ public class Camera extends Gizmo {
super.update();
if (target != null) {
focusOn( target );
focusOn( target.x + target.width / 2, target.y + target.height / 2 );
}
if ((shakeTime -= Game.elapsed) > 0) {

View File

@ -23,7 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.DarkBlock;
import com.shatteredpixel.shatteredpixeldungeon.effects.EmoIcon;
@ -39,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
import com.watabou.glwrap.Matrix;
import com.watabou.glwrap.Vertexbuffer;
import com.watabou.noosa.Camera;
@ -464,12 +464,12 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
}
}
private float[] shadowMatrix;
private float[] shadowMatrix = new float[16];
@Override
protected void updateMatrix() {
super.updateMatrix();
shadowMatrix = Matrix.clone(matrix);
Matrix.copy(matrix, shadowMatrix);
Matrix.translate(shadowMatrix,
(width() * (1f - shadowWidth)) / 2f,
(height() * (1f - shadowHeight)) + shadowOffset);