Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
修复boat分辨率缩放问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Tungstend committed Apr 18, 2022
1 parent d9c9f55 commit 2440773
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.tungsten.hmclpe.control.view.LayoutPanel;
import com.tungsten.hmclpe.launcher.launch.GameLaunchSetting;

import net.kdt.pojavlaunch.utils.MCOptionUtils;

import cosine.boat.BoatActivity;
import cosine.boat.BoatInput;
import cosine.boat.keyboard.BoatKeycodes;
Expand Down Expand Up @@ -64,6 +66,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
surface.setDefaultBufferSize((int) (width * scaleFactor), (int) (height * scaleFactor));

MCOptionUtils.load(gameLaunchSetting.game_directory);
MCOptionUtils.set("overrideWidth", String.valueOf((int) (width * scaleFactor)));
MCOptionUtils.set("overrideHeight", String.valueOf((int) (height * scaleFactor)));
MCOptionUtils.save(gameLaunchSetting.game_directory);

BoatActivity.setBoatNativeWindow(new Surface(surface));
BoatInput.setEventPipe();
startGame(gameLaunchSetting.javaPath,
Expand Down

0 comments on commit 2440773

Please sign in to comment.