You are not logged in.

#1 2009-11-29 20:39:03

agoaj
Member

[RESOLVED] Non power of 2 textures.

Is there a way to use non-power of 2 textures in grrlib? If not, then is there a way to detect if a texture was loaded correctly?

Offline

 

#2 2009-11-29 23:50:26

Crayon
Bad Mother Fucker

Re: [RESOLVED] Non power of 2 textures.

Texture needs to be a multiply of 4, not just power of 2. It is not GRRLIB fault if this limit exist, it's Wii related.

So if you need to check if it's going to work or not just a % 4 on the width and height. If the result is not equal to 0 for both of them, than it will fail.

Code:

        if((Pic->h % 4) || (Pic->w % 4))
        {
            // failed
        }

Offline

 

#3 2009-11-30 15:19:04

agoaj
Member

Re: [RESOLVED] Non power of 2 textures.

Couldn't grrlib resize the texture until it's a multiple of 4? Just adding blank spots on the bottom and right, while keeping the img width and height values of the original?

Offline

 

#4 2009-11-30 18:59:47

NoNameNo
Administrator

Re: [RESOLVED] Non power of 2 textures.

Sure we could code this, but GRRLIB is already "LAZY CODER" Friendly wink
and adding "transparent col/row" will introduce possible eroneous positioning (ie centering...)

in one word !! make your pic as you want, add transparency row/col with gimp if you want wink
or even better since GRRLIB is an open source project, just code what you need wink

NNN

Offline

 

Board footer

Powered by FluxBB