| 1 |
/* |
| 2 |
* Copyright (C) 2004 Ivo Danihelka ([email protected]) |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
*/ |
| 9 |
#include "DemoInput.h" |
| 10 |
|
| 11 |
#include "Keymap.h" |
| 12 |
#include "KeyDesc.h" |
| 13 |
#include "GameState.h" |
| 14 |
|
| 15 |
//----------------------------------------------------------------- |
| 16 |
/** |
| 17 |
* Create demo input handler. |
| 18 |
* Escape, space or mouse click quit state. |
| 19 |
* @param demo pointer to the leader |
| 20 |
*/ |
| 21 |
DemoInput::DemoInput(GameState *demo) |
| 22 |
: GameInput(demo) |
| 23 |
{ |
| 24 |
KeyDesc key_quit(KEY_QUIT, "quit"); |
| 25 |
m_keymap->registerKey(KeyStroke(SDLK_SPACE, KMOD_NONE), key_quit); |
| 26 |
} |
| 27 |
//----------------------------------------------------------------- |
| 28 |
void |
| 29 |
DemoInput::mouseEvent(const MouseStroke &/*buttons*/) |
| 30 |
{ |
| 31 |
quitState(); |
| 32 |
} |
| 33 |
|