From 3f3cbf1d1cc2c68c5be44d550685b28f3da890ab Mon Sep 17 00:00:00 2001 From: recastro Date: Sun, 29 Jan 2012 11:31:17 +0100 Subject: [PATCH 01/12] Added Polygon example --- AndroidManifest.xml | 1 + res/values/strings.xml | 1 + .../andengine/examples/PolygonExample.java | 100 ++++++++++++++++++ .../andengine/examples/launcher/Example.java | 2 + .../examples/launcher/ExampleGroup.java | 2 +- 5 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 src/org/andengine/examples/PolygonExample.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 6c77662..3eb707f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -73,6 +73,7 @@ + diff --git a/res/values/strings.xml b/res/values/strings.xml index fd28045..8be1018 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -131,4 +131,5 @@ CityRadar + Drawing Polygons diff --git a/src/org/andengine/examples/PolygonExample.java b/src/org/andengine/examples/PolygonExample.java new file mode 100644 index 0000000..dd835c7 --- /dev/null +++ b/src/org/andengine/examples/PolygonExample.java @@ -0,0 +1,100 @@ +package org.andengine.examples; + +import org.andengine.engine.camera.Camera; +import org.andengine.engine.options.EngineOptions; +import org.andengine.engine.options.EngineOptions.ScreenOrientation; +import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; +import org.andengine.entity.primitive.Polygon; +import org.andengine.entity.primitive.Rectangle; +import org.andengine.entity.scene.Scene; +import org.andengine.entity.scene.background.Background; +import org.andengine.entity.util.FPSLogger; +import org.andengine.opengl.vbo.VertexBufferObjectManager; +import org.andengine.ui.activity.SimpleBaseGameActivity; +import org.andengine.util.color.Color; + +/** + * + * @author Rodrigo Castro + * @since 23:05:11 - 28.01.2012 + */ +public class PolygonExample extends SimpleBaseGameActivity { + // =========================================================== + // Constants + // =========================================================== + + private static final int CAMERA_WIDTH = 720; + private static final int CAMERA_HEIGHT = 480; + + // =========================================================== + // Fields + // =========================================================== + + // =========================================================== + // Constructors + // =========================================================== + + // =========================================================== + // Getter & Setter + // =========================================================== + + // =========================================================== + // Methods for/from SuperClass/Interfaces + // =========================================================== + + @Override + public EngineOptions onCreateEngineOptions() { + final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); + + return new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera); + } + + @Override + public void onCreateResources() { + + } + + @Override + public Scene onCreateScene() { + this.mEngine.registerUpdateHandler(new FPSLogger()); + + final Scene scene = new Scene(); + scene.setBackground(new Background(0.09804f, 0.6274f, 0.8784f)); + + // The polygon is closed automatically + final float[] vertexX1 = { 0.0f, 200.0f, 250.0f, 200.0f, 200.0f, 100.0f, 100.0f, 0.0f}; + final float[] vertexY1 = { 0.0f, 0.0f, 50.0f, 100.0f, 200.0f, 150.0f, 50.0f, 50.0f}; + + // This polygon won't be drawn because its vertices are not CCW (Counter ClockWise) + final float[] vertexX2 = { 0.0f, 0.0f, 100.0f, 100.0f, 200.0f, 200.0f, 250.0f, 200.0f}; + final float[] vertexY2 = { 0.0f, 50.0f, 50.0f, 150.0f, 200.0f, 100.0f, 50.0f, 0.0f}; + + final float[] vertexX3 = { 0.0f, 0.0f, 200.0f, 200.0f }; + final float[] vertexY3 = { 0.0f, 100.0f, 100.0f, 0.0f }; + + final VertexBufferObjectManager vertexBufferObjectManager = this.getVertexBufferObjectManager(); + + final Polygon polygon1 = new Polygon(100, 100, vertexX1, vertexY1, vertexBufferObjectManager); + polygon1.setColor(Color.RED); + final Polygon polygon2 = new Polygon(400, 500, vertexX2, vertexY2, vertexBufferObjectManager); + polygon2.setColor(Color.GREEN); + final Polygon polygon3 = new Polygon(20, 350, vertexX3, vertexY3, vertexBufferObjectManager); + polygon3.setColor(Color.PINK); + final Rectangle rectangle = new Rectangle(300, 300, 200, 100, vertexBufferObjectManager); + + scene.attachChild(polygon1); + scene.attachChild(polygon2); + scene.attachChild(polygon3); + scene.attachChild(rectangle); + + return scene; + } + + // =========================================================== + // Methods + // =========================================================== + + // =========================================================== + // Inner and Anonymous Classes + // =========================================================== +} diff --git a/src/org/andengine/examples/launcher/Example.java b/src/org/andengine/examples/launcher/Example.java index 14fdda3..56e4386 100644 --- a/src/org/andengine/examples/launcher/Example.java +++ b/src/org/andengine/examples/launcher/Example.java @@ -7,6 +7,7 @@ import org.andengine.examples.BitmapFontExample; import org.andengine.examples.BoundCameraExample; import org.andengine.examples.CanvasTextureCompositingExample; +import org.andengine.examples.PolygonExample; import org.andengine.examples.TextExample; import org.andengine.examples.CollisionDetectionExample; import org.andengine.examples.ColorKeyTextureSourceDecoratorExample; @@ -116,6 +117,7 @@ enum Example { ETC1TEXTURE(ETC1TextureExample.class, R.string.example_etc1texture), IMAGEFORMATS(ImageFormatsExample.class, R.string.example_imageformats), LEVELLOADER(LevelLoaderExample.class, R.string.example_levelloader), + POLYGON(PolygonExample.class, R.string.example_polygon), LINE(LineExample.class, R.string.example_line), LOADTEXTURE(LoadTextureExample.class, R.string.example_loadtexture), MENU(MenuExample.class, R.string.example_menu), diff --git a/src/org/andengine/examples/launcher/ExampleGroup.java b/src/org/andengine/examples/launcher/ExampleGroup.java index 442c7d2..7dab980 100644 --- a/src/org/andengine/examples/launcher/ExampleGroup.java +++ b/src/org/andengine/examples/launcher/ExampleGroup.java @@ -16,7 +16,7 @@ public enum ExampleGroup { // =========================================================== SIMPLE(R.string.examplegroup_simple, - Example.LINE, Example.RECTANGLE, Example.SPRITE, Example.SPRITEREMOVE, Example.SPRITEBATCH), + Example.POLYGON, Example.LINE, Example.RECTANGLE, Example.SPRITE, Example.SPRITEREMOVE, Example.SPRITEBATCH), MODIFIER_AND_ANIMATION(R.string.examplegroup_modifier_and_animation, Example.MOVINGBALL, Example.ENTITYMODIFIER, Example.ENTITYMODIFIERIRREGULAR, Example.PATHMODIFIER, Example.ANIMATEDSPRITES, Example.EASEFUNCTION, Example.ROTATION3D ), TOUCH(R.string.examplegroup_touch, From 683205129b196bc467177ef0334acc41d5a6da6f Mon Sep 17 00:00:00 2001 From: recastro Date: Sun, 29 Jan 2012 16:59:49 +0100 Subject: [PATCH 02/12] Only simple polygons work with the current triangulation algorithm --- src/org/andengine/examples/PolygonExample.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/org/andengine/examples/PolygonExample.java b/src/org/andengine/examples/PolygonExample.java index dd835c7..621ac87 100644 --- a/src/org/andengine/examples/PolygonExample.java +++ b/src/org/andengine/examples/PolygonExample.java @@ -71,6 +71,10 @@ public Scene onCreateScene() { final float[] vertexX3 = { 0.0f, 0.0f, 200.0f, 200.0f }; final float[] vertexY3 = { 0.0f, 100.0f, 100.0f, 0.0f }; + + // This polygon can't be triangulated with the current algorithm and will trigger a null pointer exception + final float[] vertexX4 = { 0.0f, 50.0f, 100.0f, 100.0f, 0.0f }; + final float[] vertexY4 = { 0.0f, 150.0f, 0.0f, 100.0f, 100.0f }; final VertexBufferObjectManager vertexBufferObjectManager = this.getVertexBufferObjectManager(); @@ -80,11 +84,14 @@ public Scene onCreateScene() { polygon2.setColor(Color.GREEN); final Polygon polygon3 = new Polygon(20, 350, vertexX3, vertexY3, vertexBufferObjectManager); polygon3.setColor(Color.PINK); + final Polygon polygon4 = new Polygon(20, 350, vertexX4, vertexY4, vertexBufferObjectManager); + polygon4.setColor(Color.CYAN); final Rectangle rectangle = new Rectangle(300, 300, 200, 100, vertexBufferObjectManager); scene.attachChild(polygon1); scene.attachChild(polygon2); scene.attachChild(polygon3); + //scene.attachChild(polygon4); scene.attachChild(rectangle); return scene; From d38e5e8f15e29bbb87a2955f2d802d9532d93f1f Mon Sep 17 00:00:00 2001 From: recastro Date: Mon, 30 Jan 2012 13:54:52 +0100 Subject: [PATCH 03/12] Avoid crashing the example activity with a non simple polygon --- src/org/andengine/examples/PolygonExample.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/andengine/examples/PolygonExample.java b/src/org/andengine/examples/PolygonExample.java index 621ac87..87c23da 100644 --- a/src/org/andengine/examples/PolygonExample.java +++ b/src/org/andengine/examples/PolygonExample.java @@ -84,8 +84,8 @@ public Scene onCreateScene() { polygon2.setColor(Color.GREEN); final Polygon polygon3 = new Polygon(20, 350, vertexX3, vertexY3, vertexBufferObjectManager); polygon3.setColor(Color.PINK); - final Polygon polygon4 = new Polygon(20, 350, vertexX4, vertexY4, vertexBufferObjectManager); - polygon4.setColor(Color.CYAN); + //final Polygon polygon4 = new Polygon(20, 350, vertexX4, vertexY4, vertexBufferObjectManager); + //polygon4.setColor(Color.CYAN); final Rectangle rectangle = new Rectangle(300, 300, 200, 100, vertexBufferObjectManager); scene.attachChild(polygon1); From 9f42efb94b89865b55af2604438fa4fe3da07ac0 Mon Sep 17 00:00:00 2001 From: recastro Date: Mon, 30 Jan 2012 23:11:10 +0100 Subject: [PATCH 04/12] Added PolyLine example --- src/org/andengine/examples/PolygonExample.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/org/andengine/examples/PolygonExample.java b/src/org/andengine/examples/PolygonExample.java index 87c23da..485b457 100644 --- a/src/org/andengine/examples/PolygonExample.java +++ b/src/org/andengine/examples/PolygonExample.java @@ -5,6 +5,7 @@ import org.andengine.engine.options.EngineOptions.ScreenOrientation; import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; import org.andengine.entity.primitive.Polygon; +import org.andengine.entity.primitive.PolyLine; import org.andengine.entity.primitive.Rectangle; import org.andengine.entity.scene.Scene; import org.andengine.entity.scene.background.Background; @@ -80,18 +81,27 @@ public Scene onCreateScene() { final Polygon polygon1 = new Polygon(100, 100, vertexX1, vertexY1, vertexBufferObjectManager); polygon1.setColor(Color.RED); + final Polygon polygon2 = new Polygon(400, 500, vertexX2, vertexY2, vertexBufferObjectManager); polygon2.setColor(Color.GREEN); + final Polygon polygon3 = new Polygon(20, 350, vertexX3, vertexY3, vertexBufferObjectManager); polygon3.setColor(Color.PINK); + //final Polygon polygon4 = new Polygon(20, 350, vertexX4, vertexY4, vertexBufferObjectManager); //polygon4.setColor(Color.CYAN); + + final PolyLine polyLine = new PolyLine(500, 50, vertexX4, vertexY4, vertexBufferObjectManager); + polyLine.setColor(Color.YELLOW); + polyLine.setLineWidth( 7f ); + final Rectangle rectangle = new Rectangle(300, 300, 200, 100, vertexBufferObjectManager); scene.attachChild(polygon1); scene.attachChild(polygon2); scene.attachChild(polygon3); //scene.attachChild(polygon4); + scene.attachChild(polyLine); scene.attachChild(rectangle); return scene; From ae05f15e8d2a1fbe7f426b0bbdf5e4a0c517ab76 Mon Sep 17 00:00:00 2001 From: recastro Date: Tue, 31 Jan 2012 13:30:35 +0100 Subject: [PATCH 05/12] Added new Ellipse example --- src/org/andengine/examples/PolygonExample.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/andengine/examples/PolygonExample.java b/src/org/andengine/examples/PolygonExample.java index 485b457..f8e1f41 100644 --- a/src/org/andengine/examples/PolygonExample.java +++ b/src/org/andengine/examples/PolygonExample.java @@ -4,6 +4,7 @@ import org.andengine.engine.options.EngineOptions; import org.andengine.engine.options.EngineOptions.ScreenOrientation; import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; +import org.andengine.entity.primitive.Ellipse; import org.andengine.entity.primitive.Polygon; import org.andengine.entity.primitive.PolyLine; import org.andengine.entity.primitive.Rectangle; @@ -95,6 +96,9 @@ public Scene onCreateScene() { polyLine.setColor(Color.YELLOW); polyLine.setLineWidth( 7f ); + final Ellipse ellipse = new Ellipse(430, 200, 100.0f, 50.0f, vertexBufferObjectManager); + ellipse.setColor(Color.CYAN); + final Rectangle rectangle = new Rectangle(300, 300, 200, 100, vertexBufferObjectManager); scene.attachChild(polygon1); @@ -102,6 +106,7 @@ public Scene onCreateScene() { scene.attachChild(polygon3); //scene.attachChild(polygon4); scene.attachChild(polyLine); + scene.attachChild(ellipse); scene.attachChild(rectangle); return scene; From 746d8732f61937dd14340bf2231a379d2f65334d Mon Sep 17 00:00:00 2001 From: recastro Date: Sat, 11 Feb 2012 10:56:33 +0100 Subject: [PATCH 06/12] Renamed Polygon2 -> Polygon --- .classpath | 1 + src/org/andengine/examples/PolygonExample.java | 8 ++++---- .../examples/benchmark/AttachDetachBenchmark.java | 1 - src/org/andengine/examples/launcher/Example.java | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.classpath b/.classpath index a4763d1..24e3f8a 100644 --- a/.classpath +++ b/.classpath @@ -4,5 +4,6 @@ + diff --git a/src/org/andengine/examples/PolygonExample.java b/src/org/andengine/examples/PolygonExample.java index 494b188..7e93ee8 100644 --- a/src/org/andengine/examples/PolygonExample.java +++ b/src/org/andengine/examples/PolygonExample.java @@ -5,8 +5,8 @@ import org.andengine.engine.options.EngineOptions.ScreenOrientation; import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; import org.andengine.entity.primitive.Ellipse; -import org.andengine.entity.primitive.Polygon2; import org.andengine.entity.primitive.PolyLine; +import org.andengine.entity.primitive.Polygon; import org.andengine.entity.primitive.Rectangle; import org.andengine.entity.scene.Scene; import org.andengine.entity.scene.background.Background; @@ -80,13 +80,13 @@ public Scene onCreateScene() { final VertexBufferObjectManager vertexBufferObjectManager = this.getVertexBufferObjectManager(); - final Polygon2 polygon1 = new Polygon2(100, 100, vertexX1, vertexY1, vertexBufferObjectManager); + final Polygon polygon1 = new Polygon(100, 100, vertexX1, vertexY1, vertexBufferObjectManager); polygon1.setColor(Color.RED); - final Polygon2 polygon2 = new Polygon2(400, 500, vertexX2, vertexY2, vertexBufferObjectManager); + final Polygon polygon2 = new Polygon(400, 500, vertexX2, vertexY2, vertexBufferObjectManager); polygon2.setColor(Color.GREEN); - final Polygon2 polygon3 = new Polygon2(20, 350, vertexX3, vertexY3, vertexBufferObjectManager); + final Polygon polygon3 = new Polygon(20, 350, vertexX3, vertexY3, vertexBufferObjectManager); polygon3.setColor(Color.PINK); //final Polygon polygon4 = new Polygon(20, 350, vertexX4, vertexY4, vertexBufferObjectManager); diff --git a/src/org/andengine/examples/benchmark/AttachDetachBenchmark.java b/src/org/andengine/examples/benchmark/AttachDetachBenchmark.java index 40925e1..841ce37 100644 --- a/src/org/andengine/examples/benchmark/AttachDetachBenchmark.java +++ b/src/org/andengine/examples/benchmark/AttachDetachBenchmark.java @@ -6,7 +6,6 @@ import org.andengine.engine.options.EngineOptions; import org.andengine.engine.options.EngineOptions.ScreenOrientation; import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; -import org.andengine.entity.IEntity; import org.andengine.entity.scene.Scene; import org.andengine.entity.scene.background.Background; import org.andengine.entity.sprite.Sprite; diff --git a/src/org/andengine/examples/launcher/Example.java b/src/org/andengine/examples/launcher/Example.java index 788dd97..bc43373 100644 --- a/src/org/andengine/examples/launcher/Example.java +++ b/src/org/andengine/examples/launcher/Example.java @@ -7,8 +7,6 @@ import org.andengine.examples.BitmapFontExample; import org.andengine.examples.BoundCameraExample; import org.andengine.examples.CanvasTextureCompositingExample; -import org.andengine.examples.PolygonExample; -import org.andengine.examples.TextExample; import org.andengine.examples.CollisionDetectionExample; import org.andengine.examples.ColorKeyTextureSourceDecoratorExample; import org.andengine.examples.CoordinateConversionExample; @@ -48,6 +46,7 @@ import org.andengine.examples.PhysicsRemoveExample; import org.andengine.examples.PhysicsRevoluteJointExample; import org.andengine.examples.PinchZoomExample; +import org.andengine.examples.PolygonExample; import org.andengine.examples.R; import org.andengine.examples.RadialBlurExample; import org.andengine.examples.RectangleExample; From b7483f55d9eea7086c396500b1631a8f569c8787 Mon Sep 17 00:00:00 2001 From: recastro Date: Sat, 11 Feb 2012 11:32:08 +0100 Subject: [PATCH 07/12] Use PolyLine updateVertices feature --- src/org/andengine/examples/PolygonExample.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/andengine/examples/PolygonExample.java b/src/org/andengine/examples/PolygonExample.java index 7e93ee8..7810db5 100644 --- a/src/org/andengine/examples/PolygonExample.java +++ b/src/org/andengine/examples/PolygonExample.java @@ -74,6 +74,9 @@ public Scene onCreateScene() { final float[] vertexX3 = { 0.0f, 0.0f, 200.0f, 200.0f }; final float[] vertexY3 = { 0.0f, 100.0f, 100.0f, 0.0f }; + // Dummy vertices (won't be used) + final float[] vertexX4Dummy = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; + final float[] vertexY4Dummy = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; // This polygon can't be triangulated with the current algorithm and will trigger a null pointer exception final float[] vertexX4 = { 0.0f, 50.0f, 100.0f, 100.0f, 0.0f }; final float[] vertexY4 = { 0.0f, 150.0f, 0.0f, 100.0f, 100.0f }; @@ -92,9 +95,11 @@ public Scene onCreateScene() { //final Polygon polygon4 = new Polygon(20, 350, vertexX4, vertexY4, vertexBufferObjectManager); //polygon4.setColor(Color.CYAN); - final PolyLine polyLine = new PolyLine(500, 50, vertexX4, vertexY4, vertexBufferObjectManager); + final PolyLine polyLine = new PolyLine(500, 50, vertexX4Dummy, vertexY4Dummy, vertexBufferObjectManager); polyLine.setColor(Color.YELLOW); polyLine.setLineWidth( 7f ); + // Update and use real vertices + polyLine.updateVertices(vertexX4, vertexY4); final Ellipse ellipse = new Ellipse(430, 200, 100.0f, 50.0f, vertexBufferObjectManager); ellipse.setColor(Color.CYAN); From 3d83cee771b6d61d18067386277410941ac7902b Mon Sep 17 00:00:00 2001 From: recastro Date: Sun, 12 Feb 2012 11:27:11 +0100 Subject: [PATCH 08/12] Added missing button example --- AndroidManifest.xml | 1 + res/values/strings.xml | 3 ++- src/org/andengine/examples/launcher/Example.java | 2 ++ src/org/andengine/examples/launcher/ExampleGroup.java | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 724d650..080cfa5 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -36,6 +36,7 @@ + diff --git a/res/values/strings.xml b/res/values/strings.xml index eb6bc95..aa357c4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -49,6 +49,7 @@ Using an AutoParallaxBackground Using a BitmapFont Using a BoundCamera + Simple two states button Compositing Textures (Canvas) Changeable Text Collision Detection @@ -87,6 +88,7 @@ Combining Physics and Touch Removing a Physics Object Using PinchZoom + Drawing Polygons PVRCCZ Texture PVRGZ Texture PVR Texture @@ -133,5 +135,4 @@ CityRadar - Drawing Polygons diff --git a/src/org/andengine/examples/launcher/Example.java b/src/org/andengine/examples/launcher/Example.java index bc43373..6672b00 100644 --- a/src/org/andengine/examples/launcher/Example.java +++ b/src/org/andengine/examples/launcher/Example.java @@ -6,6 +6,7 @@ import org.andengine.examples.AutoParallaxBackgroundExample; import org.andengine.examples.BitmapFontExample; import org.andengine.examples.BoundCameraExample; +import org.andengine.examples.ButtonSpriteExample; import org.andengine.examples.CanvasTextureCompositingExample; import org.andengine.examples.CollisionDetectionExample; import org.andengine.examples.ColorKeyTextureSourceDecoratorExample; @@ -105,6 +106,7 @@ enum Example { AUTOPARALLAXBACKGROUND(AutoParallaxBackgroundExample.class, R.string.example_autoparallaxbackground), BITMAPFONT(BitmapFontExample.class, R.string.example_bitmapfont), BOUNDCAMERA(BoundCameraExample.class, R.string.example_boundcamera), + BUTTONSPRITE(ButtonSpriteExample.class, R.string.example_buttonsprite), CANVASTEXTURECOMPOSITING(CanvasTextureCompositingExample.class, R.string.example_canvastexturecompositing), CHANGEABLETEXT(TextExample.class, R.string.example_changeabletext), COLLISIONDETECTION(CollisionDetectionExample.class, R.string.example_collisiondetection), diff --git a/src/org/andengine/examples/launcher/ExampleGroup.java b/src/org/andengine/examples/launcher/ExampleGroup.java index 180c245..987c821 100644 --- a/src/org/andengine/examples/launcher/ExampleGroup.java +++ b/src/org/andengine/examples/launcher/ExampleGroup.java @@ -16,7 +16,7 @@ public enum ExampleGroup { // =========================================================== SIMPLE(R.string.examplegroup_simple, - Example.POLYGON, Example.LINE, Example.RECTANGLE, Example.SPRITE, Example.SPRITEREMOVE, Example.SPRITEBATCH), + Example.POLYGON, Example.LINE, Example.RECTANGLE, Example.SPRITE, Example.SPRITEREMOVE, Example.SPRITEBATCH, Example.BUTTONSPRITE), MODIFIER_AND_ANIMATION(R.string.examplegroup_modifier_and_animation, Example.MOVINGBALL, Example.ENTITYMODIFIER, Example.ENTITYMODIFIERIRREGULAR, Example.PATHMODIFIER, Example.ANIMATEDSPRITES, Example.EASEFUNCTION, Example.ROTATION3D ), TOUCH(R.string.examplegroup_touch, From ae051abacf5fb8fd82be42eb7460c03992953d3c Mon Sep 17 00:00:00 2001 From: recastro Date: Tue, 14 Feb 2012 19:04:50 +0100 Subject: [PATCH 09/12] Renamed orientation and acceleration naming issues --- .../examples/BasePhysicsJointExample.java | 17 +++++++++++------ .../examples/BoundCameraExample.java | 18 ++++++++++++------ .../PhysicsCollisionFilteringExample.java | 19 +++++++++++++------ .../andengine/examples/PhysicsExample.java | 18 ++++++++++++------ .../examples/PhysicsFixedStepExample.java | 18 ++++++++++++------ .../examples/PhysicsJumpExample.java | 18 ++++++++++++------ .../examples/PhysicsMouseJointExample.java | 18 ++++++++++++------ .../examples/PhysicsRemoveExample.java | 18 ++++++++++++------ .../examples/SplitScreenExample.java | 18 ++++++++++++------ .../app/cityradar/CityRadarActivity.java | 6 ++++++ 10 files changed, 114 insertions(+), 54 deletions(-) diff --git a/src/org/andengine/examples/BasePhysicsJointExample.java b/src/org/andengine/examples/BasePhysicsJointExample.java index c420504..460ded6 100644 --- a/src/org/andengine/examples/BasePhysicsJointExample.java +++ b/src/org/andengine/examples/BasePhysicsJointExample.java @@ -14,8 +14,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -41,7 +41,7 @@ * @author Nicolas Gramlich * @since 18:47:08 - 19.03.2010 */ -public class BasePhysicsJointExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener { +public class BasePhysicsJointExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener { // =========================================================== // Constants // =========================================================== @@ -139,24 +139,29 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/BoundCameraExample.java b/src/org/andengine/examples/BoundCameraExample.java index ccf83ae..f70c3e0 100644 --- a/src/org/andengine/examples/BoundCameraExample.java +++ b/src/org/andengine/examples/BoundCameraExample.java @@ -18,8 +18,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -42,7 +42,7 @@ * @author Nicolas Gramlich * @since 18:08:29 - 27.07.2010 */ -public class BoundCameraExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener { +public class BoundCameraExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener { // =========================================================== // Constants // =========================================================== @@ -186,24 +186,30 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/PhysicsCollisionFilteringExample.java b/src/org/andengine/examples/PhysicsCollisionFilteringExample.java index 42e9ed3..504dc71 100644 --- a/src/org/andengine/examples/PhysicsCollisionFilteringExample.java +++ b/src/org/andengine/examples/PhysicsCollisionFilteringExample.java @@ -14,8 +14,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -39,7 +39,7 @@ * @author Nicolas Gramlich * @since 14:33:38 - 03.10.2010 */ -public class PhysicsCollisionFilteringExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener { +public class PhysicsCollisionFilteringExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener { // =========================================================== // Constants // =========================================================== @@ -149,24 +149,30 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== @@ -194,6 +200,7 @@ private void addFace(final float pX, final float pY) { this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(face, body, true, true)); } + // =========================================================== // Inner and Anonymous Classes // =========================================================== diff --git a/src/org/andengine/examples/PhysicsExample.java b/src/org/andengine/examples/PhysicsExample.java index fc3fe44..2707edb 100644 --- a/src/org/andengine/examples/PhysicsExample.java +++ b/src/org/andengine/examples/PhysicsExample.java @@ -17,8 +17,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -44,7 +44,7 @@ * @author Nicolas Gramlich * @since 18:47:08 - 19.03.2010 */ -public class PhysicsExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener { +public class PhysicsExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener { // =========================================================== // Constants // =========================================================== @@ -147,24 +147,30 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/PhysicsFixedStepExample.java b/src/org/andengine/examples/PhysicsFixedStepExample.java index 292ab7f..2e0994f 100644 --- a/src/org/andengine/examples/PhysicsFixedStepExample.java +++ b/src/org/andengine/examples/PhysicsFixedStepExample.java @@ -15,8 +15,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -40,7 +40,7 @@ * @author Nicolas Gramlich * @since 18:47:08 - 19.03.2010 */ -public class PhysicsFixedStepExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener { +public class PhysicsFixedStepExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener { // =========================================================== // Constants // =========================================================== @@ -137,24 +137,30 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/PhysicsJumpExample.java b/src/org/andengine/examples/PhysicsJumpExample.java index 14b35ae..4a4df60 100644 --- a/src/org/andengine/examples/PhysicsJumpExample.java +++ b/src/org/andengine/examples/PhysicsJumpExample.java @@ -16,8 +16,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -41,7 +41,7 @@ * @author Nicolas Gramlich * @since 21:18:08 - 27.06.2010 */ -public class PhysicsJumpExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener, IOnAreaTouchListener { +public class PhysicsJumpExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener, IOnAreaTouchListener { // =========================================================== // Constants // =========================================================== @@ -155,7 +155,7 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { this.mGravityX = pAccelerometerData.getX(); this.mGravityY = pAccelerometerData.getY(); @@ -163,19 +163,25 @@ public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/PhysicsMouseJointExample.java b/src/org/andengine/examples/PhysicsMouseJointExample.java index a62ac39..c2b69d8 100644 --- a/src/org/andengine/examples/PhysicsMouseJointExample.java +++ b/src/org/andengine/examples/PhysicsMouseJointExample.java @@ -18,8 +18,8 @@ import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; import org.andengine.extension.physics.box2d.util.constants.PhysicsConstants; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -45,7 +45,7 @@ * @author Nicolas Gramlich * @since 10:35:23 - 28.02.2011 */ -public class PhysicsMouseJointExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener, IOnAreaTouchListener { +public class PhysicsMouseJointExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener, IOnAreaTouchListener { // =========================================================== // Constants // =========================================================== @@ -186,24 +186,30 @@ public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final ITouchArea } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/PhysicsRemoveExample.java b/src/org/andengine/examples/PhysicsRemoveExample.java index 79be946..cad434a 100644 --- a/src/org/andengine/examples/PhysicsRemoveExample.java +++ b/src/org/andengine/examples/PhysicsRemoveExample.java @@ -16,8 +16,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -41,7 +41,7 @@ * @author Nicolas Gramlich * @since 18:47:08 - 19.03.2010 */ -public class PhysicsRemoveExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener, IOnAreaTouchListener { +public class PhysicsRemoveExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener, IOnAreaTouchListener { // =========================================================== // Constants // =========================================================== @@ -150,24 +150,30 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/SplitScreenExample.java b/src/org/andengine/examples/SplitScreenExample.java index d0cc26e..bb30ef2 100644 --- a/src/org/andengine/examples/SplitScreenExample.java +++ b/src/org/andengine/examples/SplitScreenExample.java @@ -16,8 +16,8 @@ import org.andengine.extension.physics.box2d.PhysicsFactory; import org.andengine.extension.physics.box2d.PhysicsWorld; import org.andengine.extension.physics.box2d.util.Vector2Pool; -import org.andengine.input.sensor.accelerometer.AccelerometerData; -import org.andengine.input.sensor.accelerometer.IAccelerometerListener; +import org.andengine.input.sensor.acceleration.AccelerationData; +import org.andengine.input.sensor.acceleration.IAccelerationListener; import org.andengine.input.touch.TouchEvent; import org.andengine.opengl.texture.TextureOptions; import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; @@ -41,7 +41,7 @@ * @author Nicolas Gramlich * @since 18:47:08 - 19.03.2010 */ -public class SplitScreenExample extends SimpleBaseGameActivity implements IAccelerometerListener, IOnSceneTouchListener { +public class SplitScreenExample extends SimpleBaseGameActivity implements IAccelerationListener, IOnSceneTouchListener { // =========================================================== // Constants // =========================================================== @@ -144,24 +144,30 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override - public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) { + public void onAccelerationChanged(final AccelerationData pAccelerometerData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } + + @Override + public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { + // TODO Auto-generated method stub + + } @Override public void onResumeGame() { super.onResumeGame(); - this.enableAccelerometerSensor(this); + this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); - this.disableAccelerometerSensor(); + this.disableAccelerationSensor(); } // =========================================================== diff --git a/src/org/andengine/examples/app/cityradar/CityRadarActivity.java b/src/org/andengine/examples/app/cityradar/CityRadarActivity.java index 02fa5e0..3ee4fdf 100644 --- a/src/org/andengine/examples/app/cityradar/CityRadarActivity.java +++ b/src/org/andengine/examples/app/cityradar/CityRadarActivity.java @@ -243,6 +243,12 @@ protected void onPause() { public void onOrientationChanged(final OrientationData pOrientationData) { this.mCamera.setRotation(-pOrientationData.getYaw()); } + + @Override + public void onOrientationAccuracyChanged(OrientationData pOrientationData) { + // TODO Auto-generated method stub + + } @Override public void onLocationChanged(final Location pLocation) { From 765f2975e2383313a36a8b6564342dddb9233c33 Mon Sep 17 00:00:00 2001 From: recastro Date: Tue, 14 Feb 2012 20:34:01 +0100 Subject: [PATCH 10/12] revert classpath changes --- .classpath | 1 - 1 file changed, 1 deletion(-) diff --git a/.classpath b/.classpath index 24e3f8a..a4763d1 100644 --- a/.classpath +++ b/.classpath @@ -4,6 +4,5 @@ - From 42d542e5192d17ae60632e22cd247614fc46c9f0 Mon Sep 17 00:00:00 2001 From: recastro Date: Tue, 14 Feb 2012 20:39:45 +0100 Subject: [PATCH 11/12] revert bad merge --- src/org/andengine/examples/BoundCameraExample.java | 11 ----------- src/org/andengine/examples/SplitScreenExample.java | 11 ----------- .../examples/app/cityradar/CityRadarActivity.java | 6 ------ 3 files changed, 28 deletions(-) diff --git a/src/org/andengine/examples/BoundCameraExample.java b/src/org/andengine/examples/BoundCameraExample.java index 358d041..395ceee 100644 --- a/src/org/andengine/examples/BoundCameraExample.java +++ b/src/org/andengine/examples/BoundCameraExample.java @@ -190,22 +190,11 @@ public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { } @Override -<<<<<<< HEAD - public void onAccelerationChanged(final AccelerationData pAccelerometerData) { - final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); -======= public void onAccelerationChanged(final AccelerationData pAccelerationData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerationData.getX(), pAccelerationData.getY()); ->>>>>>> upstream/GLES2 this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } - - @Override - public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { - // TODO Auto-generated method stub - - } @Override public void onResumeGame() { diff --git a/src/org/andengine/examples/SplitScreenExample.java b/src/org/andengine/examples/SplitScreenExample.java index 213a3a1..466e848 100644 --- a/src/org/andengine/examples/SplitScreenExample.java +++ b/src/org/andengine/examples/SplitScreenExample.java @@ -144,10 +144,6 @@ public boolean onSceneTouchEvent(final Scene pScene, final TouchEvent pSceneTouc } @Override -<<<<<<< HEAD - public void onAccelerationChanged(final AccelerationData pAccelerometerData) { - final Vector2 gravity = Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY()); -======= public void onAccelerationAccuracyChanged(final AccelerationData pAccelerationData) { } @@ -155,16 +151,9 @@ public void onAccelerationAccuracyChanged(final AccelerationData pAccelerationDa @Override public void onAccelerationChanged(final AccelerationData pAccelerationData) { final Vector2 gravity = Vector2Pool.obtain(pAccelerationData.getX(), pAccelerationData.getY()); ->>>>>>> upstream/GLES2 this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } - - @Override - public void onAccelerationAccuracyChanged(AccelerationData pAccelerationData) { - // TODO Auto-generated method stub - - } @Override public void onResumeGame() { diff --git a/src/org/andengine/examples/app/cityradar/CityRadarActivity.java b/src/org/andengine/examples/app/cityradar/CityRadarActivity.java index 681ed58..847e507 100644 --- a/src/org/andengine/examples/app/cityradar/CityRadarActivity.java +++ b/src/org/andengine/examples/app/cityradar/CityRadarActivity.java @@ -248,12 +248,6 @@ public void onOrientationAccuracyChanged(final OrientationData pOrientationData) public void onOrientationChanged(final OrientationData pOrientationData) { this.mCamera.setRotation(-pOrientationData.getYaw()); } - - @Override - public void onOrientationAccuracyChanged(OrientationData pOrientationData) { - // TODO Auto-generated method stub - - } @Override public void onLocationChanged(final Location pLocation) { From 385dc7153b6000be72621a8f98d78b1a1ebfd387 Mon Sep 17 00:00:00 2001 From: phanvdam Date: Tue, 21 Jul 2015 13:23:12 +0700 Subject: [PATCH 12/12] Update PhysicsExample.java Fix triangle physics body --- src/org/andengine/examples/PhysicsExample.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/andengine/examples/PhysicsExample.java b/src/org/andengine/examples/PhysicsExample.java index 5696c3e..a079a1d 100644 --- a/src/org/andengine/examples/PhysicsExample.java +++ b/src/org/andengine/examples/PhysicsExample.java @@ -217,7 +217,7 @@ private static Body createTriangleBody(final PhysicsWorld pPhysicsWorld, final I final float top = -halfHeight; final float bottom = halfHeight; - final float left = -halfHeight; + final float left = -halfWidth; final float centerX = 0; final float right = halfWidth;