Nehe Leason 43 BugFix

The basic problem is that the code, as written on the old tutorial, is making the edge pixels tend towards black insomuch as they are supposed to be alpha-blended. This is a problem - among other things it means that light text will seem to have a dark outline around it. An easy fix is to just make the color channel pure white.  Thank's to Thorsten Jordan for this bug report.

Anyways here's a patched version of the msvc6 code.

And here are the particular lines that are broken (for those you working with a ported version of the code):

Take out this loop,

    for(int j=0; j <height;j++) {
        for(int i=0; i < width; i++) {
            expanded_data[2*(i+j*width)]= expanded_data[2*(i+j*width)+1] =  
                (i>=bitmap.width || j>=bitmap.rows) ?
                0 : bitmap.buffer[i + bitmap.width*j];
        }
    }


And replace it with:

    for(int j=0; j <height;j++) for(int i=0; i < width; i++) {
        expanded_data[2*(i+j*width)] = 255;
        expanded_data[2*(i+j*width)+1] =
                (i>=bitmap.width || j>=bitmap.rows) ?  

                0 : bitmap.buffer[i + bitmap.width*j];
    }