put both Ryan's and my flapping code into player.cpp with mine currently activated.
[supertux.git] / src / tile.cpp
index 964686b..2bd161d 100644 (file)
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //  02111-1307, USA.
 
+#include <cmath>
 #include <cassert>
 #include <iostream>
 
-#include "globals.h"
+#include "app/globals.h"
 #include "tile.h"
 #include "scene.h"
-#include "lispreader.h"
-#include "vector.h"
-#include "screen/drawing_context.h"
+#include "utils/lispreader.h"
+#include "math/vector.h"
+#include "video/drawing_context.h"
 
 /** Dirty little helper to create a surface from a snipped of lisp:
  *
@@ -39,7 +40,7 @@ Surface* create_surface(lisp_object_t* cur)
   if (lisp_string_p(cur))
     {
       return new Surface(datadir + "/images/tilesets/" + lisp_string(cur),
-                         USE_ALPHA);
+                         true);
     }
   else if (lisp_cons_p(cur) && lisp_symbol_p(lisp_car(cur)))
     {
@@ -55,7 +56,7 @@ Surface* create_surface(lisp_object_t* cur)
                                  lisp_integer(lisp_list_nth(data, 2)),
                                  lisp_integer(lisp_list_nth(data, 3)),
                                  lisp_integer(lisp_list_nth(data, 4)),
-                                 USE_ALPHA);
+                                 true);
             }
           else
             {
@@ -147,6 +148,14 @@ Tile::read(LispReader& reader)
   reader.read_int("anim-speed", anim_speed);
   reader.read_int("next-tile", next_tile);
 
+  slope_angle = 0;
+  reader.read_float("slope-angle", slope_angle);
+  if(slope_angle != 0)
+    {   // convert angle to radians from degrees:
+    slope_angle = (slope_angle * M_PI) / 180;
+    attributes |= SOLID;
+    }
+
   // FIXME: make images and editor_images a sprite
   images        = create_surfaces(reader.read_lisp("images"));
   editor_images = create_surfaces(reader.read_lisp("editor-images"));