Remove legacy accelerometer state.

This commit is contained in:
Unknown W. Brackets 2017-03-14 20:54:30 -07:00
parent 2a745f86ac
commit df67497388
4 changed files with 4 additions and 21 deletions

View File

@ -828,14 +828,6 @@ extern "C" jboolean JNICALL Java_org_ppsspp_ppsspp_NativeApp_accelerometer(JNIEn
if (!renderer_inited)
return false;
// Theoretically this needs locking but I doubt it matters. Worst case, the X
// from one "sensor frame" will be used together with Y from the next.
// Should look into quantization though, for compressed movement storage.
input_state.accelerometer_valid = true;
input_state.acc.x = x;
input_state.acc.y = y;
input_state.acc.z = z;
AxisInput axis;
axis.deviceId = DEVICE_ID_ACCELEROMETER;
axis.flags = 0;

View File

@ -654,7 +654,6 @@ int main(int argc, char *argv[]) {
float t = 0;
float lastT = 0;
while (true) {
input_state.accelerometer_valid = false;
input_state.mouse_valid = true;
SDL_Event event;

View File

@ -348,23 +348,20 @@ void MainUI::updateAccelerometer()
// TODO: Toggle it depending on whether it is enabled
QAccelerometerReading *reading = acc->reading();
if (reading) {
input_state.acc.x = reading->x();
input_state.acc.y = reading->y();
input_state.acc.z = reading->z();
AxisInput axis;
axis.deviceId = DEVICE_ID_ACCELEROMETER;
axis.flags = 0;
axis.axisId = JOYSTICK_AXIS_ACCELEROMETER_X;
axis.value = input_state.acc.x;
axis.value = reading->x();
NativeAxis(axis);
axis.axisId = JOYSTICK_AXIS_ACCELEROMETER_Y;
axis.value = input_state.acc.y;
axis.value = reading->y();
NativeAxis(axis);
axis.axisId = JOYSTICK_AXIS_ACCELEROMETER_Z;
axis.value = input_state.acc.z;
axis.value = reading->z();
NativeAxis(axis);
}
#endif

View File

@ -111,8 +111,7 @@ struct InputState {
// Lock this whenever you access the data in this struct.
mutable std::mutex lock;
InputState()
: mouse_valid(false),
accelerometer_valid(false) {
: mouse_valid(false) {
memset(pointer_down, 0, sizeof(pointer_down));
}
@ -124,10 +123,6 @@ struct InputState {
int pointer_y[MAX_POINTERS];
bool pointer_down[MAX_POINTERS];
// Accelerometer
bool accelerometer_valid;
Vec3 acc;
private:
DISALLOW_COPY_AND_ASSIGN(InputState);
};