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 

Problem with graphics.c

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



Joined: 24 Aug 2006
Posts: 8
Location: St. Louis, MO, U.S.A.

PostPosted: Wed Jan 21, 2009 10:35 am    Post subject: Problem with graphics.c Reply with quote

I'm currently using this lib to display a background and then my character sprite. When I move the character, which actually is moving my background pic, I see that the bottom half of my screen is getting "refreshed" faster than the top half of my screen.

Here's what I am doing.

Code:
clearScreen(black);
blitAlphaImageToScreen(0 ,0 ,480 ,272 , background, x, y);
blitAlphaImageToScreen(0 ,0 ,32 , 32, currentMainImage, mainCharXPos, mainCharYPos);
flipScreen();


Does anyone have any thoughts or suggestions?
Back to top
View user's profile Send private message Send e-mail
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Jan 21, 2009 11:16 am    Post subject: Reply with quote

Well there's going to be a problem when you draw the background image 480x272 at any coords other than 0,0
because you'll be trying to draw some of the background off the screen otherwise.

So look into a tile engine.
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
Tydude4Christ



Joined: 24 Aug 2006
Posts: 8
Location: St. Louis, MO, U.S.A.

PostPosted: Wed Jan 21, 2009 11:37 am    Post subject: Reply with quote

The background image is actually just temporary. Currently, I'm just testing my character's movement. Eventually, I'll create a tile engine. I was just wondering whether the scanning problem would occur then. Thanks for the reply.
Back to top
View user's profile Send private message Send e-mail
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Jan 21, 2009 11:42 am    Post subject: Reply with quote

You've also forgotten the sceDisplayWaitVblankStart(); before the flipscreen.
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
Tydude4Christ



Joined: 24 Aug 2006
Posts: 8
Location: St. Louis, MO, U.S.A.

PostPosted: Wed Jan 21, 2009 11:50 am    Post subject: Reply with quote

It appears sceDisplayWaitVblankStart() was my problem all along. It now works even when my background is not at (0,0). Thanks for the help.
Back to top
View user's profile Send private message Send e-mail
Heimdall



Joined: 10 Nov 2005
Posts: 259
Location: Netherlands

PostPosted: Wed Jan 21, 2009 6:28 pm    Post subject: Reply with quote

Sorry for the naive question, what library is that? can you give a link?

Thanks!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Wed Jan 21, 2009 6:58 pm    Post subject: Reply with quote

You of all people should know, its from lua player.

However it will be inefficient for games because it syncs the gu after each of those function calls. You can't queue up all your drawing into the dlist before execution.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP 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