diff --git a/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp b/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp index 9b9934a..b7a0ed9 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/sound/snd_world.cpp @@ -1771,7 +1771,7 @@ void idSoundWorldLocal::AddChannelContribution( idSoundEmitterLocal *sound, idSo idAngles directionYaw(0, 180 + (direction.ToYaw() - bodyAng.yaw), 0); directionYaw.Normalize360(); - int intensity = (int)((distance * 100)/ 150.0f); + int intensity = 100 - (int)((distance * 100)/ 150.0f); Doom3Quest_HapticUpdateEvent(shader->GetName(), intensity, directionYaw.yaw); } else{ Doom3Quest_HapticUpdateEvent(shader->GetName(), 0, 0); diff --git a/java/com/drbeef/doom3quest/GLES3JNIActivity.java b/java/com/drbeef/doom3quest/GLES3JNIActivity.java index a5fcf62..93e0c8c 100644 --- a/java/com/drbeef/doom3quest/GLES3JNIActivity.java +++ b/java/com/drbeef/doom3quest/GLES3JNIActivity.java @@ -151,13 +151,6 @@ import static android.system.Os.setenv; checkPermissionsAndInitialize(); } - private void requestPermissions() { - ActivityCompat.requestPermissions(this, - new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.WRITE_EXTERNAL_STORAGE}, - 1); - } - /** Initializes the Activity only if the permission has been granted. */ private void checkPermissionsAndInitialize() { // Boilerplate for checking runtime permissions in Android. @@ -166,14 +159,10 @@ import static android.system.Os.setenv; ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, - 1); + WRITE_EXTERNAL_STORAGE_PERMISSION_ID); } else { - permissionCount++; - } - - if (permissionCount == 1) { // Permissions have already been granted. create(); } @@ -183,14 +172,9 @@ import static android.system.Os.setenv; @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] results) { if (requestCode == WRITE_EXTERNAL_STORAGE_PERMISSION_ID) { - if (results.length > 0 && results[0] != PackageManager.PERMISSION_GRANTED) { - - finish(); - System.exit(0); - } + finish(); + System.exit(0); } - - checkPermissionsAndInitialize(); } public void create() {