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 

sceGuTexWrap Question!

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



Joined: 11 Feb 2006
Posts: 13

PostPosted: Mon Apr 03, 2006 5:00 am    Post subject: sceGuTexWrap Question! Reply with quote

Hello!!

It seems like a trivial question but it's been bugging me for a while now..

I have a texture that is 256x64 (CLUT8) and I would like to have it on a
2D Face (Sprite) that is from 0,0 to 256,272.. It should be repeated instead of strechted..

I am using:

Code:

struct Vertex* logo_bg = (struct Vertex*)sceGuGetMemory(2* sizeof(struct Vertex));

sceGuEnable(GU_TEXTURE_2D);
sceGuDisable(GU_BLEND);
sceGuClutMode(GU_PSM_8888,0,0xff,0); // 32-bit palette
sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
sceGuTexMode(GU_PSM_T8,0,0,GU_FALSE);    
sceGuTexWrap(GU_REPEAT, GU_REPEAT);
sceGuClutLoad((256/8),bg_pal);    
sceGuTexImage(0,256,64,256,bg_texture);   

logo_bg[0].u = 0;
logo_bg[0].v = 0;
logo_bg[1].u = 256;
logo_bg[1].v = 64;

logo_bg[0].x = 300;   
logo_bg[0].y = 0;    
logo_bg[1].x = logo_bg[0].x+256;   
logo_bg[1].y = logo_bg[0].y+196;

sceGuDrawArray GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,logo_bg);


I thought the GU_REPEAT does exactly that however I seem to be making some mistake as the Face always gets strechted...

Any thoughts?

r.
Back to top
View user's profile Send private message
roland



Joined: 11 Feb 2006
Posts: 13

PostPosted: Mon Apr 03, 2006 8:00 am    Post subject: Wrong.... Reply with quote

Could somebody please move this.. I accidentially put it in the wrong area :(

SORRY!
Back to top
View user's profile Send private message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Mon Apr 03, 2006 11:39 pm    Post subject: Reply with quote

Try v=196.... I think the U,V coords are wrapped based on the texture W,H values using a simple mod. And not based on the sprite coords.

But I may be wrong ;-)
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
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