- Use obstacks for memory allocation for lispfiles and DrawingRequests,
[supertux.git] / src / worldmap / worldmap.cpp
index da69275..65cb1f0 100644 (file)
@@ -247,7 +247,7 @@ WorldMap::load(const std::string& filename)
 
   try {
     lisp::Parser parser;
-    std::auto_ptr<lisp::Lisp> root (parser.parse(map_filename));
+    const lisp::Lisp* root = parser.parse(map_filename);
 
     const lisp::Lisp* lisp = root->get_lisp("supertux-level");
     if(!lisp)
@@ -323,7 +323,7 @@ WorldMap::get_level_title(LevelTile& level)
 
   try {
     lisp::Parser parser;
-    std::auto_ptr<lisp::Lisp> root (parser.parse(levels_path + level.get_name()));
+    const lisp::Lisp* root = parser.parse(levels_path + level.get_name());
 
     const lisp::Lisp* level_lisp = root->get_lisp("supertux-level");
     if(!level_lisp)
@@ -532,7 +532,7 @@ WorldMap::update(float delta)
       camera_offset.x = (int)solids->get_width()*32 - SCREEN_WIDTH;
     if (camera_offset.y > (int)solids->get_height()*32 - SCREEN_HEIGHT)
       camera_offset.y = (int)solids->get_height()*32 - SCREEN_HEIGHT;
-    
+
     if (int(solids->get_width()*32) < SCREEN_WIDTH)
       camera_offset.x = solids->get_width()*16.0 - SCREEN_WIDTH/2.0;
     if (int(solids->get_height()*32) < SCREEN_HEIGHT)
@@ -703,9 +703,9 @@ WorldMap::draw_status(DrawingContext& context)
           get_level_title(*level);
 
         context.draw_text(white_text, level->title,
-            Vector(SCREEN_WIDTH/2,
-              SCREEN_HEIGHT - white_text->get_height() - 30),
-            CENTER_ALLIGN, LAYER_FOREGROUND1);
+                          Vector(SCREEN_WIDTH/2,
+                                 SCREEN_HEIGHT - white_text->get_height() - 30),
+                          ALIGN_CENTER, LAYER_FOREGROUND1);
 
         // if level is solved, draw level picture behind stats
         /*
@@ -735,7 +735,7 @@ WorldMap::draw_status(DrawingContext& context)
           context.draw_text(gold_text, special_tile->map_message,
               Vector(SCREEN_WIDTH/2,
                 SCREEN_HEIGHT - white_text->get_height() - 60),
-              CENTER_ALLIGN, LAYER_FOREGROUND1);
+              ALIGN_CENTER, LAYER_FOREGROUND1);
         break;
       }
     }
@@ -744,7 +744,7 @@ WorldMap::draw_status(DrawingContext& context)
     Teleporter* teleporter = at_teleporter(tux->get_tile_pos());
     if (teleporter && (teleporter->message != "")) {
       Vector pos = Vector(SCREEN_WIDTH/2, SCREEN_HEIGHT - white_text->get_height() - 30);
-      context.draw_text(white_text, teleporter->message, pos, CENTER_ALLIGN, LAYER_FOREGROUND1);
+      context.draw_text(white_text, teleporter->message, pos, ALIGN_CENTER, LAYER_FOREGROUND1);
     }
 
   }
@@ -753,7 +753,7 @@ WorldMap::draw_status(DrawingContext& context)
   if(passive_message_timer.started())
     context.draw_text(gold_text, passive_message,
             Vector(SCREEN_WIDTH/2, SCREEN_HEIGHT - white_text->get_height() - 60),
-            CENTER_ALLIGN, LAYER_FOREGROUND1);
+            ALIGN_CENTER, LAYER_FOREGROUND1);
 
   context.pop_transform();
 }
@@ -965,12 +965,12 @@ WorldMap::save_state()
 
     // push world into worlds table
     sq_createslot(vm, -3);
-  } catch(std::exception& e) {
+  } catch(std::exception& ) {
     sq_settop(vm, oldtop);
   }
 
   sq_settop(vm, oldtop);
-  
+
   if(World::current() != NULL)
     World::current()->save_state();
 }