Skip to content

Commit

Permalink
all the calculation on the quest side
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Jun 25, 2024
1 parent 604f33f commit c868e1d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
applicationId "org.cagnulein.android_remote"
minSdkVersion 29
targetSdkVersion 32
versionCode 15
versionCode 16
versionName "2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", "android_remote")
Expand Down
Binary file modified app/src/main/assets/scrcpy-server.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions app/src/main/java/org/cagnulein/android_remote/Scrcpy.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public boolean touchevent(MotionEvent touch_event, int displayW, int displayH, b

int[] buf;
if(!landscape) {
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * screenWidth / displayW, (int) touch_event.getY() * screenHeight / displayH};
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * remote_dev_resolution[0] / displayW, (int) touch_event.getY() * remote_dev_resolution[1] / displayH};
} else {
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * screenHeight / displayW, (int) touch_event.getY() * screenWidth / displayH};
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * remote_dev_resolution[1] / displayW, (int) touch_event.getY() * remote_dev_resolution[0] / displayH};
}
String bufStr = Arrays.toString(buf).replaceAll(",", "");
logger.info("touchevent " + bufStr + " " + landscape + " " + displayW + " " + screenWidth + " " +displayH + " " + screenHeight);
Expand Down
5 changes: 3 additions & 2 deletions server/src/main/java/org/cagnulein/android_remote/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ public Point NewgetPhysicalPoint(Point point) {
// Point point = position.getPoint();
int scaledX = point.x * deviceSize.getWidth() / videoSize.getWidth();
int scaledY = point.y * deviceSize.getHeight() / videoSize.getHeight();
if(isPortrait)
/*if(isPortrait)
return new Point(scaledX, scaledY);
else
return new Point(scaledX, scaledY);
return new Point(scaledX, scaledY);*/
return point;
}

public interface RotationListener {
Expand Down

0 comments on commit c868e1d

Please sign in to comment.