Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d4c20ff
FIxed a bug in ParallelModifier, being only as long as the shortest m…
Aug 7, 2011
85bc69c
Added conveniences method in BaseGameActivity to get TextureManager a…
Aug 8, 2011
acff759
Add ScaleInitializer and OnAndOffCameraExpireModifier
Aug 9, 2011
1db408c
Fix copyright years.
Aug 9, 2011
085fe2a
Allow linking particle modifiers to an ExpireModifier so they end whe…
Aug 9, 2011
0672ac8
Fixed potential font bleeding. (Thx to Oren Bengigi)
Aug 10, 2011
bb5d716
Fixed a bug in SpriteBatch.
Aug 10, 2011
e3e55f0
Some documentation and tweaks to ContainerExpireModifier
Aug 10, 2011
5110506
Merged default
Aug 10, 2011
1b760ca
Temporary commit.
Aug 10, 2011
eb9602b
Added MoveByModifier (and necessary subclasses).
Aug 10, 2011
324b8f7
Merge from default
Aug 10, 2011
cbaaf85
Minor changes.
Aug 10, 2011
b943f1c
Fixed DoubleValueChangeEntityModifier to properly implement IEntityMo…
Aug 10, 2011
10fd293
Merge from default branch
Aug 10, 2011
0ea7fa6
Minor change.
Aug 12, 2011
b97e87b
Made allocation of a texture on the hardware NOT allocate an addition…
Aug 12, 2011
006ffc7
Removed GL_TEXTURE_ENV_MODE from TextureOptions.
Aug 12, 2011
ce41453
Fixed getting PVRTexturformat from Pixelformat.
Aug 12, 2011
f349184
Dramatically reduced memory allocation when loading PVRCCZTextures.
Aug 14, 2011
1c45d4e
Minor changes.
Aug 14, 2011
dbd2d28
Reduced memory consumption of PVRTexture further.
Aug 14, 2011
ba050fe
ProTip: Stop using GLES20 on the GLES1 branch! =(
Aug 15, 2011
8b92c90
Removed TextureRegionCrop code, because it wasn't used anymore.
Aug 15, 2011
2019d4f
Removed TextureRegionCrop code, because it wasn't used anymore.
Aug 15, 2011
b8c74f7
ChangesetTagBranchUserDateSummary
Aug 16, 2011
da744f3
Finished changing from clone() to deepCopy().
Aug 16, 2011
8bccad0
Removed duplicate codein Bezier modifiers.
Aug 17, 2011
f0158f6
Eventually fixed a bug when not compiling with eclipse.
Aug 18, 2011
a5ae90a
Eventually fixed a bug when not compiling with eclipse.
Aug 18, 2011
b2c9a5f
Properly synchronized TextureManager, FontManager and ShaderProgramMa…
Aug 18, 2011
e52d737
Remove unused import
Aug 18, 2011
83e993c
Merge Particle branch into default
Aug 20, 2011
69ccc36
Minor change.
Aug 22, 2011
1578f9f
Updated to latest SDK tools. Added a method in Camera to convert from…
Feb 16, 2012
004954f
Added IEntity.query methods.
Feb 16, 2012
51181cd
Updated default.properties.
Feb 16, 2012
9a66be2
Removed old default.propties to stop eclipse from bitching around and…
Feb 17, 2012
4bc42a5
Fixed issue #70.
Apr 9, 2012
f08a131
fix Direction to allow 8-pos
Jun 6, 2012
dd8c19e
Merge pull request #124 from winniehell/direction-patch
Jul 11, 2012
498270f
backported texture-padding feature from GLES2-branch
tom-braun Nov 14, 2012
9de9d87
re-added one-argument constructor
tom-braun Nov 15, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
target/**
bin/**
doc/**
gen/**
.DS_Store
Thumbs.db
gdb.setup
gdbserver
.svn
.hg
local.properties
.settings
AndEngine.iml
85 changes: 85 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="AndEngine" default="help">

<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />

<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:

source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.

For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml

Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.

This file is an integral part of the build system for your
application and should be checked into Version Control Systems.

-->
<property file="ant.properties" />

<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.

This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).

This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />

<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir"
/>


<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>

/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->

<!-- Import the actual build file.

To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.

***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />

</project>
3 changes: 3 additions & 0 deletions lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
</lint>
40 changes: 40 additions & 0 deletions proguard.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
8 changes: 4 additions & 4 deletions default.properties → project.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
#
# This file must be checked in Version Control Systems.
#
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# "ant.properties", and override values to adapt the script to your
# project structure.

android.library=true
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-8
android.library=true
4 changes: 4 additions & 0 deletions src/org/anddev/andengine/engine/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ protected void convertSurfaceToSceneTouchEvent(final Camera pCamera, final Touch
pCamera.convertSurfaceToSceneTouchEvent(pSurfaceTouchEvent, this.mSurfaceWidth, this.mSurfaceHeight);
}

protected void convertSceneToSurfaceTouchEvent(final Camera pCamera, final TouchEvent pSurfaceTouchEvent) {
pCamera.convertSceneToSurfaceTouchEvent(pSurfaceTouchEvent, this.mSurfaceWidth, this.mSurfaceHeight);
}

public void onLoadComplete(final Scene pScene) {
this.setScene(pScene);
}
Expand Down
45 changes: 39 additions & 6 deletions src/org/anddev/andengine/engine/camera/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,19 @@ public void convertSurfaceToSceneTouchEvent(final TouchEvent pSurfaceTouchEvent,
final float relativeX;
final float relativeY;

final float surfaceTouchEventX = pSurfaceTouchEvent.getX();
final float surfaceTouchEventY = pSurfaceTouchEvent.getY();

final float rotation = this.mRotation;
if(rotation == 0) {
relativeX = pSurfaceTouchEvent.getX() / pSurfaceWidth;
relativeY = pSurfaceTouchEvent.getY() / pSurfaceHeight;
relativeX = surfaceTouchEventX / pSurfaceWidth;
relativeY = surfaceTouchEventY / pSurfaceHeight;
} else if(rotation == 180) {
relativeX = 1 - (pSurfaceTouchEvent.getX() / pSurfaceWidth);
relativeY = 1 - (pSurfaceTouchEvent.getY() / pSurfaceHeight);
relativeX = 1 - (surfaceTouchEventX / pSurfaceWidth);
relativeY = 1 - (surfaceTouchEventY / pSurfaceHeight);
} else {
VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = pSurfaceTouchEvent.getX();
VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = pSurfaceTouchEvent.getY();
VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = surfaceTouchEventX;
VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = surfaceTouchEventY;

MathUtils.rotateAroundCenter(VERTICES_TOUCH_TMP, rotation, pSurfaceWidth / 2, pSurfaceHeight / 2);

Expand All @@ -404,6 +407,36 @@ private void convertAxisAlignedSurfaceToSceneTouchEvent(final TouchEvent pSurfac
pSurfaceTouchEvent.set(x, y);
}

public void convertSceneToSurfaceTouchEvent(final TouchEvent pSceneTouchEvent, final int pSurfaceWidth, final int pSurfaceHeight) {
this.convertAxisAlignedSceneToSurfaceTouchEvent(pSceneTouchEvent, pSurfaceWidth, pSurfaceHeight);

final float rotation = this.mRotation;
if(rotation == 0) {
/* Nothing to do. */
} else if(rotation == 180) {
pSceneTouchEvent.set(pSurfaceWidth - pSceneTouchEvent.getX(), pSurfaceHeight - pSceneTouchEvent.getY());
} else {
VERTICES_TOUCH_TMP[VERTEX_INDEX_X] = pSceneTouchEvent.getX();
VERTICES_TOUCH_TMP[VERTEX_INDEX_Y] = pSceneTouchEvent.getY();

MathUtils.revertRotateAroundCenter(VERTICES_TOUCH_TMP, rotation, pSurfaceWidth >> 1, pSurfaceHeight >> 1);

pSceneTouchEvent.set(VERTICES_TOUCH_TMP[VERTEX_INDEX_X], VERTICES_TOUCH_TMP[VERTEX_INDEX_Y]);
}
}

