Use PSP native 480x272 dimensions
Window, menu canvas and video surface are now 480x272 (the PSP screen size). Video is stretched to fill the screen like the PSP player, rather than aspect-preserving letterboxing.
This commit is contained in:
@@ -35,8 +35,8 @@ import java.nio.file.Path;
|
|||||||
/** JavaFX application entry point for the UMD player. */
|
/** JavaFX application entry point for the UMD player. */
|
||||||
public final class PlayerApp extends Application {
|
public final class PlayerApp extends Application {
|
||||||
|
|
||||||
private static final int WIDTH = 854;
|
private static final int WIDTH = 480;
|
||||||
private static final int HEIGHT = 480;
|
private static final int HEIGHT = 272;
|
||||||
|
|
||||||
private Canvas menuCanvas;
|
private Canvas menuCanvas;
|
||||||
private Canvas videoCanvas;
|
private Canvas videoCanvas;
|
||||||
@@ -198,12 +198,8 @@ public final class PlayerApp extends Application {
|
|||||||
g.setFill(Color.BLACK);
|
g.setFill(Color.BLACK);
|
||||||
g.fillRect(0, 0, canvasWidth, canvasHeight);
|
g.fillRect(0, 0, canvasWidth, canvasHeight);
|
||||||
|
|
||||||
double scale = java.lang.Math.min(canvasWidth / image.getWidth(), canvasHeight / image.getHeight());
|
// The PSP stretches the anamorphic 720x480 frame to fill 480x272.
|
||||||
double drawWidth = image.getWidth() * scale;
|
g.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
||||||
double drawHeight = image.getHeight() * scale;
|
|
||||||
double x = (canvasWidth - drawWidth) / 2;
|
|
||||||
double y = (canvasHeight - drawHeight) / 2;
|
|
||||||
g.drawImage(image, x, y, drawWidth, drawHeight);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user