[Super-tux-commit] supertux/src statistics.cpp,1.11,1.12 gameobjs.cpp,1.53,1.54
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-09-24 18:01:56
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32247/src Modified Files: statistics.cpp gameobjs.cpp Log Message: Made changes to reflect change of way that alpha applied is handled. Index: gameobjs.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- gameobjs.cpp 23 Sep 2004 17:47:49 -0000 1.53 +++ gameobjs.cpp 24 Sep 2004 18:01:42 -0000 1.54 @@ -155,7 +155,12 @@ else alpha = 255; - context.draw_text(gold_text, text, position, LEFT_ALLIGN, LAYER_OBJECTS, NONE_EFFECT, alpha); + context.push_transform(); + context.set_alpha(alpha); + + context.draw_text(gold_text, text, position, LEFT_ALLIGN, LAYER_OBJECTS+1); + + context.pop_transform(); } /* Trampoline */ Index: statistics.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/statistics.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- statistics.cpp 20 Sep 2004 19:04:02 -0000 1.11 +++ statistics.cpp 24 Sep 2004 18:01:42 -0000 1.12 @@ -108,14 +108,6 @@ display_stat = 1; } - int alpha; - if(timer.get_gone() < FADING_TIME) - alpha = timer.get_gone() * 255 / FADING_TIME; - else if(timer.get_left() < FADING_TIME) - alpha = timer.get_left() * 255 / FADING_TIME; - else - alpha = 255; - char str[128]; context.draw_text(white_small_text, _("- Best Level Statistics -"), @@ -130,6 +122,17 @@ // draw other small info + int alpha; + if(timer.get_gone() < FADING_TIME) + alpha = timer.get_gone() * 255 / FADING_TIME; + else if(timer.get_left() < FADING_TIME) + alpha = timer.get_left() * 255 / FADING_TIME; + else + alpha = 255; + + context.push_transform(); + context.set_alpha(alpha); + if(display_stat == COINS_COLLECTED_STAT) sprintf(str, _("Max coins collected:")); else if(display_stat == BADGUYS_KILLED_STAT) @@ -137,7 +140,7 @@ else// if(display_stat == TIME_NEEDED_STAT) sprintf(str, _("Min time needed:")); - context.draw_text(white_small_text, str, Vector(WMAP_INFO_LEFT_X, 508), LEFT_ALLIGN, LAYER_GUI, NONE_EFFECT, alpha); + context.draw_text(white_small_text, str, Vector(WMAP_INFO_LEFT_X, 508), LEFT_ALLIGN, LAYER_GUI); if(display_stat == COINS_COLLECTED_STAT) sprintf(str, "%d/%d", stats[COINS_COLLECTED_STAT][SPLAYER], @@ -149,7 +152,9 @@ sprintf(str, "%d/%d", stats[TIME_NEEDED_STAT][SPLAYER], stats[TIME_NEEDED_STAT][STOTAL]); - context.draw_text(white_small_text, str, Vector(WMAP_INFO_RIGHT_X, 508), RIGHT_ALLIGN, LAYER_GUI, NONE_EFFECT, alpha); + context.draw_text(white_small_text, str, Vector(WMAP_INFO_RIGHT_X, 508), RIGHT_ALLIGN, LAYER_GUI); + + context.pop_transform(); } void |