Renamed WorldState to Savegame and implemented basic load/save for Worldmaps and...
[supertux.git] / src / supertux / sector.cpp
index 0add01f..333a737 100644 (file)
@@ -54,6 +54,7 @@
 #include "supertux/level.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/player_status.hpp"
+#include "supertux/savegame.hpp"
 #include "supertux/spawn_point.hpp"
 #include "supertux/tile.hpp"
 #include "trigger/sequence_trigger.hpp"
@@ -65,7 +66,7 @@ bool Sector::show_collrects = false;
 bool Sector::draw_solids_only = false;
 
 Sector::Sector(Level* parent) :
-  level(parent), 
+  level(parent),
   name(),
   bullets(),
   init_script(),
@@ -73,19 +74,19 @@ Sector::Sector(Level* parent) :
   currentmusic(LEVEL_MUSIC),
   sector_table(),
   scripts(),
-  ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), 
+  ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ),
   gameobjects(),
   moving_objects(),
   spawnpoints(),
   portables(),
   music(),
-  gravity(10.0), 
-  player(0), 
+  gravity(10.0),
+  player(0),
   solid_tilemaps(),
-  camera(0), 
+  camera(0),
   effect(0)
 {
-  add_object(new Player(GameSession::current()->get_player_status(), "Tux"));
+  add_object(new Player(GameSession::current()->get_savegame().get_player_status(), "Tux"));
   add_object(new DisplayEffect("Effect"));
   add_object(new TextObject("Text"));
 
@@ -229,7 +230,7 @@ Sector::parse(const Reader& sector)
 
   update_game_objects();
 
-  if(solid_tilemaps.size() < 1) log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl;
+  if(solid_tilemaps.size() < 1) { log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; }
 
   fix_old_tiles();
   if(!camera) {
@@ -394,7 +395,7 @@ Sector::parse_old_format(const Reader& reader)
 
   update_game_objects();
 
-  if(solid_tilemaps.size() < 1) log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl;
+  if(solid_tilemaps.size() < 1) { log_warning << "sector '" << name << "' does not contain a solid tile layer." << std::endl; }
 
   fix_old_tiles();
   update_game_objects();
@@ -607,7 +608,7 @@ Sector::activate(const Vector& player_pos)
   camera->update(1);
   player->move(player->get_pos()+(Vector(32, 0)));
   camera->update(1);
-  
+
   update_game_objects();
 
   //Run default.nut just before init script
@@ -1013,7 +1014,7 @@ Sector::collision_tilemap(collision::Constraints* constraints,
         if(tile->is_slope ()) { // slope tile
           AATriangle triangle;
           int slope_data = tile->getData();
-          if (solids->get_drawing_effect() == VERTICAL_FLIP)
+          if (solids->get_drawing_effect() & VERTICAL_FLIP)
             slope_data = AATriangle::vertical_flip(slope_data);
           triangle = AATriangle(tile_bbox, slope_data);