cleaned up font drawing code and added support for latin1 font of litespeed
[supertux.git] / src / worldmap.cpp
index 3f529e0..2988acf 100644 (file)
@@ -31,6 +31,7 @@
 #include "setup.h"
 #include "sector.h"
 #include "worldmap.h"
+#include "sound_manager.h"
 #include "resources.h"
 
 namespace WorldMapNS {
@@ -690,8 +691,8 @@ WorldMap::update(float delta)
                     if (!level->extro_filename.empty())
                       { 
                         MusicRef theme =
-                          music_manager->load_music(datadir + "/music/theme.mod");
-                        music_manager->play_music(theme);
+                          sound_manager->load_music(datadir + "/music/theme.mod");
+                        sound_manager->play_music(theme);
                         // Display final credits and go back to the main menu
                         display_text_file(level->extro_filename,
                                           "/images/background/extro.jpg", SCROLL_SPEED_MESSAGE);
@@ -745,7 +746,7 @@ WorldMap::update(float delta)
                   break;
                 }
 
-              music_manager->play_music(song);
+              sound_manager->play_music(song);
               Menu::set_current(0);
               if (!savegame_file.empty())
                 savegame(savegame_file);
@@ -863,8 +864,8 @@ WorldMap::draw_status(DrawingContext& context)
       context.draw_text(gold_text, str, 
           Vector(screen->w - gold_text->get_text_width(str) - tux_life->w, 0),
           LAYER_FOREGROUND1);
-      context.draw_surface(tux_life, Vector(screen->w - gold_text->w, 0),
-          LAYER_FOREGROUND1);
+      context.draw_surface(tux_life, Vector(screen->w -
+            gold_text->get_text_width("9"), 0), LAYER_FOREGROUND1);
     }
   else
     {
@@ -901,8 +902,8 @@ WorldMap::display()
 
   quit = false;
 
-  song = music_manager->load_music(datadir +  "/music/" + music);
-  music_manager->play_music(song);
+  song = sound_manager->load_music(datadir +  "/music/" + music);
+  sound_manager->play_music(song);
 
   unsigned int last_update_time;
   unsigned int update_time;