gba-x3dtest

diff src/x3d.c @ 20:2e903e27e35a

fixed x3d_disable_texture added runtime teture checks in the rasterizer
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 01 Jul 2014 23:23:37 +0300
parents 62390f9cc93e
children
line diff
     1.1 --- a/src/x3d.c	Mon Jun 30 09:07:41 2014 +0300
     1.2 +++ b/src/x3d.c	Tue Jul 01 23:23:37 2014 +0300
     1.3 @@ -352,9 +352,7 @@
     1.4  
     1.5  	for(i=0; i<MAX_TEXTURES; i++) {
     1.6  		if(!textures[i].pixels) {
     1.7 -			/*textures[i].pixels = pixels;*/
     1.8 -			textures[i].pixels = malloc(xsz * ysz * 2);
     1.9 -			memcpy(textures[i].pixels, pixels, xsz * ysz * 2);
    1.10 +			textures[i].pixels = pixels;
    1.11  			textures[i].xsz = xsz;
    1.12  			textures[i].ysz = ysz;
    1.13  			textures[i].umask = xsz - 1;
    1.14 @@ -369,7 +367,7 @@
    1.15  				}
    1.16  			}
    1.17  
    1.18 -			logmsg(LOG_DBG, "create texture %dx%d: %p\n", xsz, ysz, pixels);
    1.19 +			logmsg(LOG_DBG, "create texture %dx%d: %p\n", xsz, ysz, textures[i].pixels);
    1.20  
    1.21  			return i;
    1.22  		}
    1.23 @@ -384,7 +382,7 @@
    1.24  
    1.25  void x3d_disable_texture(void)
    1.26  {
    1.27 -	cur_tex = 0;
    1.28 +	cur_tex = -1;
    1.29  }
    1.30  
    1.31  int x3d_get_active_texture(void)