forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Screen image copy question

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
fullerlee



Joined: 03 Nov 2005
Posts: 54

PostPosted: Fri Feb 17, 2006 5:20 am    Post subject: Screen image copy question Reply with quote

I'd like to cache the screen image so I don't have to generate it for each iteration.
All of my current screen drawing logic eventually draws to the screen image, and I'd rather not have to rewrite it.

I've tried doing this:

Code:
scrCopy = Image.createEmpty(screen:width(), screen:height())
scrCopy:blit(0, 0, screen)


Luaplayer doesn't like the 2nd line - bad argument #2 to `blit' (Image expected, got table).

I take it the error is because screen is a 'special' type of image (according to the docs). Does anyone know if screen has an attribute on it which is a conventional image?

Thanks,

Lee
Back to top
View user's profile Send private message
JorDy



Joined: 11 Dec 2005
Posts: 121

PostPosted: Fri Feb 17, 2006 5:22 am    Post subject: Reply with quote

why dont use use a function to create your image that way youd just have to keep callign it
Back to top
View user's profile Send private message
mallchin



Joined: 16 Feb 2006
Posts: 36

PostPosted: Fri Feb 17, 2006 5:54 am    Post subject: Reply with quote

Could you blit to an image rather then the screen, then copy the image?
Back to top
View user's profile Send private message
fullerlee



Joined: 03 Nov 2005
Posts: 54

PostPosted: Fri Feb 17, 2006 7:20 am    Post subject: Reply with quote

Yeah, I could do all my blitting to an image, but I was hoping I wouldn't have to change all the stuff I've already written (a lot).

Looking at the error, it seems that screen is a table, probably with an image as an attribute.

Oh hang on, I'll try a table.foreach(screen, print) to see if I can determine the attribute.
...
The out put of table.foreach doesn't really help:

Code:

clear   function: 0x1007a800
waitVblankStart function: 0x1007a7d0
drawLine        function: 0x1007a8e8
flip    function: 0x1007a760
save    function: 0x1007a890
print   function: 0x1007a848
width   function: 0x1007a860
blit    function: 0x1007a7e8
createEmpty     function: 0x1007a778
fillRect        function: 0x1007a818
height  function: 0x1007a878
load    function: 0x1007a790
pixel   function: 0x1007a830
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Fri Feb 17, 2006 1:36 pm    Post subject: Reply with quote

What about saving the screen and then loading it back to an image? Too slow?
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Fri Feb 17, 2006 1:57 pm    Post subject: Reply with quote

there is a nice feature in note pad,
i think microsoft calls it REPLACE...
so why not replace screen by buffer?
greets
lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
youresam



Joined: 06 Nov 2005
Posts: 87

PostPosted: Sat Feb 18, 2006 6:34 am    Post subject: Reply with quote

The screen is a special image, it is...the screen. I wish I could call it as an image, but you cant.

Now, from what I remember from a while ago, when I did a foreach on screen, it came up with 'flip' and 'waitVblankStart', which were the screen. functions.

When I tried foreach(Image,print), I remember getting what you got for 'screen'.


Just so you know, there is no way (besides screenshot) to call the screen image. Check the source code.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group