Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

reviewing

  • Loading branch information...
commit ea2c6676360983b8fbb11a6586173443e314d701 1 parent 47ca054
@godrin authored
Showing with 56 additions and 26 deletions.
  1. +3 −1 defend/src/com/cdm/defend/DefendGame.java
  2. +1 −0  defend/src/com/cdm/gui/anim/Animation.java
  3. +1 −0  defend/src/com/cdm/gui/anim/AnimationList.java
  4. +2 −0  defend/src/com/cdm/gui/anim/Easing.java
  5. +2 −0  defend/src/com/cdm/gui/anim/Easings.java
  6. +1 −0  defend/src/com/cdm/gui/anim/LinearEasing.java
  7. +7 −5 defend/src/com/cdm/gui/anim/MoveAnimation.java
  8. +1 −0  defend/src/com/cdm/gui/anim/QuadEasing.java
  9. +1 −0  defend/src/com/cdm/gui/effects/AnimatedColor.java
  10. +6 −5 defend/src/com/cdm/gui/effects/AnimatedRect.java
  11. +1 −0  defend/src/com/cdm/gui/effects/AnimatedValue.java
  12. +1 −0  defend/src/com/cdm/gui/effects/AnimationValueStore.java
  13. +1 −0  defend/src/com/cdm/gui/effects/Animator.java
  14. +1 −0  defend/src/com/cdm/gui/effects/AnimatorSin.java
  15. +1 −0  defend/src/com/cdm/gui/effects/AnimatorStatic.java
  16. +1 −0  defend/src/com/cdm/gui/effects/Effect.java
  17. +1 −0  defend/src/com/cdm/gui/effects/SingleValue.java
  18. +3 −4 defend/src/com/cdm/gui/effects/SoundFX.java
  19. +1 −0  defend/src/com/cdm/gui/effects/StaticValue.java
  20. +1 −0  defend/src/com/cdm/view/Position.java
  21. +1 −0  defend/src/com/cdm/view/Rectangle.java
  22. +15 −11 defend/src/com/cdm/view/Renderer.java
  23. +1 −0  defend/src/com/cdm/view/Screen.java
  24. +2 −0  nonreviewed.sh
