sceGuTexWrap Question!

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

Moderators: cheriff, TyRaNiD

Post Reply
roland
Posts: 13
Joined: Sat Feb 11, 2006 9:11 pm

sceGuTexWrap Question!

Post by roland »

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

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.
roland
Posts: 13
Joined: Sat Feb 11, 2006 9:11 pm

Wrong....

Post by roland »

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

SORRY!
User avatar
Shazz
Posts: 244
Joined: Tue Aug 31, 2004 11:42 pm
Location: Somewhere over the rainbow
Contact:

Post by Shazz »

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