Skip to content

Commit c2ce950

Browse files
committed
fix: 🔧修复GameHandler和refreshSize的编译错误
1 parent 768f6f8 commit c2ce950

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

ShardLauncher/src/main/java/com/lanrhyme/shardlauncher/game/launch/handler/GameHandler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ class GameHandler(
5858

5959
private var isGameRendering by mutableStateOf(false)
6060

61-
override suspend fun execute(surface: Surface?, scope: CoroutineScope) {
61+
override suspend fun execute(surface: Surface?, screenSize: IntSize, scope: CoroutineScope) {
6262
ZLBridge.setupBridgeWindow(surface)
63-
super.execute(surface, scope)
63+
super.execute(surface, screenSize, scope)
6464
}
6565

6666
override fun onPause() {

ShardLauncher/src/main/java/com/lanrhyme/shardlauncher/ui/activities/VMActivity.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,15 +494,16 @@ class VMActivity : androidx.activity.ComponentActivity(), SurfaceTextureListener
494494
return resultSize
495495
}
496496

497-
private fun refreshSize() {
498-
refreshWindowSize()
497+
private fun refreshSize(): IntSize {
498+
val size = refreshWindowSize()
499499
mTextureView?.surfaceTexture?.apply {
500500
setDefaultBufferSize(CallbackBridge.windowWidth, CallbackBridge.windowHeight)
501501
} ?: run {
502502
lWarning("Attempt to refresh size on null surface")
503-
return
503+
return size
504504
}
505505
CallbackBridge.sendUpdateWindowSize(CallbackBridge.windowWidth, CallbackBridge.windowHeight)
506+
return size
506507
}
507508
}
508509

0 commit comments

Comments
 (0)