Permalink
Browse files

Added Color class and some (I)Entity methods.

  • Loading branch information...
1 parent 3576fee commit a555e04946f972ab47e2eaf7ff45deb37dcf8c0a Nicolas Gramlich committed Apr 10, 2012
Showing with 1,054 additions and 34 deletions.
  1. +6 −1 jni/Android.mk
  2. +90 −0 jni/src/org/andengine/engine/camera/hud/HUD.cpp
  3. +25 −0 jni/src/org/andengine/engine/camera/hud/HUD.h
  4. +90 −0 jni/src/org/andengine/entity/Entity.cpp
  5. +25 −0 jni/src/org/andengine/entity/Entity.h
  6. +29 −4 jni/src/org/andengine/entity/IEntity.h
  7. +16 −0 jni/src/org/andengine/entity/IEntityComparator.h
  8. +32 −21 jni/src/org/andengine/entity/S_Entity.h
  9. +90 −0 jni/src/org/andengine/entity/primitive/Line.cpp
  10. +25 −0 jni/src/org/andengine/entity/primitive/Line.h
  11. +90 −0 jni/src/org/andengine/entity/primitive/Rectangle.cpp
  12. +25 −0 jni/src/org/andengine/entity/primitive/Rectangle.h
  13. +90 −0 jni/src/org/andengine/entity/scene/CameraScene.cpp
  14. +25 −0 jni/src/org/andengine/entity/scene/CameraScene.h
  15. +90 −0 jni/src/org/andengine/entity/scene/Scene.cpp
  16. +25 −0 jni/src/org/andengine/entity/scene/Scene.h
  17. +4 −0 jni/src/org/andengine/entity/scene/background/IBackground.h
  18. +29 −4 jni/src/org/andengine/entity/shape/IAreaShape.h
  19. +29 −4 jni/src/org/andengine/entity/shape/IShape.h
  20. +90 −0 jni/src/org/andengine/entity/sprite/Sprite.cpp
  21. +25 −0 jni/src/org/andengine/entity/sprite/Sprite.h
  22. +40 −0 jni/src/org/andengine/util/color/Color.cpp
  23. +8 −0 jni/src/org/andengine/util/color/Color.h
  24. BIN libs/armeabi-v7a/libandenginescriptingextension.so
  25. BIN libs/armeabi/libandenginescriptingextension.so
  26. +8 −0 src/org/andengine/extension/scripting/engine/camera/hud/HUDProxy.java
  27. +8 −0 src/org/andengine/extension/scripting/entity/EntityProxy.java
  28. +8 −0 src/org/andengine/extension/scripting/entity/primitive/LineProxy.java
  29. +8 −0 src/org/andengine/extension/scripting/entity/primitive/RectangleProxy.java
  30. +8 −0 src/org/andengine/extension/scripting/entity/scene/CameraSceneProxy.java
  31. +8 −0 src/org/andengine/extension/scripting/entity/scene/SceneProxy.java
  32. +8 −0 src/org/andengine/extension/scripting/entity/sprite/SpriteProxy.java
