| View previous topic :: View next topic |
| Author |
Message |
Tydude4Christ
Joined: 24 Aug 2006 Posts: 8 Location: St. Louis, MO, U.S.A.
|
Posted: Wed Jan 21, 2009 10:35 am Post subject: Problem with graphics.c |
|
|
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 |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Wed Jan 21, 2009 11:16 am Post subject: |
|
|
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 |
|
 |
Tydude4Christ
Joined: 24 Aug 2006 Posts: 8 Location: St. Louis, MO, U.S.A.
|
Posted: Wed Jan 21, 2009 11:37 am Post subject: |
|
|
| 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 |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Wed Jan 21, 2009 11:42 am Post subject: |
|
|
You've also forgotten the sceDisplayWaitVblankStart(); before the flipscreen. _________________ If not actually, then potentially. |
|
| Back to top |
|
 |
Tydude4Christ
Joined: 24 Aug 2006 Posts: 8 Location: St. Louis, MO, U.S.A.
|
Posted: Wed Jan 21, 2009 11:50 am Post subject: |
|
|
| 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 |
|
 |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
Posted: Wed Jan 21, 2009 6:28 pm Post subject: |
|
|
Sorry for the naive question, what library is that? can you give a link?
Thanks! |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Jan 21, 2009 6:58 pm Post subject: |
|
|
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 |
|
 |
|