Skip to content

Commit 329a02e

Browse files
committed
- Fixed #89 - On low end devices the introduction screen and menu are showing in the top left corner of the screen
1 parent 8820761 commit 329a02e

File tree

4 files changed

+27
-35
lines changed

4 files changed

+27
-35
lines changed

assets/fonts/prince_0.png

1.69 KB
Loading

manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ title=Prince of Persia
22
subtitle=Roku remake of the Classic 8 bit Game
33
major_version=0
44
minor_version=12
5-
build_version=3440
5+
build_version=3444
66
mm_icon_focus_hd=pkg:/images/icon_focus_hd.png
77
mm_icon_side_hd=pkg:/images/icon_focus_hd.png
88
mm_icon_focus_sd=pkg:/images/icon_side_hd.png

source/gameMain.brs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Sub Main()
3636
m.prandom = CreatePseudoRandom()
3737
m.manifest = GetManifestArray()
3838
m.status = []
39+
'Check Roku model for performance alert
40+
if not IsOpenGL()
41+
MessageDialog("Prince of Persia", "Warning: Your Roku device doesn't support accelerated graphics, this game will not perform well.")
42+
end if
3943
'Initialize Screen
4044
if isHD()
4145
m.mainScreen = CreateObject("roScreen", true, 854, 480)
@@ -44,6 +48,7 @@ Sub Main()
4448
end if
4549
m.mainScreen.SetMessagePort(m.port)
4650
'Load Mods
51+
Sleep(500)
4752
TextBox(m.mainScreen, 620, 50, "Loading...")
4853
m.mods = LoadMods()
4954
'Initialize Settings
@@ -75,10 +80,6 @@ Sub Main()
7580
m.savedGame = LoadSavedGame()
7681
m.highScores = LoadHighScores()
7782
if m.highScores = invalid then m.highScores = []
78-
'Check Roku model for performance alert
79-
if not IsOpenGL()
80-
MessageDialog("Prince of Persia", "Warning: Your Roku device doesn't support accelerated graphics, this game will not perform well.")
81-
end if
8283
'Play Game Introduction and Disclaimer
8384
if m.intro
8485
print "Starting intro..."

source/gameStatus.brs

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -146,58 +146,49 @@ Function LoadBitmapFont(scale = 1.0 as float) As Dynamic
146146
return this
147147
End Function
148148

149-
Function write_text(screen as object, text as string, x as integer, y as integer) as object
149+
Function write_text(screen as object, text as string, x as integer, y as integer, redraw = false as boolean) as object
150150
xOff = 2 * m.scale
151151
yOff = 8 * m.scale
152152
for c = 0 to len(text) - 1
153153
ci = asc(text.mid(c,1))
154154
'Convert accented characters not supported by the font
155-
if ci > 191 and ci < 199
155+
if (ci > 191 and ci < 199) or (ci > 223 and ci < 231) 'A
156156
ci = 65
157-
else if ci = 199
157+
else if ci = 199 or ci = 231 'C
158158
ci = 67
159-
else if ci > 199 and ci < 204
159+
else if (ci > 199 and ci < 204) or (ci > 231 and ci < 236) 'E
160160
ci = 69
161-
else if ci > 203 and ci < 208
161+
else if (ci > 203 and ci < 208) or (ci > 235 and ci < 240) 'I
162162
ci = 73
163-
else if ci = 208
163+
else if ci = 208 'D
164164
ci = 68
165-
else if ci = 209
165+
else if ci = 209 or ci = 241 'N
166166
ci = 78
167-
else if ci > 209 and ci < 215
167+
else if (ci > 209 and ci < 215) or (ci > 241 and ci < 247)'O
168168
ci = 79
169-
else if ci = 215
170-
ci = 120
171-
else if ci = 216
169+
else if ci = 215 'X
170+
ci = 88
171+
else if ci = 216 '0
172172
ci = 48
173-
else if ci > 216 and ci < 221
173+
else if (ci > 216 and ci < 221) or (ci > 248 and ci < 253) 'U
174174
ci = 85
175-
else if ci = 221
175+
else if ci = 221 'Y
176176
ci = 89
177-
else if ci > 223 and ci < 231
178-
ci = 97
179-
else if ci = 231
180-
ci = 99
181-
else if ci > 231 and ci < 236
182-
ci = 101
183-
else if ci > 235 and ci < 240
184-
ci = 105
185-
else if ci = 240
186-
ci = 100
187-
else if ci = 241
188-
ci = 110
189-
else if ci > 241 and ci < 247
190-
ci = 111
191-
else if ci > 248 and ci < 253
192-
ci = 117
193177
else if ci > 160
194178
ci = 32
195179
end if
196180
'write the letter
197181
letter = m.chars.Lookup("chr" + itostr(ci))
198182
if letter <> invalid
199183
yl = y + (yOff - letter.image.GetHeight())
200-
screen.drawobject(x, yl + letter.yOffset, letter.image)
184+
if not redraw
185+
screen.drawobject(x, yl + letter.yOffset, letter.image)
186+
else
187+
bmp = CreateObject("roBitmap", {width:letter.GetWidth(), height:letter.GetHeight(), alphaenable:true})
188+
bmp.Clear(m.colors.black)
189+
bmp.DrawObject(0, 0, letter)
190+
screen.DrawObject(x, yl + letter.yOffset, bmp)
191+
end if
201192
x += (letter.image.GetWidth() + xOff)
202193
end if
203194
next

0 commit comments

Comments
 (0)