Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Swordfish90 committed Mar 21, 2022
2 parents 90588c9 + 7bde9b4 commit d81fd6c
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 152 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object deps {
const val epoxy = "4.6.3-vinay-compose"
const val serialization = "1.2.2"
const val libretrodroid = "0.7.0"
const val radialgamepad = "0.6.1"
const val radialgamepad = "1.0.0"
}

object libs {
Expand Down
4 changes: 2 additions & 2 deletions lemuroid-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {

android {
defaultConfig {
versionCode = 161
versionName = "1.13.0" // Always remember to update Cores Tag!
versionCode = 163
versionName = "1.13.1" // Always remember to update Cores Tag!
applicationId = "com.swordfish.lemuroid"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,18 +677,23 @@ class GameActivity : BaseGameActivity() {
leftPad.primaryDialMaxSizeDp = DEFAULT_PRIMARY_DIAL_SIZE * leftScale
rightPad.primaryDialMaxSizeDp = DEFAULT_PRIMARY_DIAL_SIZE * rightScale

val baseVerticalMargin = GraphicsUtils.convertDpToPixel(
touchControllerConfig.verticalMarginDP,
applicationContext
)

if (orientation == Configuration.ORIENTATION_PORTRAIT) {
leftPad.spacingBottom = linearInterpolation(
padSettings.marginY,
0f,
maxMargins
).roundToInt()
).roundToInt() + baseVerticalMargin.roundToInt()
leftPad.spacingLeft = 0
rightPad.spacingBottom = linearInterpolation(
padSettings.marginY,
0f,
maxMargins
).roundToInt()
).roundToInt() + baseVerticalMargin.roundToInt()
rightPad.spacingRight = 0

leftPad.offsetX = linearInterpolation(padSettings.marginX, 0f, maxMargins)
Expand All @@ -697,9 +702,9 @@ class GameActivity : BaseGameActivity() {
leftPad.offsetY = 0f
rightPad.offsetY = 0f
} else {
leftPad.spacingBottom = 0
leftPad.spacingBottom = baseVerticalMargin.roundToInt()
leftPad.spacingLeft = linearInterpolation(padSettings.marginX, 0f, maxMargins).roundToInt()
rightPad.spacingBottom = 0
rightPad.spacingBottom = baseVerticalMargin.roundToInt()
rightPad.spacingRight = linearInterpolation(
padSettings.marginX,
0f,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ interface InputClass {
fun getSupportedShortcuts(): List<GameMenuShortcut>
}

fun InputDevice.getInputClass(): InputClass {
fun InputDevice?.getInputClass(): InputClass {
return when {
this == null -> InputClassUnknown
(sources and InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD -> InputClassGamePad
(sources and InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD -> InputClassKeyboard
else -> InputClassUnknown
Expand Down
Loading

0 comments on commit d81fd6c

Please sign in to comment.