Skip to content

Commit a94927f

Browse files
authored
Merge branch 'master' into processing4
2 parents 5e187eb + 62070db commit a94927f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1492
-214
lines changed

core/src/processing/android/PFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
219219
}
220220

221221
@Override
222-
public boolean onOptionsItemSelected(MenuItem item){
222+
public boolean onOptionsItemSelected(MenuItem item) {
223223
if (sketch != null) return sketch.onOptionsItemSelected(item);
224224
return super.onOptionsItemSelected(item);
225225
}

core/src/processing/android/PWatchFaceGLES.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ public void onCreate(SurfaceHolder surfaceHolder) {
173173
public EGLConfig chooseEglConfig(EGLDisplay eglDisplay) {
174174
int[] numEglConfigs = new int[1];
175175
EGLConfig[] eglConfigs = new EGLConfig[1];
176-
if(!EGL14.eglChooseConfig(eglDisplay, CONFIG_ATTRIB_LIST, 0, eglConfigs, 0, eglConfigs.length, numEglConfigs, 0)) {
176+
if (!EGL14.eglChooseConfig(eglDisplay, CONFIG_ATTRIB_LIST, 0, eglConfigs, 0, eglConfigs.length, numEglConfigs, 0)) {
177177
throw new RuntimeException("eglChooseConfig failed");
178-
} else if(numEglConfigs[0] == 0) {
178+
} else if (numEglConfigs[0] == 0) {
179179
throw new RuntimeException("no matching EGL configs");
180180
} else {
181181
return eglConfigs[0];

core/src/processing/core/PApplet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6585,7 +6585,7 @@ static final public boolean parseBoolean(float what) {
65856585
* @return true if 'what' is "true" or "TRUE", false otherwise
65866586
*/
65876587
static final public boolean parseBoolean(String what) {
6588-
return new Boolean(what).booleanValue();
6588+
return Boolean.valueOf(what);
65896589
}
65906590

65916591
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
@@ -6643,7 +6643,7 @@ static final public boolean[] parseBoolean(float what[]) {
66436643
static final public boolean[] parseBoolean(String what[]) {
66446644
boolean outgoing[] = new boolean[what.length];
66456645
for (int i = 0; i < what.length; i++) {
6646-
outgoing[i] = new Boolean(what[i]).booleanValue();
6646+
outgoing[i] = Boolean.valueOf(what[i]);
66476647
}
66486648
return outgoing;
66496649
}
@@ -6932,7 +6932,7 @@ static final public float parseFloat(String what) {
69326932

69336933
static final public float parseFloat(String what, float otherwise) {
69346934
try {
6935-
return new Float(what).floatValue();
6935+
return Float.valueOf(what);
69366936
} catch (NumberFormatException e) { }
69376937

69386938
return otherwise;
@@ -6982,7 +6982,7 @@ static final public float[] parseFloat(String what[], float missing) {
69826982
float output[] = new float[what.length];
69836983
for (int i = 0; i < what.length; i++) {
69846984
try {
6985-
output[i] = new Float(what[i]).floatValue();
6985+
output[i] = Float.valueOf(what[i]);
69866986
} catch (NumberFormatException e) {
69876987
output[i] = missing;
69886988
}

core/src/processing/core/PShapeOBJ.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ static protected void parseMTL(PApplet parent, String path,
358358
// Starting new material.
359359
String mtlname = parts[1];
360360
currentMtl = new OBJMaterial(mtlname);
361-
materialsHash.put(mtlname, new Integer(materials.size()));
361+
materialsHash.put(mtlname, Integer.valueOf(materials.size()));
362362
materials.add(currentMtl);
363363
} else if (parts[0].equals("map_Kd") && parts.length > 1) {
364364
// Loading texture map.

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4413,7 +4413,7 @@ static protected void invScale(PMatrix3D matrix, float x, float y, float z) {
44134413

44144414

44154415
static protected void invScale(PMatrix2D matrix, float x, float y) {
4416-
matrix.preApply(1/x, 0, 0, 1/y, 0, 0);
4416+
matrix.preApply(1/x, 0, 0, 0, 1/y, 0);
44174417
}
44184418

44194419

@@ -6774,25 +6774,25 @@ public void copy(PImage src,
67746774
int scrX0, scrX1;
67756775
int scrY0, scrY1;
67766776
if (invX) {
6777-
scrX0 = dx + dw;
6778-
scrX1 = dx;
6777+
scrX0 = (dx + dw) / src.pixelDensity;
6778+
scrX1 = dx / src.pixelDensity;
67796779
} else {
6780-
scrX0 = dx;
6781-
scrX1 = dx + dw;
6780+
scrX0 = dx / src.pixelDensity;
6781+
scrX1 = (dx + dw) / src.pixelDensity;
67826782
}
67836783

67846784
int texX0 = sx;
67856785
int texX1 = sx + sw;
67866786
int texY0, texY1;
67876787
if (invY) {
6788-
scrY0 = height - (dy + dh);
6789-
scrY1 = height - dy;
6788+
scrY0 = height - (dy + dh) / src.pixelDensity;
6789+
scrY1 = height - dy / src.pixelDensity;
67906790
texY0 = tex.height - (sy + sh);
67916791
texY1 = tex.height - sy;
67926792
} else {
67936793
// Because drawTexture uses bottom-to-top orientation of Y axis.
6794-
scrY0 = height - dy;
6795-
scrY1 = height - (dy + dh);
6794+
scrY0 = height - dy / src.pixelDensity;
6795+
scrY1 = height - (dy + dh) / src.pixelDensity;
67966796
texY0 = sy;
67976797
texY1 = sy + sh;
67986798
}

core/src/processing/opengl/PShapeOpenGL.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,11 @@ public void translate(float tx, float ty, float tz) {
12511251

12521252
@Override
12531253
public void rotate(float angle) {
1254-
transform(ROTATE, angle);
1254+
if (is3D) {
1255+
transform(ROTATE, angle, 0, 0, 1);
1256+
} else {
1257+
transform(ROTATE, angle);
1258+
}
12551259
}
12561260

12571261

mode/languages/mode.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
menu.file.export_signed_package = Export Signed Package
1515
menu.file.export_android_project = Export Android Project
16+
menu.file.export_signed_bundle = Export Signed Bundle
1617

1718
# | File | Edit | Sketch | Android | Tools | Help |
1819
# | Android |
@@ -61,8 +62,11 @@ android_editor.status.exporting_project = Exporting an Android project of the sk
6162
android_editor.status.project_export_completed = Done with project export.
6263
android_editor.status.project_export_failed = Error with project export.
6364
android_editor.status.exporting_package = Exporting signed package...
65+
android_editor.status.exporting_bundle = Exporting signed bundle...
6466
android_editor.status.package_export_completed = Done with package export.
67+
android_editor.status.bundle_export_completed = Done with bundle export.
6568
android_editor.status.package_export_failed = Error with package export.
69+
android_editor.status.bundle_export_failed = Error with bundle export.
6670
android_editor.error.cannot_create_sketch_properties = Error While creating sketch properties file "%s": %s
6771

6872
# ---------------------------------------
@@ -84,8 +88,10 @@ android_mode.dialog.wallpaper_installed_body = Processing just built and install
8488
android_mode.dialog.watchface_installed_title = Watch face installed!
8589
android_mode.dialog.watchface_installed_body = Processing just built and installed your sketch as a watch face on the selected device.<br><br>You need to add it as a favourite watch face on the device and then select it from the watch face picker in order to run it.
8690
android_mode.dialog.cannot_export_package_title = Cannot export package...
91+
android_mode.dialog.cannot_export_bundle_title = Cannot export bundle...
8792
android_mode.dialog.cannot_export_package_body = The sketch still has the default package name. Not good, since this name will uniquely identify your app on the Play store... for ever! Come up with a different package name and write in the AndroidManifest.xml file in the sketch folder, after the "package=" attribute inside the manifest tag, which also contains version code and name. Once you have done that, try exporting the sketch again.<br><br>For more info on distributing apps from Processing,<br>check <a href=\"%s\">this online tutorial</a>.
8893
android_mode.dialog.cannot_use_default_icons_title = Cannot export package...
94+
android_mode.dialog.cannot_use_default_icons_title_bundle = Cannot export bundle...
8995
android_mode.dialog.cannot_use_default_icons_body = The sketch does not include all required app icons. Processing could use its default set of Android icons, which are okay to test the app on your device, but a bad idea to distribute it on the Play store. Create a full set of unique icons for your app, and copy them into the sketch folder. Once you have done that, try exporting the sketch again.<br><br>For more info on distributing apps from Processing,<br>check <a href=\"%s\">this online tutorial</a>.
9096
android_mode.warn.cannot_load_sdk_title = Bad news...
9197
android_mode.warn.cannot_load_sdk_body = The Android SDK could not be loaded.\nThe Android Mode will be disabled.

mode/languages/mode_ko.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
menu.file.export_signed_package = 서명 된 패키지 내보내기
1515
menu.file.export_android_project = 안드로이드 프로젝트 내보내기
16+
menu.file.export_signed_bundle = 안드로이드 번들 내보내기
1617

1718
# | File | Edit | Sketch | Android | Tools | Help |
1819
# | Android |
@@ -27,4 +28,4 @@ menu.android.ar = AR
2728
menu.android.devices = 장치들
2829
menu.android.devices.no_connected_devices = 연결된 기기 없음
2930
menu.android.sdk_updater = SDK 업데이터
30-
menu.android.reset_adb = ADB 재설정
31+
menu.android.reset_adb = ADB 재설정

mode/mode.properties

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name = Android Mode
1+
name = Android Mode for Processing 4
22
authorList = [The Processing Foundation](https://processingfoundation.org/)
33
url = http://android.processing.org
4-
sentence = Create projects with Processing for Android devices
5-
paragraph = This version of the Android Mode is for Processing 4.0+
4+
sentence = This mode lets you use Processing to create Android apps
5+
paragraph =
66
imports=processing.mode.java.JavaMode
7-
version = 401
8-
prettyVersion = 4.5.0a2
7+
version = 402
8+
prettyVersion = 4.5.0b1
99
minRevision = 1276
1010
maxRevision = 0
11+

0 commit comments

Comments
 (0)