version 1.42 | | version 1.43 |
---|
| | |
//little hack to find the largest or equal multiple of 2 for a given number | | //little hack to find the largest or equal multiple of 2 for a given number |
int pow2ize(int x){ | | int pow2ize(int x){ |
int i; | | int i; |
for (i=2;i<=4096;i*=2) | | for (i=1;i<=4096;i*=2) |
if (x<=i) return i; | | if (x<=i) return i; |
return i; | | return i; |
} | | } |
| | |
printf("%s: %ux%ux%i p=%i(%i) c=%i a=%i chans=%i\n",filename, pdata.width, pdata.height, pdata.depth, pdata.paletted, pdata.num_palette, pdata.color, pdata.alpha, pdata.channels); | | printf("%s: %ux%ux%i p=%i(%i) c=%i a=%i chans=%i\n",filename, pdata.width, pdata.height, pdata.depth, pdata.paletted, pdata.num_palette, pdata.color, pdata.alpha, pdata.channels); |
if (pdata.depth==8 && pdata.color) { | | if (pdata.depth==8 && pdata.color) { |
if (bm->gltexture==NULL) | | if (bm->gltexture==NULL) |
ogl_init_texture(bm->gltexture=ogl_get_free_texture(), pdata.width, pdata.height, flags | ((pdata.alpha)?OGL_FLAG_ALPHA:0)); | | ogl_init_texture(bm->gltexture=ogl_get_free_texture(), pdata.width, pdata.height, flags | ((pdata.alpha||bm->bm_flags&BM_FLAG_TRANSPARENT)?OGL_FLAG_ALPHA:0)); |
ogl_loadtexture(pdata.data,0,0,bm->gltexture,bm->bm_flags,pdata.paletted?0:pdata.channels); | | ogl_loadtexture(pdata.data,0,0,bm->gltexture,bm->bm_flags,pdata.paletted?0:pdata.channels); |
free(pdata.data); | | free(pdata.data); |
if (pdata.palette) | | if (pdata.palette) |