Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/local.properties
.gradle
.idea
enigma/src/main/assets/resources.res
enigma/build.gradle
Binary file removed .gradle/4.10.2/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/4.10.2/fileContent/fileContent.lock
Binary file not shown.
Binary file removed .gradle/4.10.2/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/4.10.2/fileHashes/fileHashes.lock
Binary file not shown.
Binary file removed .gradle/4.10.2/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file removed .gradle/4.10.2/javaCompile/javaCompile.lock
Binary file not shown.
Binary file removed .gradle/4.10.2/javaCompile/taskHistory.bin
Binary file not shown.
Binary file removed .gradle/4.10.2/taskHistory/taskHistory.bin
Binary file not shown.
Binary file removed .gradle/4.10.2/taskHistory/taskHistory.lock
Binary file not shown.
Binary file removed .gradle/5.1.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file removed .gradle/5.1.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file removed .gradle/5.1.1/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/5.1.1/fileContent/fileContent.lock
Binary file not shown.
Binary file removed .gradle/5.1.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/5.1.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file removed .gradle/5.1.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file removed .gradle/5.1.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file removed .gradle/5.1.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file removed .gradle/5.1.1/javaCompile/taskHistory.bin
Binary file not shown.
Binary file removed .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 0 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties

This file was deleted.

Binary file removed .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file removed .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file removed .idea/caches/gradle_models.ser
Binary file not shown.
4 changes: 0 additions & 4 deletions .idea/encodings.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/gradle.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

450 changes: 0 additions & 450 deletions .idea/workspace.xml

This file was deleted.

7 changes: 4 additions & 3 deletions android.iml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<module external.linked.project.id="android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/null/android/android" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/null/android/android" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:4.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -22,8 +22,8 @@ subprojects {

allprojects {
repositories {
jcenter()
google()
mavenCentral()
}
}

Expand Down
21 changes: 12 additions & 9 deletions enigma/Android.mk
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
ENIGMA_ROOT := $(call my-dir)/../../
ENIGMA_SHELL := $(ENIGMA_ROOT)/ENIGMAsystem/SHELL
EXTERNAL := $(ENIGMA_ROOT)/android/external
WORKDIR := /tmp/ENIGMA

FIX_PATHS := $(shell bash -c "$(ENIGMA_ROOT)/android/fix_paths.sh $(WORKDIR) $(ENIGMA_SHELL) $(ENIGMA_ROOT)")

include $(WORKDIR)/build.makefiles

include $(EXTERNAL)/SDL2/Android.mk
include $(CLEAR_VARS)

LOCAL_MODULE := enigma

LOCAL_C_INCLUDES := $(ENIGMA_SHELL) $(EXTERNAL)/hacks $(EXTERNAL)/libepoxy/include/
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
IGNORE_WARNINGS := -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-dollar-in-identifier-extension

LOCAL_C_INCLUDES += $(ENIGMA_ROOT)/shared $(ENIGMA_SHELL)/Bridges/OpenGLES/ $(EXTERNAL)/SDL2/include/ $(EXTERNAL)/glad/gles2/include $(EXTERNAL)/glm $(ENIGMA_SHELL)/Platforms/SDL/fileio /tmp/ENIGMA
LOCAL_CFLAGS := -DDEBUG_MODE -DENIGMA_PLATFORM_SDL
LOCAL_CPPFLAGS := -stdlib=libc++ -std=c++17
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_CFLAGS := $(shell cat $(WORKDIR)/build.cflags) $(IGNORE_WARNINGS)
LOCAL_CPPFLAGS := -stdlib=libc++ -I$(EXTERNAL)/hacks $(shell cat $(WORKDIR)/build.cxxflags) $(IGNORE_WARNINGS)

LOCAL_SRC_FILES := $(addprefix $(ENIGMA_SHELL)/, $(shell cat $(WORKDIR)/sources.list)) $(EXTERNAL)/glad/gles2/src/glad.c
LOCAL_SRC_FILES := $(shell cat $(WORKDIR)/sources.list)

