* Comment out resizable flag because it blue-screens on Windows
[supertux.git] / src / control / controller.cpp
index 73f93af..11cfd65 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
-// 
+//
 //  SuperTux
-//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-//  02111-1307, USA.
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <config.h>
 
 #include "controller.hpp"
 
-extern Controller* main_controller;
-
 const char* Controller::controlNames[] = {
   "left",
   "right",
@@ -33,6 +30,11 @@ const char* Controller::controlNames[] = {
   "action",
   "pause-menu",
   "menu-select",
+  "console",
+  "peek-left",
+  "peek-right",
+  "peek-up",
+  "peek-down",
   0
 };
 
@@ -62,7 +64,13 @@ Controller::hold(Control control)
 bool
 Controller::pressed(Control control)
 {
-  return oldControls[control] == false && controls[control] == true;
+  return !oldControls[control] && controls[control];
+}
+
+bool
+Controller::released(Control control)
+{
+  return oldControls[control] && !controls[control];
 }
 
 void