private void convertAxisAlignedSceneToSurfaceTouchEvent(final TouchEvent pSceneTouchEvent, final int pSurfaceWidth, final int pSurfaceHeight) {
final float minX = this.getMinX();
final float maxX = this.getMaxX();
final float minY = this.getMinY();
final float maxY = this.getMaxY();

final float relativeX = (pSceneTouchEvent.getX() - minX) / (maxX - minX);
final float relativeY = (pSceneTouchEvent.getY() - minY) / (maxY - minY);

pSceneTouchEvent.set(relativeX * pSurfaceWidth, relativeY * pSurfaceHeight);
}

// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
Expand Down
43 changes: 43 additions & 0 deletions src/org/anddev/andengine/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import javax.microedition.khronos.opengles.GL10;

Expand Down Expand Up @@ -516,6 +517,48 @@ public IEntity findChild(final IEntityMatcher pEntityMatcher) {
return this.mChildren.find(pEntityMatcher);
}


@Override
public ArrayList<IEntity> query(final IEntityMatcher pEntityMatcher) {
return this.query(pEntityMatcher, new ArrayList<IEntity>());
}

@Override
public <L extends List<IEntity>> L query(final IEntityMatcher pEntityMatcher, final L pResult) {
final int childCount = this.getChildCount();
for(int i = 0; i < childCount; i++) {
final IEntity item = this.mChildren.get(i);
if(pEntityMatcher.matches(item)) {
pResult.add(item);
}

item.query(pEntityMatcher, pResult);
}

return pResult;
}

