Made changes to reflect change of way that alpha applied is handled.
authorRicardo Cruz <rick2@aeiou.pt>
Fri, 24 Sep 2004 18:01:42 +0000 (18:01 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Fri, 24 Sep 2004 18:01:42 +0000 (18:01 +0000)
SVN-Revision: 1967

src/gameobjs.cpp
src/statistics.cpp

index 1ace86c..5340bfb 100644 (file)
@@ -155,7 +155,12 @@ FloatingText::draw(DrawingContext& context)
   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 5c57313..0b9cc0a 100644 (file)
@@ -108,14 +108,6 @@ Statistics::draw_worldmap_info(DrawingContext& context)
       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 @@ Statistics::draw_worldmap_info(DrawingContext& context)
 
   // 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 @@ Statistics::draw_worldmap_info(DrawingContext& context)
   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 @@ Statistics::draw_worldmap_info(DrawingContext& context)
     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