What´s wrong with the images?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
ivanguerr
Posts: 5
Joined: Fri Dec 16, 2005 4:45 am

What´s wrong with the images?

Post by ivanguerr »

while true do
screen.waitVblankStart()
--Si pulsamos el boton X se acaba
pad=Controls.read()
if pad:start() then
break
end
if pad:triangle() then
screen:clear()
screen:blit(0, 0,Image.load("imagen/juego01.jpg"))
screen.flip()
end
if pad:l() then
screen:clear()
screen:blit(0, 0,Image.load("imagen/juego02.jpg"))
screen.flip()
end
if pad:r() then
screen:clear()
screen:blit(0, 0,Image.load("imagen/juego03.jpg"))
screen.flip()
end
if pad:circle() then
screen:clear()
screen:blit(0, 0,Image.load("imagen/juego04.jpg"))
screen.flip()
end
end

The program only changes the image when a button is pressed. Why the lua player crashes with "too many open files" error? Need I close the image loaded?
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

Load them outside of the do loop.
Geo Massar
Retired Engineer
Post Reply