dostunnel

changeset 5:0f984156753e tip

fixed the jerkiness
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 16 Mar 2013 07:10:53 +0200
parents ba868d348de8
children
files src/tunnel.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/src/tunnel.c	Sat Mar 16 06:39:52 2013 +0200
     1.2 +++ b/src/tunnel.c	Sat Mar 16 07:10:53 2013 +0200
     1.3 @@ -89,7 +89,7 @@
     1.4  	}
     1.5  	colrange = palm_color_range();
     1.6  
     1.7 -	init_timer(120);
     1.8 +	init_timer(under_windows ? 0 : 120);
     1.9  	start_time = get_msec();
    1.10  
    1.11  	return 0;
    1.12 @@ -113,8 +113,7 @@
    1.13  	unsigned long msec = get_msec() - start_time;
    1.14  
    1.15  	unsigned int i;
    1.16 -	unsigned char voffs = msec >> 3;
    1.17 -	unsigned char uoffs = msec >> 6;
    1.18 +	unsigned char offs = msec >> 3;
    1.19  
    1.20  	unsigned char *fbptr = fbuf;
    1.21  	unsigned long *uptr = umap;
    1.22 @@ -123,8 +122,8 @@
    1.23  	for(i=0; i<64000; i++) {
    1.24  		unsigned long u = *uptr++;
    1.25  		unsigned long v = *vptr++;
    1.26 -		unsigned long tx = ((((unsigned long)(u - uoffs) << 3) & 0xff) * tex->width) >> 8;
    1.27 -		unsigned long ty = (((unsigned long)(v + voffs) & 0xff) * tex->height) >> 8;
    1.28 +		unsigned long tx = ((((unsigned long)((u << 3) - offs)) & 0xff) * tex->width) >> 8;
    1.29 +		unsigned long ty = (((unsigned long)(v + offs) & 0xff) * tex->height) >> 8;
    1.30  
    1.31  		unsigned long base = tex->pixels[ty * tex->width + tx];
    1.32  		long zcue_shift = colrange - (v >> 6);