Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 1a7bef6

Browse files
committed
Don't need to check screen count in UInputMan::ForceMouseWithinPlayerScreen (followup to 12209a2)
1 parent 12209a2 commit 1a7bef6

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

Managers/UInputMan.cpp

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -382,32 +382,27 @@ namespace RTE {
382382
if (whichPlayer >= Players::PlayerOne && whichPlayer < Players::MaxPlayerCount) {
383383
int screenWidth = g_FrameMan.GetPlayerFrameBufferWidth(whichPlayer) * g_FrameMan.GetResMultiplier();
384384
int screenHeight = g_FrameMan.GetPlayerFrameBufferHeight(whichPlayer) * g_FrameMan.GetResMultiplier();
385-
int screenCount = g_FrameMan.GetScreenCount();
386385

387-
if (screenCount > 1) {
388-
switch (g_ActivityMan.GetActivity()->ScreenOfPlayer(whichPlayer)) {
389-
case 0:
390-
ForceMouseWithinBox(0, 0, screenWidth, screenHeight, whichPlayer);
391-
break;
392-
case 1:
393-
if (screenCount >= 2 && g_FrameMan.GetVSplit()) {
394-
ForceMouseWithinBox(screenWidth, 0, screenWidth, screenHeight, whichPlayer);
395-
} else {
396-
ForceMouseWithinBox(0, screenHeight, screenWidth, screenHeight, whichPlayer);
397-
}
398-
break;
399-
case 2:
386+
switch (g_ActivityMan.GetActivity()->ScreenOfPlayer(whichPlayer)) {
387+
case 0:
388+
ForceMouseWithinBox(0, 0, screenWidth, screenHeight, whichPlayer);
389+
break;
390+
case 1:
391+
if (g_FrameMan.GetVSplit()) {
392+
ForceMouseWithinBox(screenWidth, 0, screenWidth, screenHeight, whichPlayer);
393+
} else {
400394
ForceMouseWithinBox(0, screenHeight, screenWidth, screenHeight, whichPlayer);
401-
break;
402-
case 3:
403-
ForceMouseWithinBox(screenWidth, screenHeight, screenWidth, screenHeight, whichPlayer);
404-
break;
405-
default:
406-
// ScreenOfPlayer will return -1 for inactive player so do nothing.
407-
break;
408-
}
409-
} else {
410-
ForceMouseWithinBox(0, 0, screenWidth, screenHeight, whichPlayer);
395+
}
396+
break;
397+
case 2:
398+
ForceMouseWithinBox(0, screenHeight, screenWidth, screenHeight, whichPlayer);
399+
break;
400+
case 3:
401+
ForceMouseWithinBox(screenWidth, screenHeight, screenWidth, screenHeight, whichPlayer);
402+
break;
403+
default:
404+
// ScreenOfPlayer will return -1 for inactive player so do nothing.
405+
break;
411406
}
412407
}
413408
}

0 commit comments

Comments
 (0)