Skip to content

Commit

Permalink
- Fixed #89 - On low end devices the introduction screen and menu are…
Browse files Browse the repository at this point in the history
… showing in the top left corner of the screen
  • Loading branch information
lvcabral committed Nov 26, 2016
1 parent 8820761 commit 329a02e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 35 deletions.
Binary file modified assets/fonts/prince_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title=Prince of Persia
subtitle=Roku remake of the Classic 8 bit Game
major_version=0
minor_version=12
build_version=3440
build_version=3444
mm_icon_focus_hd=pkg:/images/icon_focus_hd.png
mm_icon_side_hd=pkg:/images/icon_focus_hd.png
mm_icon_focus_sd=pkg:/images/icon_side_hd.png
Expand Down
9 changes: 5 additions & 4 deletions source/gameMain.brs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Sub Main()
m.prandom = CreatePseudoRandom()
m.manifest = GetManifestArray()
m.status = []
'Check Roku model for performance alert
if not IsOpenGL()
MessageDialog("Prince of Persia", "Warning: Your Roku device doesn't support accelerated graphics, this game will not perform well.")
end if
'Initialize Screen
if isHD()
m.mainScreen = CreateObject("roScreen", true, 854, 480)
Expand All @@ -44,6 +48,7 @@ Sub Main()
end if
m.mainScreen.SetMessagePort(m.port)
'Load Mods
Sleep(500)
TextBox(m.mainScreen, 620, 50, "Loading...")
m.mods = LoadMods()
'Initialize Settings
Expand Down Expand Up @@ -75,10 +80,6 @@ Sub Main()
m.savedGame = LoadSavedGame()
m.highScores = LoadHighScores()
if m.highScores = invalid then m.highScores = []
'Check Roku model for performance alert
if not IsOpenGL()
MessageDialog("Prince of Persia", "Warning: Your Roku device doesn't support accelerated graphics, this game will not perform well.")
end if
'Play Game Introduction and Disclaimer
if m.intro
print "Starting intro..."
Expand Down
51 changes: 21 additions & 30 deletions source/gameStatus.brs
Original file line number Diff line number Diff line change
Expand Up @@ -146,58 +146,49 @@ Function LoadBitmapFont(scale = 1.0 as float) As Dynamic
return this
End Function

Function write_text(screen as object, text as string, x as integer, y as integer) as object
Function write_text(screen as object, text as string, x as integer, y as integer, redraw = false as boolean) as object
xOff = 2 * m.scale
yOff = 8 * m.scale
for c = 0 to len(text) - 1
ci = asc(text.mid(c,1))
'Convert accented characters not supported by the font
if ci > 191 and ci < 199
if (ci > 191 and ci < 199) or (ci > 223 and ci < 231) 'A
ci = 65
else if ci = 199
else if ci = 199 or ci = 231 'C
ci = 67
else if ci > 199 and ci < 204
else if (ci > 199 and ci < 204) or (ci > 231 and ci < 236) 'E
ci = 69
else if ci > 203 and ci < 208
else if (ci > 203 and ci < 208) or (ci > 235 and ci < 240) 'I
ci = 73
else if ci = 208
else if ci = 208 'D
ci = 68
else if ci = 209
else if ci = 209 or ci = 241 'N
ci = 78
else if ci > 209 and ci < 215
else if (ci > 209 and ci < 215) or (ci > 241 and ci < 247)'O
ci = 79
else if ci = 215
ci = 120
else if ci = 216
else if ci = 215 'X
ci = 88
else if ci = 216 '0
ci = 48
else if ci > 216 and ci < 221
else if (ci > 216 and ci < 221) or (ci > 248 and ci < 253) 'U
ci = 85
else if ci = 221
else if ci = 221 'Y
ci = 89
else if ci > 223 and ci < 231
ci = 97
else if ci = 231
ci = 99
else if ci > 231 and ci < 236
ci = 101
else if ci > 235 and ci < 240
ci = 105
else if ci = 240
ci = 100
else if ci = 241
ci = 110
else if ci > 241 and ci < 247
ci = 111
else if ci > 248 and ci < 253
ci = 117
else if ci > 160
ci = 32
end if
'write the letter
letter = m.chars.Lookup("chr" + itostr(ci))
if letter <> invalid
yl = y + (yOff - letter.image.GetHeight())
screen.drawobject(x, yl + letter.yOffset, letter.image)
if not redraw
screen.drawobject(x, yl + letter.yOffset, letter.image)
else
bmp = CreateObject("roBitmap", {width:letter.GetWidth(), height:letter.GetHeight(), alphaenable:true})
bmp.Clear(m.colors.black)
bmp.DrawObject(0, 0, letter)
screen.DrawObject(x, yl + letter.yOffset, bmp)
end if
x += (letter.image.GetWidth() + xOff)
end if
next
Expand Down

0 comments on commit 329a02e

Please sign in to comment.