View
4 defend/src/com/cdm/defend/DefendGame.java
@@ -13,6 +13,8 @@
import com.cdm.view.Screen;
import com.cdm.view.SoundScreen;
+// review1
+
public class DefendGame implements ApplicationListener, Game {
private static final long serialVersionUID = 1L;
@@ -87,7 +89,7 @@ private void move() {
private void mywait(float delta) {
try {
- Integer ms = (int) (delta * 1000);
+ int ms = (int) (delta * 1000);
int wait = 15 - ms;
if (wait > 5) {
View
1  defend/src/com/cdm/gui/anim/Animation.java
@@ -1,5 +1,6 @@
package com.cdm.gui.anim;
+// review1
public interface Animation {
void tick(float time);
View
1  defend/src/com/cdm/gui/anim/AnimationList.java
@@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.List;
+//review1
public class AnimationList implements Animation {
List<Animation> animations = new ArrayList<Animation>();
List<Animation> toremove = new ArrayList<Animation>();
View
2  defend/src/com/cdm/gui/anim/Easing.java
@@ -1,5 +1,7 @@
package com.cdm.gui.anim;
+//review1
+
public interface Easing {
float ease(float a, float b, float time);
View
2  defend/src/com/cdm/gui/anim/Easings.java
@@ -1,5 +1,7 @@
package com.cdm.gui.anim;
+//review1
+
public class Easings {
public static final Easing LINEAR = new LinearEasing();
public static final Easing QUAD = new QuadEasing();
View
1  defend/src/com/cdm/gui/anim/LinearEasing.java
@@ -1,4 +1,5 @@
package com.cdm.gui.anim;
+//review1
public class LinearEasing implements Easing {
View
12 defend/src/com/cdm/gui/anim/MoveAnimation.java
@@ -2,13 +2,15 @@
import com.cdm.gui.BigButton;
+//review1
+
public class MoveAnimation implements Animation {
- float t, interval;
- Easing ease;
- BigButton button;
- float tx, ty;
- float x0, y0;
+ private float t, interval;
+ private Easing ease;
+ private BigButton button;
+ private float tx, ty;
+ private float x0, y0;
public MoveAnimation(Easing easing, float pinterval, float px, float py,
BigButton b) {
View
1  defend/src/com/cdm/gui/anim/QuadEasing.java
@@ -1,5 +1,6 @@
package com.cdm.gui.anim;
+// review1
public class QuadEasing implements Easing {
@Override
View
1  defend/src/com/cdm/gui/effects/AnimatedColor.java
@@ -2,6 +2,7 @@
import com.badlogic.gdx.graphics.Color;
+// review1
public class AnimatedColor {
private SingleValue r, g, b, a;
private Color c = new Color();
View
11 defend/src/com/cdm/gui/effects/AnimatedRect.java
@@ -2,13 +2,14 @@
import com.cdm.view.IRenderer;
+// review1
public class AnimatedRect implements Effect {
- SingleValue mx;
- SingleValue my;
- SingleValue pw;
- SingleValue ph;
- AnimatedColor c;
+ private SingleValue mx;
+ private SingleValue my;
+ private SingleValue pw;
+ private SingleValue ph;
+ private AnimatedColor c;
public AnimatedRect(Animator mx, Animator my, Animator pw, Animator ph,
AnimatedColor c) {
View
1  defend/src/com/cdm/gui/effects/AnimatedValue.java
@@ -1,5 +1,6 @@
package com.cdm.gui.effects;
+// review1
public class AnimatedValue implements SingleValue {
private AnimationValueStore s;
private Animator modified;
View
1  defend/src/com/cdm/gui/effects/AnimationValueStore.java
@@ -1,5 +1,6 @@
package com.cdm.gui.effects;
+// review1
public class AnimationValueStore {
float value;
View
1  defend/src/com/cdm/gui/effects/Animator.java
@@ -1,5 +1,6 @@
package com.cdm.gui.effects;
+// review1
public interface Animator {
public void addTime(float t,AnimationValueStore s);
float getValue(AnimationValueStore s);
View
1  defend/src/com/cdm/gui/effects/AnimatorSin.java
@@ -1,5 +1,6 @@
package com.cdm.gui.effects;
+// review1
public class AnimatorSin implements Animator {
float mean, radius, speed, start;
View
1  defend/src/com/cdm/gui/effects/AnimatorStatic.java
@@ -1,5 +1,6 @@
package com.cdm.gui.effects;
+// review1
public class AnimatorStatic implements Animator {
float start;
View
1  defend/src/com/cdm/gui/effects/Effect.java
@@ -2,6 +2,7 @@
import com.cdm.view.IRenderer;
+// review1
public interface Effect {
public void draw(IRenderer renderer);
View
1  defend/src/com/cdm/gui/effects/SingleValue.java
@@ -1,5 +1,6 @@
package com.cdm.gui.effects;
+// review1
public interface SingleValue {
public abstract void addTime(float t);
View
7 defend/src/com/cdm/gui/effects/SoundFX.java
@@ -7,19 +7,18 @@
import com.badlogic.gdx.audio.Sound;
import com.cdm.view.SoundScreen;
+// review1
public class SoundFX {
public enum Type {
-
KLICK, SHOT, SHOT2, HIT, HIT2, HURT, STUNRAY, LOOSE, WIN
-
};
private static Map<Type, Sound> sounds = new TreeMap<Type, Sound>();
public static void Initialize() {
- sounds.put(Type.KLICK,
- Gdx.audio.newSound(Gdx.files.internal("data/klick01.ogg")));
+ sounds.put(Type.KLICK,
+ Gdx.audio.newSound(Gdx.files.internal("data/klick01.ogg")));
sounds.put(Type.HIT2,
Gdx.audio.newSound(Gdx.files.internal("data/hit.mp3")));
sounds.put(Type.SHOT,
View
1  defend/src/com/cdm/gui/effects/StaticValue.java
@@ -1,5 +1,6 @@
package com.cdm.gui.effects;
+// review1
public class StaticValue implements SingleValue {
private float value;
View
1  defend/src/com/cdm/view/Position.java
@@ -3,6 +3,7 @@
import com.badlogic.gdx.math.Vector3;
import com.cdm.view.elements.paths.PathPos;
+// review1
public class Position {
View
1  defend/src/com/cdm/view/Rectangle.java
@@ -1,5 +1,6 @@
package com.cdm.view;
+// review1
public class Rectangle {
private float x, y, w, h;
View
26 defend/src/com/cdm/view/Renderer.java
@@ -62,7 +62,10 @@ public void drawLines(Position pos, List<Vector3> lines, float angle,
Gdx.gl10.glLineWidth(pos.getSystem().getScale() * 0.04f);
renderer.begin(GL10.GL_LINES);
- for (Vector3 v : lines) {
+
+ for (int i = 0; i < lines.size(); i++) {
+ Vector3 v = lines.get(i);
+
renderer.color(color.r, color.g, color.b, color.a);
renderer.vertex(v);
}
@@ -83,7 +86,8 @@ public void drawLines(Position pos, List<Vector3> lines, float angle,
x.mul(p);
x.mul(s);
renderer20.begin(x, GL10.GL_LINES);
- for (Vector3 v : lines) {
+ for(int i=0;i<lines.size();i++) {
+ Vector3 v=lines.get(i);
renderer20.color(color.r, color.g, color.b, color.a);
renderer20.vertex(v.x, v.y, v.z);
}
@@ -117,7 +121,8 @@ public void drawPoly(Position pos, List<Vector3> lines, float angle,
Gdx.gl10.glScalef(size, size, size);
renderer.begin(GL10.GL_TRIANGLES);
- for (Vector3 v : lines) {
+ for(int i=0;i<lines.size();i++) {
+ Vector3 v=lines.get(i);
renderer.color(color.r, color.g, color.b, color.a);
renderer.vertex(v);
}
@@ -137,7 +142,8 @@ public void drawPoly(Position pos, List<Vector3> lines, float angle,
x.mul(s);
if (true) {
renderer20.begin(x, GL20.GL_TRIANGLES);
- for (Vector3 v : lines) {
+ for(int i=0;i<lines.size();i++) {
+ Vector3 v=lines.get(i);
// FIXME: ensure from outside !
float r = color.r;
float g = color.g;
@@ -299,17 +305,12 @@ public void render(PolySprite sprite, Position pos, float size,
Gdx.gl10.glPopMatrix();
} else {
- /*
- * Matrix4 p = new Matrix4();
- *
- * p.setToRotation(Vector3.Z, angle); p.trn(pos.x, pos.y, 0);
- * p.mul(projMatrix);
- */
initGlSettings();
+ //FIXME: new
Matrix4 p = new Matrix4();
Matrix4 s = new Matrix4();
Matrix4 x = new Matrix4(projMatrix);
- // size*=pos.getSystem().getScale();
+
s.setToScaling(size, size, size);
p.setToRotation(Vector3.Z, angle);
p.trn(pos.x, pos.y, 0);
@@ -326,6 +327,7 @@ public void render(PolySprite sprite, Position pos, float size,
}
public static void pushMatrix() {
+ // FIXME: new
matrixStack.add(new Matrix4(projMatrix));
}
@@ -336,6 +338,7 @@ public static void popMatrix() {
}
public static void scaleMatrix(float x, float y, float z) {
+ // FIXME: new
Matrix4 m = new Matrix4();
m.setToScaling(x, y, z);
// m.mul(projMatrix);
@@ -344,6 +347,7 @@ public static void scaleMatrix(float x, float y, float z) {
}
public static void translateMatrix(float x, float y, float z) {
+ // FIXME: new
Matrix4 m = new Matrix4();
m.setToTranslation(x, y, z);
projMatrix.mul(m);
View
1  defend/src/com/cdm/view/Screen.java
@@ -4,6 +4,7 @@
import com.badlogic.gdx.InputAdapter;
import com.cdm.defend.DefendGame;
+// review1
public class Screen extends InputAdapter {
public static final String LEVEL_SCREEN = "levelScreen";
View
2  nonreviewed.sh
@@ -0,0 +1,2 @@
+#/bin/bash
+for a in $(find . -name "*.java") ; { grep review1 $a >/dev/null || echo $a ; }
Please sign in to comment.
Something went wrong with that request. Please try again.