Problem with graphics.c

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Tydude4Christ
Posts: 8
Joined: Thu Aug 24, 2006 12:30 pm
Location: St. Louis, MO, U.S.A.

Problem with graphics.c

Post by Tydude4Christ »

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: Select all

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?
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

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.
Tydude4Christ
Posts: 8
Joined: Thu Aug 24, 2006 12:30 pm
Location: St. Louis, MO, U.S.A.

Post by Tydude4Christ »

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.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

You've also forgotten the sceDisplayWaitVblankStart(); before the flipscreen.
If not actually, then potentially.
Tydude4Christ
Posts: 8
Joined: Thu Aug 24, 2006 12:30 pm
Location: St. Louis, MO, U.S.A.

Post by Tydude4Christ »

It appears sceDisplayWaitVblankStart() was my problem all along. It now works even when my background is not at (0,0). Thanks for the help.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

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

Thanks!
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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.
Post Reply