projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Comment out resizable flag because it blue-screens on Windows
[supertux.git]
/
src
/
control
/
controller.cpp
diff --git
a/src/control/controller.cpp
b/src/control/controller.cpp
index
73f93af
..
11cfd65
100644
(file)
--- a/
src/control/controller.cpp
+++ b/
src/control/controller.cpp
@@
-1,7
+1,7
@@
// $Id$
// $Id$
-//
+//
// SuperTux
// SuperTux
-// Copyright (C) 200
5
Matthias Braun <matze@braunis.de>
+// Copyright (C) 200
6
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
//
// 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.
// 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
// 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"
#include <config.h>
#include "controller.hpp"
-extern Controller* main_controller;
-
const char* Controller::controlNames[] = {
"left",
"right",
const char* Controller::controlNames[] = {
"left",
"right",
@@
-33,6
+30,11
@@
const char* Controller::controlNames[] = {
"action",
"pause-menu",
"menu-select",
"action",
"pause-menu",
"menu-select",
+ "console",
+ "peek-left",
+ "peek-right",
+ "peek-up",
+ "peek-down",
0
};
0
};
@@
-62,7
+64,13
@@
Controller::hold(Control control)
bool
Controller::pressed(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
}
void