LOCAL_SHARED_LIBRARIES := SDL2
LOCAL_LDLIBS := -lGLESv2 -llog -lz
LOCAL_SHARED_LIBRARIES := $(shell cat $(WORKDIR)/libs.in)
LOCAL_LDLIBS := $(shell cat $(WORKDIR)/ldlibs.in) -llog -lz
include $(BUILD_SHARED_LIBRARY)
52 changes: 0 additions & 52 deletions enigma/build.gradle

This file was deleted.

51 changes: 51 additions & 0 deletions enigma/build.gradle.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion %ANDROID_API_LEVEL%
ndkVersion "%ANDROID_NDK_VERSION%"
defaultConfig {
applicationId "enigma.game"
minSdkVersion 19
targetSdkVersion %ANDROID_API_LEVEL%
versionCode 1
versionName "1.0"
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-19"
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
}

applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "$System.env.BASENAME"
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets.main {
jniLibs.srcDir 'libs'
}

externalNativeBuild {
ndkBuild {
buildStagingDirectory "$System.env.WORKDIR/ndk-build"
path './Android.mk'
}
}

lintOptions {
abortOnError false
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
}
10 changes: 5 additions & 5 deletions enigma/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<!-- Touchscreen support -->
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
android:required="true" />

<!-- Game controller support -->
<uses-feature
android:name="android.hardware.gamepad"
android:required="false" />
android:required="true" />

<!-- External mouse input events -->
<uses-feature
Expand Down Expand Up @@ -49,10 +49,10 @@
<meta-data android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK" android:value="0"/>
-->

<activity android:name=".ENIGMAActivity"
android:label="@string/app_name"
<activity
android:name=".ENIGMAActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
>
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
3 changes: 3 additions & 0 deletions enigma/src/main/java/org/libsdl/app/HIDDevice.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.libsdl.app;

import android.hardware.usb.UsbDevice;

interface HIDDevice
{
public int getId();
Expand All @@ -9,6 +11,7 @@ interface HIDDevice
public int getVersion();
public String getManufacturerName();
public String getProductName();
public UsbDevice getDevice();
public boolean open();
public int sendFeatureReport(byte[] report);
public int sendOutputReport(byte[] report);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothGattService;
import android.hardware.usb.UsbDevice;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.os.*;

//import com.android.internal.util.HexDump;

import java.lang.Runnable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.UUID;
Expand Down Expand Up @@ -166,13 +166,13 @@ public HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice dev
mHandler = new Handler(Looper.getMainLooper());

mGatt = connectGatt();
final HIDDeviceBLESteamController finalThis = this;
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
finalThis.checkConnectionForChromebookIssue();
}
}, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
// final HIDDeviceBLESteamController finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// finalThis.checkConnectionForChromebookIssue();
// }
// }, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
}

public String getIdentifier() {
Expand All @@ -186,10 +186,13 @@ public BluetoothGatt getGatt() {
// Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead
// of TRANSPORT_LE. Let's force ourselves to connect low energy.
private BluetoothGatt connectGatt(boolean managed) {
try {
Method m = mDevice.getClass().getDeclaredMethod("connectGatt", Context.class, boolean.class, BluetoothGattCallback.class, int.class);
return (BluetoothGatt) m.invoke(mDevice, mManager.getContext(), managed, this, TRANSPORT_LE);
} catch (Exception e) {
if (Build.VERSION.SDK_INT >= 23) {
try {
return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);
} catch (Exception e) {
return mDevice.connectGatt(mManager.getContext(), managed, this);
}
} else {
return mDevice.connectGatt(mManager.getContext(), managed, this);
}
}
Expand Down Expand Up @@ -467,7 +470,7 @@ public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristi
// Only register controller with the native side once it has been fully configured
if (!isRegistered()) {
Log.v(TAG, "Registering Steam Controller with ID: " + getId());
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0);
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0);
setRegistered();
}
}
Expand Down Expand Up @@ -561,6 +564,11 @@ public String getProductName() {
return "Steam Controller";
}

@Override
public UsbDevice getDevice() {
return null;
}

@Override
public boolean open() {
return true;
Expand Down
Loading