@Override
public <S extends IEntity> ArrayList<S> queryForSubclass(final IEntityMatcher pEntityMatcher) throws ClassCastException {
return this.queryForSubclass(pEntityMatcher, new ArrayList<S>());
}

@SuppressWarnings("unchecked")
@Override
public <L extends List<S>, S extends IEntity> L queryForSubclass(final IEntityMatcher pEntityMatcher, final L pResult) throws ClassCastException {
final int childCount = this.getChildCount();
for(int i = 0; i < childCount; i++) {
final IEntity item = this.mChildren.get(i);
if(pEntityMatcher.matches(item)) {
pResult.add((S)item);
}

item.queryForSubclass(pEntityMatcher, pResult);
}

return pResult;
}

@Override
public boolean swapChildren(final IEntity pEntityA, final IEntity pEntityB) {
return this.swapChildren(this.getChildIndex(pEntityA), this.getChildIndex(pEntityB));
Expand Down
26 changes: 26 additions & 0 deletions src/org/anddev/andengine/entity/IEntity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.anddev.andengine.entity;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.handler.IUpdateHandler;
Expand Down Expand Up @@ -168,6 +170,30 @@ public interface IEntity extends IDrawable, IUpdateHandler {
public boolean setChildIndex(final IEntity pEntity, final int pIndex);

public IEntity findChild(final IEntityMatcher pEntityMatcher);
/**
* @param pEntityMatcher
* @return all children (recursively!) that match the supplied {@link IEntityMatcher}.
*/
public ArrayList<IEntity> query(final IEntityMatcher pEntityMatcher);
/**
* @param pEntityMatcher
* @param pResult the {@link List} to put the result into.
* @return all children (recursively!) that match the supplied {@link IEntityMatcher}.
*/
public <L extends List<IEntity>> L query(final IEntityMatcher pEntityMatcher, final L pResult);
/**
* @param pEntityMatcher
* @return all children (recursively!) that match the supplied {@link IEntityMatcher}.
* @throws ClassCastException when the supplied {@link IEntityMatcher} matched a {@link IEntity} that was not of the requested subtype.
*/
public <S extends IEntity> ArrayList<S> queryForSubclass(IEntityMatcher pEntityMatcher) throws ClassCastException;
/**
* @param pEntityMatcher
* @param pResult the {@link List} to put the result into.
* @return all children (recursively!) that match the supplied {@link IEntityMatcher}.
* @throws ClassCastException when the supplied {@link IEntityMatcher} matched a {@link IEntity} that was not of the requested subtype.
*/
public <L extends List<S>, S extends IEntity> L queryForSubclass(final IEntityMatcher pEntityMatcher, final L pResult) throws ClassCastException;

public boolean swapChildren(final int pIndexA, final int pIndexB);
public boolean swapChildren(final IEntity pEntityA, final IEntity pEntityB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected AlphaModifier(final AlphaModifier pAlphaModifier) {
}

@Override
public AlphaModifier clone(){
public AlphaModifier deepCopy(){
return new AlphaModifier(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected ColorModifier(final ColorModifier pColorModifier) {
}

@Override
public ColorModifier clone(){
public ColorModifier deepCopy(){
return new ColorModifier(this);
}

Expand Down
Loading