X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcontrol%2Fcontroller.cpp;h=b936ee81f8586cc6664d9d8e275e44f954cf3188;hb=53209e9747f4c830eeeb926d3a44918ed86621ba;hp=43f76659127d0a3fdf03f9e2e1e26e10bf557c01;hpb=a5eb1a582bf8c975d12293d7e5199a365a7e191b;p=supertux.git diff --git a/src/control/controller.cpp b/src/control/controller.cpp index 43f766591..b936ee81f 100644 --- a/src/control/controller.cpp +++ b/src/control/controller.cpp @@ -1,12 +1,10 @@ -// $Id$ -// // SuperTux // 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 -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,14 +12,9 @@ // 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. - -#include +// along with this program. If not, see . -#include "controller.hpp" - -extern Controller* main_controller; +#include "control/controller.hpp" const char* Controller::controlNames[] = { "left", @@ -35,6 +28,8 @@ const char* Controller::controlNames[] = { "console", "peek-left", "peek-right", + "peek-up", + "peek-down", 0 }; @@ -64,13 +59,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 @@ -79,3 +74,5 @@ Controller::update() for(int i = 0; i < CONTROLCOUNT; ++i) oldControls[i] = controls[i]; } + +/* EOF */