mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-12 01:25:55 +00:00
OpenXR - Force PSP menu aspect ratio
This commit is contained in:
parent
f92990a002
commit
db8b159d9e
@ -319,7 +319,7 @@ void UpdateVRInput(bool(*NativeAxis)(const AxisInput &axis), bool(*NativeKey)(co
|
||||
float cy = height / 2;
|
||||
float speed = (cx + cy) / 2;
|
||||
float x = cx - tan(ToRadians(angles.y - VR_GetConfigFloat(VR_CONFIG_MENU_YAW))) * speed;
|
||||
float y = cy - tan(ToRadians(angles.x)) * speed;
|
||||
float y = cy - tan(ToRadians(angles.x)) * speed * VR_GetConfigFloat(VR_CONFIG_CANVAS_ASPECT);
|
||||
|
||||
//set renderer
|
||||
VR_SetConfig(VR_CONFIG_MOUSE_X, (int)x);
|
||||
@ -330,7 +330,7 @@ void UpdateVRInput(bool(*NativeAxis)(const AxisInput &axis), bool(*NativeKey)(co
|
||||
TouchInput touch;
|
||||
touch.id = mouseController;
|
||||
touch.x = x * dp_xscale;
|
||||
touch.y = (height - y - 1) * dp_yscale;
|
||||
touch.y = (height - y - 1) * dp_yscale / VR_GetConfigFloat(VR_CONFIG_CANVAS_ASPECT);
|
||||
bool pressed = IN_VRGetButtonState(mouseController) & ovrButton_Trigger;
|
||||
if (mousePressed != pressed) {
|
||||
if (pressed) {
|
||||
@ -608,6 +608,7 @@ bool StartVRRender() {
|
||||
}
|
||||
|
||||
// Decide if the scene is 3D or not
|
||||
VR_SetConfigFloat(VR_CONFIG_CANVAS_ASPECT, 480.0f / 272.0f);
|
||||
if ((appMode == VR_DIALOG_MODE) || (appMode == VR_MENU_MODE)) {
|
||||
VR_SetConfig(VR_CONFIG_MODE, VR_MODE_MONO_SCREEN);
|
||||
} else if (g_Config.bEnableVR && !pspKeys[CTRL_SCREEN] && (vr3DGeometryCount > 15)) {
|
||||
|
@ -394,7 +394,7 @@ void VR_FinishFrame( engine_t* engine ) {
|
||||
cylinder_layer.pose.position = pos;
|
||||
cylinder_layer.radius = 12.0f;
|
||||
cylinder_layer.centralAngle = (float)(M_PI * 0.5);
|
||||
cylinder_layer.aspectRatio = 1;
|
||||
cylinder_layer.aspectRatio = VR_GetConfigFloat(VR_CONFIG_CANVAS_ASPECT);
|
||||
|
||||
// Build the cylinder layer
|
||||
if (vrMode == VR_MODE_MONO_SCREEN) {
|
||||
|
@ -20,6 +20,7 @@ enum VRConfig {
|
||||
enum VRConfigFloat {
|
||||
// 2D canvas positioning
|
||||
VR_CONFIG_CANVAS_DISTANCE, VR_CONFIG_MENU_PITCH, VR_CONFIG_MENU_YAW, VR_CONFIG_RECENTER_YAW,
|
||||
VR_CONFIG_CANVAS_ASPECT,
|
||||
|
||||
VR_CONFIG_FLOAT_MAX
|
||||
};
|
||||
|
@ -78,11 +78,7 @@ void CenterDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &f
|
||||
SmallDisplayZoom zoomType = (SmallDisplayZoom)g_Config.iSmallDisplayZoomType;
|
||||
|
||||
if (IsVREnabled()) {
|
||||
if (IsFlatVRScene()) {
|
||||
zoomType = SmallDisplayZoom::AUTO;
|
||||
} else {
|
||||
zoomType = SmallDisplayZoom::STRETCH;
|
||||
}
|
||||
zoomType = SmallDisplayZoom::STRETCH;
|
||||
}
|
||||
|
||||
if (zoomType == SmallDisplayZoom::STRETCH) {
|
||||
|
@ -1305,7 +1305,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JN
|
||||
int width, height;
|
||||
GetVRResolutionPerEye(&width, &height);
|
||||
xres = width;
|
||||
yres = height;
|
||||
yres = height * 272 / 480;
|
||||
dpi = 320;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user