very weird blitting problem

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

Moderators: Shine, Insert_witty_name

Post Reply
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

very weird blitting problem

Post by the underminer »

There is this problem I can't solve and I started to think that lua just skipped a line. For testing, I tried to overwrite the image 'field' with itself. To do this, I first copied field to tempfield, then cleared field and blitted the copy to field again. The function TempRender shows me the contents of field. The first time TempRender is called, the field looks good and filled with color. The second time, only BufferX is visible. Frustrating! Can someone tell me why BufferX is [i/] and field isn't blitted or visible?

Code: Select all

tempfield = field
TempRender()
field:clear()
field:blit(0,0,tempfield,0,0,480,256) -- this line has no effect at all
CameraPos[1] = CameraPos[1] - 1
FillBufferXLeft()
field:blit(0,0,BufferX,0,0,32,256)
TempRender()

Code: Select all

function TempRender()
screen:clear()
screen:fillRect(0, 0, 480, 272, skyblue)
screen:blit(0,0,field,0,0,480,256)
screen.flip()
System.sleep(1250)
end
[/i]
Behold! The Underminer got hold of a PSP
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

Code: Select all

field:blit(0,0,field,0,0,448,256)
does work, but field:blit(32,0,field,0,0,448,256) doesn't. I guess the first parameter can't be positive? The field is 480x256 so there shouldn't be a problem(32+448=480).
This is very weird indeed.[/code]
Behold! The Underminer got hold of a PSP
Post Reply