Skip to content

Commit 195ba00

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents f14ba3f + 8e3f2d4 commit 195ba00

File tree

5 files changed

+45
-20
lines changed

5 files changed

+45
-20
lines changed

docs/source/android.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Prebuilt VirtualBox
4343

4444
A good starting point to build an APK are prebuilt VirtualBox images, where
4545
the Android NDK, the Android SDK and the Kivy Python-For-Android sources
46-
are prebuilt in an VirtualBox image. Please search the `Google Python-For-Android forum
47-
<https://groups.google.com/forum/?fromgroups=&pli=1#!forum/python-android>`__ for
46+
are prebuilt in an VirtualBox image. Please search the `Download Section
47+
<http://kivy.org/#download>`__ for
4848
such an image.
4949

5050
Example
@@ -56,7 +56,7 @@ folder:
5656

5757
.. code-block:: python
5858
59-
from pyjnius import autoclass
59+
from jnius import autoclass
6060
6161
...
6262

docs/source/prerequisites.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Prerequisites
33

44
.. note::
55
There is a VirtualBox Image we provide with the prerequisites along with
6-
Android SDK and NDK preinstalled to ease your installation woes. You can download it from `here <http://www.google.com/url?sa=D&q=https://docs.google.com/file/d/0B1WO07-OL50_VDNESDRUaDhXSmM/edit&usg=AFQjCNGrsg0SU8EMgAcLHWxbjSe8KM2kyA>`__.
6+
Android SDK and NDK preinstalled to ease your installation woes. You can download it from `here <http://kivy.org/#download>`__.
77

88
.. warning::
99

recipes/pyjnius/recipe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
VERSION_pyjnius=
44
URL_pyjnius=https://github.com/kivy/pyjnius/zipball/master/pyjnius-master.zip
5-
DEPS_pyjnius=(pygame)
5+
DEPS_pyjnius=(python)
66
MD5_pyjnius=
77
BUILD_pyjnius=$BUILD_PATH/pyjnius/$(get_directory $URL_pyjnius)
88
RECIPE_pyjnius=$RECIPES_PATH/pyjnius

src/jni/jpeg/jidctfst.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464

6565
jpeg_idct_ifast:
66-
PLD (r2, #0)
66+
PLD [r2, #0]
6767
stmdb sp!, {r4,r5, r6,r7, r8,r9, r10,r11, r12,lr}
6868
ldr r4, [sp, #4*10]
6969
sub sp, #local_SIZE
@@ -256,7 +256,7 @@ VLoopHead:
256256

257257
HLoopStart:
258258
// reset pointers
259-
PLD (sp, #off_WORKSPACE)
259+
PLD [sp, #off_WORKSPACE]
260260
add ip, sp, #off_WORKSPACE
261261
ldr r10, local_RANGE_TABLE
262262

@@ -268,7 +268,7 @@ HLoopTail:
268268
str r0, local_OUTPUT_BUF
269269
add fp, r2, r1
270270

271-
PLD (ip, #32)
271+
PLD [ip, #32]
272272
ldmia ip!, {r0-r7}
273273

274274
cmp r1, #0

src/src/org/renpy/android/Hardware.java

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static String getHardwareSensors() {
7171
/**
7272
* Get Access to 3 Axis Hardware Sensors Accelerometer, Orientation and Magnetic Field Sensors
7373
*/
74-
public class generic3AxisSensor implements SensorEventListener {
74+
public static class generic3AxisSensor implements SensorEventListener {
7575
private final SensorManager sSensorManager;
7676
private final Sensor sSensor;
7777
private final int sSensorType;
@@ -114,22 +114,47 @@ public float[] readSensor() {
114114
}
115115
}
116116

117-
public generic3AxisSensor accelerometerSensor = new generic3AxisSensor(Sensor.TYPE_ACCELEROMETER);
118-
public generic3AxisSensor orientationSensor = new generic3AxisSensor(Sensor.TYPE_ORIENTATION);
119-
public generic3AxisSensor magneticFieldSensor = new generic3AxisSensor(Sensor.TYPE_MAGNETIC_FIELD);
117+
public static generic3AxisSensor accelerometerSensor = null;
118+
public static generic3AxisSensor orientationSensor = null;
119+
public static generic3AxisSensor magneticFieldSensor = null;
120120

121121
/**
122122
* functions for backward compatibility reasons
123123
*/
124124

125-
public void accelerometerEnable(boolean enable) { accelerometerSensor.changeStatus(enable); }
126-
public float[] accelerometerReading() { return (float[]) accelerometerSensor.readSensor(); }
127-
public void orientationSensorEnable(boolean enable) { orientationSensor.changeStatus(enable); }
128-
public float[] orientationSensorReading() { return (float[]) orientationSensor.readSensor(); }
129-
public void magneticFieldSensorEnable(boolean enable) { magneticFieldSensor.changeStatus(enable); }
130-
public float[] magneticFieldSensorReading() { return (float[]) magneticFieldSensor.readSensor(); }
131-
132-
125+
public static void accelerometerEnable(boolean enable) {
126+
if ( accelerometerSensor == null )
127+
accelerometerSensor = new generic3AxisSensor(Sensor.TYPE_ACCELEROMETER);
128+
accelerometerSensor.changeStatus(enable);
129+
}
130+
public static float[] accelerometerReading() {
131+
float rv[] = { 0f, 0f, 0f };
132+
if ( accelerometerSensor == null )
133+
return rv;
134+
return (float[]) accelerometerSensor.readSensor();
135+
}
136+
public static void orientationSensorEnable(boolean enable) {
137+
if ( orientationSensor == null )
138+
orientationSensor = new generic3AxisSensor(Sensor.TYPE_ORIENTATION);
139+
orientationSensor.changeStatus(enable);
140+
}
141+
public static float[] orientationSensorReading() {
142+
float rv[] = { 0f, 0f, 0f };
143+
if ( orientationSensor == null )
144+
return rv;
145+
return (float[]) orientationSensor.readSensor();
146+
}
147+
public static void magneticFieldSensorEnable(boolean enable) {
148+
if ( magneticFieldSensor == null )
149+
magneticFieldSensor = new generic3AxisSensor(Sensor.TYPE_MAGNETIC_FIELD);
150+
magneticFieldSensor.changeStatus(enable);
151+
}
152+
public static float[] magneticFieldSensorReading() {
153+
float rv[] = { 0f, 0f, 0f };
154+
if ( magneticFieldSensor == null )
155+
return rv;
156+
return (float[]) magneticFieldSensor.readSensor();
157+
}
133158

134159
static public DisplayMetrics metrics = new DisplayMetrics();
135160

0 commit comments

Comments
 (0)