I wrote two functions for writing texts in the game, using a font bmp, drawChar() and drawString() (font.c).
One write the single character and changing the color if necessary, the other write an entire string, passing every single character to the previous one.
Writing a text in different color, or try to apply a transparency around the characters of a string in general, sometimes the effect is applied only to the first char in most cases, or on a random char, as in the image.
I still do not understand where the problem is, all starts passing the values of "alpha" and "color", other than between the various function calls drawstring you generate errors.
Does anyone have an idea about what might be due?
You can find the current sources to the SVN respository: svn checkout svn://svn.code.sf.net/p/retrogear/code/rpg_game rpg_game
Actually I fix it by forcing alpha flag to 0 in drawString() function, try to comment and see.
- {l Code}: {l Select All Code}
// alpha=0; //Stupid bugfix for now...
drawChar(screen, bmpfont, area.x, area.y, area.w, area.h, asciicode, color, alpha);
area.x+=FONT_W;
}