Skip to content

Commit

Permalink
Fixed #99 SD Mode cut screens on small TVs
Browse files Browse the repository at this point in the history
  • Loading branch information
lvcabral committed Nov 16, 2019
1 parent a10c4da commit 7cce4f7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 26 deletions.
Binary file modified images/icon_arrows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/icon_arrows_bw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/keyboard-cursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 4 additions & 16 deletions source/gameMain.brs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,7 @@ Sub Main()
MessageDialog(m.port, "Prince of Persia", "Warning: Your Roku Stick device has limited memory," + chr(10) + "this game only works properly on the 4 rooms mode.")
end if
'Initialize Screen
if isHD()
print "HD Mode"
m.mainScreen = CreateObject("roScreen", true, 854, 480)
else
print "SD Mode"
m.mainScreen = CreateObject("roScreen", true, 640, 480)
end if
m.mainScreen.SetMessagePort(m.port)
ResetMainScreen()
'Load Mods
m.mods = LoadMods()
'Initialize Settings
Expand Down Expand Up @@ -167,12 +160,7 @@ Sub Main()
PlayGame()
end if
end if
if isHD()
m.mainScreen = CreateObject("roScreen", true, 854, 480)
else
m.mainScreen = CreateObject("roScreen", true, 640, 480)
end if
m.mainScreen.SetMessagePort(m.port)
ResetMainScreen()
end while
End Sub

Expand Down Expand Up @@ -310,8 +298,8 @@ Sub SetupGameScreen()
m.mainWidth = 854
m.mainHeight = 626
else
m.mainWidth = 640
m.mainHeight = 480
m.mainWidth = 720
m.mainHeight = 540
end if
end if
ResetScreen(m.mainWidth, m.mainHeight, m.gameWidth, m.gameHeight)
Expand Down
8 changes: 1 addition & 7 deletions source/gameMenu.brs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,7 @@ sub SettingsMenu()
end if
else if selected = 2
ModsAndCheatsScreen()
if isHD()
m.mainScreen = CreateObject("roScreen", true, 854, 480)
else
m.mainScreen = CreateObject("roScreen", true, 640, 480)
end if
m.mainScreen.SetMessagePort(m.port)
m.mainScreen.SetAlphaEnable(true)
ResetMainScreen()
else if selected = 3
HighscoresScreen()
else if selected = 4
Expand Down
10 changes: 7 additions & 3 deletions source/gameUtil.brs
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,19 @@ Function KeyboardScreen(title = "", prompt = "", text = "", button1 = "Okay", bu
end if
end while
screen.Close()
ResetMainScreen()
return result
End Function

Sub ResetMainScreen()
if isHD()
m.mainScreen = CreateObject("roScreen", true, 854, 480)
else
m.mainScreen = CreateObject("roScreen", true, 640, 480)
m.mainScreen = CreateObject("roScreen", true, 720, 540)
end if
m.mainScreen.SetMessagePort(m.port)
m.mainScreen.SetAlphaEnable(true)
return result
End function
End Sub

'------- Registry Functions -------
Function GetRegistryString(key as String, default = "") As String
Expand Down

0 comments on commit 7cce4f7

Please sign in to comment.