View
@@ -14,7 +14,12 @@ LOCAL_SRC_FILES := \
src/android/content/Context.cpp \
src/android/content/res/AssetManager.cpp \
\
+ src/org/andengine/util/color/Color.cpp \
+ \
src/org/andengine/engine/Engine.cpp \
+ \
+ src/org/andengine/input/touch/TouchEvent.cpp \
+ \
src/org/andengine/opengl/vbo/DrawType.cpp \
src/org/andengine/opengl/vbo/VertexBufferObjectManager.cpp \
src/org/andengine/opengl/texture/TextureManager.cpp \
@@ -27,7 +32,7 @@ LOCAL_SRC_FILES := \
src/org/andengine/opengl/texture/region/BaseTextureRegion.cpp \
src/org/andengine/opengl/texture/region/TextureRegion.cpp \
src/org/andengine/opengl/font/FontManager.cpp \
- src/org/andengine/input/touch/TouchEvent.cpp \
+ \
src/org/andengine/entity/Entity.cpp \
src/org/andengine/entity/shape/Shape.cpp \
src/org/andengine/entity/shape/RectangularShape.cpp \
@@ -5,6 +5,9 @@ static jclass sHUDClass;
static jmethodID sConstructor;
static jmethodID sMethod__GetY;
static jmethodID sMethod__GetX;
+static jmethodID sMethod__SetColor__FFF;
+static jmethodID sMethod__SetColor____org_andengine_util_color_Color__;
+static jmethodID sMethod__SetColor__FFFF;
static jmethodID sMethod__SetScale__FF;
static jmethodID sMethod__SetScale__F;
static jmethodID sMethod__GetRotation;
@@ -19,14 +22,32 @@ static jmethodID sMethod__GetSkewX;
static jmethodID sMethod__GetSkewY;
static jmethodID sMethod__SetSkew__FF;
static jmethodID sMethod__SetSkew__F;
+static jmethodID sMethod__GetRed;
+static jmethodID sMethod__GetGreen;
+static jmethodID sMethod__GetBlue;
+static jmethodID sMethod__GetAlpha;
+static jmethodID sMethod__GetColor;
+static jmethodID sMethod__SetRed__F;
+static jmethodID sMethod__SetGreen__F;
+static jmethodID sMethod__SetBlue__F;
+static jmethodID sMethod__SetAlpha__F;
+static jmethodID sMethod__GetChildCount;
+static jmethodID sMethod__GetChild__I;
+static jmethodID sMethod__GetChild____org_andengine_entity_IEntityMatcher__;
+static jmethodID sMethod__DetachSelf;
static jmethodID sMethod__DetachChild____org_andengine_entity_IEntityMatcher__;
static jmethodID sMethod__DetachChild____org_andengine_entity_IEntity__;
+static jmethodID sMethod__SwapChildren__II;
+static jmethodID sMethod__SwapChildren____org_andengine_entity_IEntity____org_andengine_entity_IEntity__;
JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_engine_camera_hud_HUDProxy_nativeInitClass(JNIEnv* pJNIEnv, jclass pJClass) {
sHUDClass = (jclass)JNI_ENV()->NewGlobalRef(pJClass);
sConstructor = JNI_ENV()->GetMethodID(sHUDClass, "<init>", "(J)V");
sMethod__GetY = JNI_ENV()->GetMethodID(sHUDClass, "getY", "()F");
sMethod__GetX = JNI_ENV()->GetMethodID(sHUDClass, "getX", "()F");
+ sMethod__SetColor__FFF = JNI_ENV()->GetMethodID(sHUDClass, "setColor", "(FFF)V");
+ sMethod__SetColor____org_andengine_util_color_Color__ = JNI_ENV()->GetMethodID(sHUDClass, "setColor", "(Lorg/andengine/util/color/Color;)V");
+ sMethod__SetColor__FFFF = JNI_ENV()->GetMethodID(sHUDClass, "setColor", "(FFFF)V");
sMethod__SetScale__FF = JNI_ENV()->GetMethodID(sHUDClass, "setScale", "(FF)V");
sMethod__SetScale__F = JNI_ENV()->GetMethodID(sHUDClass, "setScale", "(F)V");
sMethod__GetRotation = JNI_ENV()->GetMethodID(sHUDClass, "getRotation", "()F");
@@ -41,8 +62,23 @@ JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_engine_camera_hud_
sMethod__GetSkewY = JNI_ENV()->GetMethodID(sHUDClass, "getSkewY", "()F");
sMethod__SetSkew__FF = JNI_ENV()->GetMethodID(sHUDClass, "setSkew", "(FF)V");
sMethod__SetSkew__F = JNI_ENV()->GetMethodID(sHUDClass, "setSkew", "(F)V");
+ sMethod__GetRed = JNI_ENV()->GetMethodID(sHUDClass, "getRed", "()F");
+ sMethod__GetGreen = JNI_ENV()->GetMethodID(sHUDClass, "getGreen", "()F");
+ sMethod__GetBlue = JNI_ENV()->GetMethodID(sHUDClass, "getBlue", "()F");
+ sMethod__GetAlpha = JNI_ENV()->GetMethodID(sHUDClass, "getAlpha", "()F");
+ sMethod__GetColor = JNI_ENV()->GetMethodID(sHUDClass, "getColor", "()Lorg/andengine/util/color/Color;");
+ sMethod__SetRed__F = JNI_ENV()->GetMethodID(sHUDClass, "setRed", "(F)V");
+ sMethod__SetGreen__F = JNI_ENV()->GetMethodID(sHUDClass, "setGreen", "(F)V");
+ sMethod__SetBlue__F = JNI_ENV()->GetMethodID(sHUDClass, "setBlue", "(F)V");
+ sMethod__SetAlpha__F = JNI_ENV()->GetMethodID(sHUDClass, "setAlpha", "(F)V");
+ sMethod__GetChildCount = JNI_ENV()->GetMethodID(sHUDClass, "getChildCount", "()I");
+ sMethod__GetChild__I = JNI_ENV()->GetMethodID(sHUDClass, "getChild", "(I)Lorg/andengine/entity/IEntity;");
+ sMethod__GetChild____org_andengine_entity_IEntityMatcher__ = JNI_ENV()->GetMethodID(sHUDClass, "getChild", "(Lorg/andengine/entity/IEntityMatcher;)Lorg/andengine/entity/IEntity;");
+ sMethod__DetachSelf = JNI_ENV()->GetMethodID(sHUDClass, "detachSelf", "()Z");
sMethod__DetachChild____org_andengine_entity_IEntityMatcher__ = JNI_ENV()->GetMethodID(sHUDClass, "detachChild", "(Lorg/andengine/entity/IEntityMatcher;)Lorg/andengine/entity/IEntity;");
sMethod__DetachChild____org_andengine_entity_IEntity__ = JNI_ENV()->GetMethodID(sHUDClass, "detachChild", "(Lorg/andengine/entity/IEntity;)Z");
+ sMethod__SwapChildren__II = JNI_ENV()->GetMethodID(sHUDClass, "swapChildren", "(II)Z");
+ sMethod__SwapChildren____org_andengine_entity_IEntity____org_andengine_entity_IEntity__ = JNI_ENV()->GetMethodID(sHUDClass, "swapChildren", "(Lorg/andengine/entity/IEntity;Lorg/andengine/entity/IEntity;)Z");
}
JNIEXPORT jboolean JNICALL Java_org_andengine_extension_scripting_engine_camera_hud_HUDProxy_nativeOnAttached(JNIEnv* pJNIEnv, jobject pJObject, jlong pAddress) {HUD* hUD = (HUD*)pAddress;
@@ -65,6 +101,15 @@ jfloat HUD::getY() {
jfloat HUD::getX() {
return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetX);
}
+void HUD::setColor(jfloat pRed, jfloat pGreen, jfloat pBlue) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetColor__FFF, pRed, pGreen, pBlue);
+}
+void HUD::setColor(Color* pColor) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetColor____org_andengine_util_color_Color__, pColor->unwrap());
+}
+void HUD::setColor(jfloat pRed, jfloat pGreen, jfloat pBlue, jfloat pAlpha) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetColor__FFFF, pRed, pGreen, pBlue, pAlpha);
+}
void HUD::setScale(jfloat pScaleX, jfloat pScaleY) {
JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetScale__FF, pScaleX, pScaleY);
}
@@ -107,6 +152,45 @@ void HUD::setSkew(jfloat pSkewX, jfloat pSkewY) {
void HUD::setSkew(jfloat pSkew) {
JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetSkew__F, pSkew);
}
+jfloat HUD::getRed() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetRed);
+}
+jfloat HUD::getGreen() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetGreen);
+}
+jfloat HUD::getBlue() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetBlue);
+}
+jfloat HUD::getAlpha() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetAlpha);
+}
+Color* HUD::getColor() {
+ return new Color(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetColor));
+}
+void HUD::setRed(jfloat pRed) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetRed__F, pRed);
+}
+void HUD::setGreen(jfloat pGreen) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetGreen__F, pGreen);
+}
+void HUD::setBlue(jfloat pBlue) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetBlue__F, pBlue);
+}
+void HUD::setAlpha(jfloat pAlpha) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetAlpha__F, pAlpha);
+}
+jint HUD::getChildCount() {
+ return JNI_ENV()->CallIntMethod(this->mUnwrapped, sMethod__GetChildCount);
+}
+IEntity* HUD::getChild(jint pIndex) {
+ return new Entity(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetChild__I, pIndex));
+}
+IEntity* HUD::getChild(IEntityMatcher* pEntityMatcher) {
+ return new Entity(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetChild____org_andengine_entity_IEntityMatcher__, pEntityMatcher->unwrap()));
+}
+jboolean HUD::detachSelf() {
+ return JNI_ENV()->CallBooleanMethod(this->mUnwrapped, sMethod__DetachSelf);
+}
IEntity* HUD::detachChild(IEntityMatcher* pEntityMatcher) {
return new Entity(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__DetachChild____org_andengine_entity_IEntityMatcher__, pEntityMatcher->unwrap()));
}
@@ -116,6 +200,12 @@ jboolean HUD::detachChild(IEntity* pEntity) {
jboolean HUD::onAttached() {
return false;
}
+jboolean HUD::swapChildren(jint pIndexA, jint pIndexB) {
+ return JNI_ENV()->CallBooleanMethod(this->mUnwrapped, sMethod__SwapChildren__II, pIndexA, pIndexB);
+}
+jboolean HUD::swapChildren(IEntity* pEntityA, IEntity* pEntityB) {
+ return JNI_ENV()->CallBooleanMethod(this->mUnwrapped, sMethod__SwapChildren____org_andengine_entity_IEntity____org_andengine_entity_IEntity__, pEntityA->unwrap(), pEntityB->unwrap());
+}
jboolean HUD::onDetached() {
return false;
}
@@ -5,11 +5,18 @@
#include <jni.h>
#include "src/AndEngineScriptingExtension.h"
#include "src/org/andengine/entity/scene/CameraScene.h"
+#include "src/org/andengine/util/color/Color.h"
#include "src/org/andengine/entity/IEntity.h"
#include "src/org/andengine/entity/IEntity.h"
+#include "src/org/andengine/util/color/Color.h"
+#include "src/org/andengine/entity/IEntity.h"
+#include "src/org/andengine/entity/IEntityMatcher.h"
+#include "src/org/andengine/entity/IEntity.h"
#include "src/org/andengine/entity/IEntityMatcher.h"
#include "src/org/andengine/entity/IEntity.h"
#include "src/org/andengine/entity/IEntity.h"
+#include "src/org/andengine/entity/IEntity.h"
+#include "src/org/andengine/entity/IEntity.h"
extern "C" {
JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_engine_camera_hud_HUDProxy_nativeInitClass(JNIEnv*, jclass);
@@ -25,6 +32,9 @@ class HUD : public CameraScene {
HUD();
virtual jfloat getY();
virtual jfloat getX();
+ virtual void setColor(jfloat, jfloat, jfloat);
+ virtual void setColor(Color*);
+ virtual void setColor(jfloat, jfloat, jfloat, jfloat);
virtual void setScale(jfloat, jfloat);
virtual void setScale(jfloat);
virtual jfloat getRotation();
@@ -39,9 +49,24 @@ class HUD : public CameraScene {
virtual jfloat getSkewY();
virtual void setSkew(jfloat, jfloat);
virtual void setSkew(jfloat);
+ virtual jfloat getRed();
+ virtual jfloat getGreen();
+ virtual jfloat getBlue();
+ virtual jfloat getAlpha();
+ virtual Color* getColor();
+ virtual void setRed(jfloat);
+ virtual void setGreen(jfloat);
+ virtual void setBlue(jfloat);
+ virtual void setAlpha(jfloat);
+ virtual jint getChildCount();
+ virtual IEntity* getChild(jint);
+ virtual IEntity* getChild(IEntityMatcher*);
+ virtual jboolean detachSelf();
virtual IEntity* detachChild(IEntityMatcher*);
virtual jboolean detachChild(IEntity*);
virtual jboolean onAttached();
+ virtual jboolean swapChildren(jint, jint);
+ virtual jboolean swapChildren(IEntity*, IEntity*);
virtual jboolean onDetached();
protected:
@@ -6,6 +6,9 @@ static jmethodID sConstructor;
static jmethodID sConstructor__FF;
static jmethodID sMethod__GetY;
static jmethodID sMethod__GetX;
+static jmethodID sMethod__SetColor__FFF;
+static jmethodID sMethod__SetColor____org_andengine_util_color_Color__;
+static jmethodID sMethod__SetColor__FFFF;
static jmethodID sMethod__SetScale__FF;
static jmethodID sMethod__SetScale__F;
static jmethodID sMethod__GetRotation;
@@ -20,15 +23,33 @@ static jmethodID sMethod__GetSkewX;
static jmethodID sMethod__GetSkewY;
static jmethodID sMethod__SetSkew__FF;
static jmethodID sMethod__SetSkew__F;
+static jmethodID sMethod__GetRed;
+static jmethodID sMethod__GetGreen;
+static jmethodID sMethod__GetBlue;
+static jmethodID sMethod__GetAlpha;
+static jmethodID sMethod__GetColor;
+static jmethodID sMethod__SetRed__F;
+static jmethodID sMethod__SetGreen__F;
+static jmethodID sMethod__SetBlue__F;
+static jmethodID sMethod__SetAlpha__F;
+static jmethodID sMethod__GetChildCount;
+static jmethodID sMethod__GetChild__I;
+static jmethodID sMethod__GetChild____org_andengine_entity_IEntityMatcher__;
+static jmethodID sMethod__DetachSelf;
static jmethodID sMethod__DetachChild____org_andengine_entity_IEntityMatcher__;
static jmethodID sMethod__DetachChild____org_andengine_entity_IEntity__;
+static jmethodID sMethod__SwapChildren__II;
+static jmethodID sMethod__SwapChildren____org_andengine_entity_IEntity____org_andengine_entity_IEntity__;
JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_entity_EntityProxy_nativeInitClass(JNIEnv* pJNIEnv, jclass pJClass) {
sEntityClass = (jclass)JNI_ENV()->NewGlobalRef(pJClass);
sConstructor = JNI_ENV()->GetMethodID(sEntityClass, "<init>", "(J)V");
sConstructor__FF = JNI_ENV()->GetMethodID(sEntityClass, "<init>", "(JFF)V");
sMethod__GetY = JNI_ENV()->GetMethodID(sEntityClass, "getY", "()F");
sMethod__GetX = JNI_ENV()->GetMethodID(sEntityClass, "getX", "()F");
+ sMethod__SetColor__FFF = JNI_ENV()->GetMethodID(sEntityClass, "setColor", "(FFF)V");
+ sMethod__SetColor____org_andengine_util_color_Color__ = JNI_ENV()->GetMethodID(sEntityClass, "setColor", "(Lorg/andengine/util/color/Color;)V");
+ sMethod__SetColor__FFFF = JNI_ENV()->GetMethodID(sEntityClass, "setColor", "(FFFF)V");
sMethod__SetScale__FF = JNI_ENV()->GetMethodID(sEntityClass, "setScale", "(FF)V");
sMethod__SetScale__F = JNI_ENV()->GetMethodID(sEntityClass, "setScale", "(F)V");
sMethod__GetRotation = JNI_ENV()->GetMethodID(sEntityClass, "getRotation", "()F");
@@ -43,8 +64,23 @@ JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_entity_EntityProxy
sMethod__GetSkewY = JNI_ENV()->GetMethodID(sEntityClass, "getSkewY", "()F");
sMethod__SetSkew__FF = JNI_ENV()->GetMethodID(sEntityClass, "setSkew", "(FF)V");
sMethod__SetSkew__F = JNI_ENV()->GetMethodID(sEntityClass, "setSkew", "(F)V");
+ sMethod__GetRed = JNI_ENV()->GetMethodID(sEntityClass, "getRed", "()F");
+ sMethod__GetGreen = JNI_ENV()->GetMethodID(sEntityClass, "getGreen", "()F");
+ sMethod__GetBlue = JNI_ENV()->GetMethodID(sEntityClass, "getBlue", "()F");
+ sMethod__GetAlpha = JNI_ENV()->GetMethodID(sEntityClass, "getAlpha", "()F");
+ sMethod__GetColor = JNI_ENV()->GetMethodID(sEntityClass, "getColor", "()Lorg/andengine/util/color/Color;");
+ sMethod__SetRed__F = JNI_ENV()->GetMethodID(sEntityClass, "setRed", "(F)V");
+ sMethod__SetGreen__F = JNI_ENV()->GetMethodID(sEntityClass, "setGreen", "(F)V");
+ sMethod__SetBlue__F = JNI_ENV()->GetMethodID(sEntityClass, "setBlue", "(F)V");
+ sMethod__SetAlpha__F = JNI_ENV()->GetMethodID(sEntityClass, "setAlpha", "(F)V");
+ sMethod__GetChildCount = JNI_ENV()->GetMethodID(sEntityClass, "getChildCount", "()I");
+ sMethod__GetChild__I = JNI_ENV()->GetMethodID(sEntityClass, "getChild", "(I)Lorg/andengine/entity/IEntity;");
+ sMethod__GetChild____org_andengine_entity_IEntityMatcher__ = JNI_ENV()->GetMethodID(sEntityClass, "getChild", "(Lorg/andengine/entity/IEntityMatcher;)Lorg/andengine/entity/IEntity;");
+ sMethod__DetachSelf = JNI_ENV()->GetMethodID(sEntityClass, "detachSelf", "()Z");
sMethod__DetachChild____org_andengine_entity_IEntityMatcher__ = JNI_ENV()->GetMethodID(sEntityClass, "detachChild", "(Lorg/andengine/entity/IEntityMatcher;)Lorg/andengine/entity/IEntity;");
sMethod__DetachChild____org_andengine_entity_IEntity__ = JNI_ENV()->GetMethodID(sEntityClass, "detachChild", "(Lorg/andengine/entity/IEntity;)Z");
+ sMethod__SwapChildren__II = JNI_ENV()->GetMethodID(sEntityClass, "swapChildren", "(II)Z");
+ sMethod__SwapChildren____org_andengine_entity_IEntity____org_andengine_entity_IEntity__ = JNI_ENV()->GetMethodID(sEntityClass, "swapChildren", "(Lorg/andengine/entity/IEntity;Lorg/andengine/entity/IEntity;)Z");
}
JNIEXPORT jboolean JNICALL Java_org_andengine_extension_scripting_entity_EntityProxy_nativeOnAttached(JNIEnv* pJNIEnv, jobject pJObject, jlong pAddress) {Entity* entity = (Entity*)pAddress;
@@ -70,6 +106,15 @@ jfloat Entity::getY() {
jfloat Entity::getX() {
return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetX);
}
+void Entity::setColor(jfloat pRed, jfloat pGreen, jfloat pBlue) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetColor__FFF, pRed, pGreen, pBlue);
+}
+void Entity::setColor(Color* pColor) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetColor____org_andengine_util_color_Color__, pColor->unwrap());
+}
+void Entity::setColor(jfloat pRed, jfloat pGreen, jfloat pBlue, jfloat pAlpha) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetColor__FFFF, pRed, pGreen, pBlue, pAlpha);
+}
void Entity::setScale(jfloat pScaleX, jfloat pScaleY) {
JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetScale__FF, pScaleX, pScaleY);
}
@@ -112,6 +157,45 @@ void Entity::setSkew(jfloat pSkewX, jfloat pSkewY) {
void Entity::setSkew(jfloat pSkew) {
JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetSkew__F, pSkew);
}
+jfloat Entity::getRed() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetRed);
+}
+jfloat Entity::getGreen() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetGreen);
+}
+jfloat Entity::getBlue() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetBlue);
+}
+jfloat Entity::getAlpha() {
+ return JNI_ENV()->CallFloatMethod(this->mUnwrapped, sMethod__GetAlpha);
+}
+Color* Entity::getColor() {
+ return new Color(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetColor));
+}
+void Entity::setRed(jfloat pRed) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetRed__F, pRed);
+}
+void Entity::setGreen(jfloat pGreen) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetGreen__F, pGreen);
+}
+void Entity::setBlue(jfloat pBlue) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetBlue__F, pBlue);
+}
+void Entity::setAlpha(jfloat pAlpha) {
+ JNI_ENV()->CallVoidMethod(this->mUnwrapped, sMethod__SetAlpha__F, pAlpha);
+}
+jint Entity::getChildCount() {
+ return JNI_ENV()->CallIntMethod(this->mUnwrapped, sMethod__GetChildCount);
+}
+IEntity* Entity::getChild(jint pIndex) {
+ return new Entity(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetChild__I, pIndex));
+}
+IEntity* Entity::getChild(IEntityMatcher* pEntityMatcher) {
+ return new Entity(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetChild____org_andengine_entity_IEntityMatcher__, pEntityMatcher->unwrap()));
+}
+jboolean Entity::detachSelf() {
+ return JNI_ENV()->CallBooleanMethod(this->mUnwrapped, sMethod__DetachSelf);
+}
IEntity* Entity::detachChild(IEntityMatcher* pEntityMatcher) {
return new Entity(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__DetachChild____org_andengine_entity_IEntityMatcher__, pEntityMatcher->unwrap()));
}
@@ -121,6 +205,12 @@ jboolean Entity::detachChild(IEntity* pEntity) {
jboolean Entity::onAttached() {
return false;
}
+jboolean Entity::swapChildren(jint pIndexA, jint pIndexB) {
+ return JNI_ENV()->CallBooleanMethod(this->mUnwrapped, sMethod__SwapChildren__II, pIndexA, pIndexB);
+}
+jboolean Entity::swapChildren(IEntity* pEntityA, IEntity* pEntityB) {
+ return JNI_ENV()->CallBooleanMethod(this->mUnwrapped, sMethod__SwapChildren____org_andengine_entity_IEntity____org_andengine_entity_IEntity__, pEntityA->unwrap(), pEntityB->unwrap());
+}
jboolean Entity::onDetached() {
return false;
}
Oops, something went wrong.

0 comments on commit a555e04

Please sign in to comment.