X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcontrol%2Fcontroller.cpp;h=11cfd6557ec0886c2030757be3ea4525987d2a90;hb=3b98af33dfb3ea9f683a89d35a02206d18cb0494;hp=db924af7dc5799dc47b7aba7aa3c0345d37b4bd5;hpb=1486ceaaf9dd7a9d2d7e3654550b9a2768df2a56;p=supertux.git diff --git a/src/control/controller.cpp b/src/control/controller.cpp index db924af7d..11cfd6557 100644 --- a/src/control/controller.cpp +++ b/src/control/controller.cpp @@ -1,7 +1,7 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2005 Matthias Braun +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,18 +12,15 @@ // 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 #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,13 +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] == true && controls[control] == false; + return oldControls[control] && !controls[control]; } void