changeset 250:d4f711fde94b

optimized alpha resampling
author arpi_esp
date Thu, 29 Mar 2001 16:39:37 +0000
parents 2dadc379a934
children ea2dcb082185
files libvo/font_load.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/font_load.c	Thu Mar 29 16:06:36 2001 +0000
+++ b/libvo/font_load.c	Thu Mar 29 16:39:37 2001 +0000
@@ -210,21 +210,22 @@
             int x=desc->pic_a[i]->bmp[j];
             int y=desc->pic_b[i]->bmp[j];
 
-	    x=((x*f)>>8); // scale
-	    if(x<0) x=0; else if(x>255) x=255;
-	    x^=255; // invert
-	    
+	    x=255-((x*f)>>8); // scale
+	    //if(x<0) x=0; else if(x>255) x=255;
+	    //x^=255; // invert
+
 	    if(x+y>255) x=255-y; // to avoid overflows
 	    
 	    //x=0;            
             //x=((x*f*(255-y))>>16);
             //x=((x*f*(255-y))>>16)+y;
             //x=(x*f)>>8;if(x<y) x=y;
-            
+
             if(x<1) x=1; else
             if(x>=252) x=0;
-	    
+
             desc->pic_a[i]->bmp[j]=x;
+//            desc->pic_b[i]->bmp[j]=0; // hack
         }
         printf("DONE!\n");
     }