Fixed unfriendly soundtest.c controls.
[cantaveria.git] / input.h
blobf4944d79441ec1d95f0f4c3eb727e9f2df685662
1 /*
2 Cantaveria - action adventure platform game
3 Copyright (C) 2009 2010 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
22 evanrinehart@gmail.com
24 enum input_type {
25 BUTTON_PRESS,
26 BUTTON_RELEASE,
27 NO_INPUT,
28 SKIP_INPUT,
29 INVALID_INPUT,
30 END_OF_PROGRAM
33 enum input_button {
34 START_BUTTON,
35 SELECT_BUTTON,
36 L_BUTTON,
37 R_BUTTON,
39 LEFT_BUTTON,
40 RIGHT_BUTTON,
41 UP_BUTTON,
42 DOWN_BUTTON,
44 FIRE_BUTTON,
45 JUMP_BUTTON,
46 INVENTORY_BUTTON,
47 SPECIAL_BUTTON,
49 ESCAPE_KEY,
50 PAUSE_KEY,
52 INVALID_BUTTON,
53 NONDESCRIPT_BUTTON,
56 typedef struct {
57 enum input_type type;
58 enum input_button button;
59 int player;
60 } input;
63 void input_init(const char* filename);
64 void save_input(const char* filename);
66 input get_input();
67 void remap_last_input(enum input_button, int player);
68 void print_last_raw(char* buf, int size);
70 const char* input_str(input in);