44 lines
718 B
C
44 lines
718 B
C
#pragma once
|
|
#include "conf.h"
|
|
|
|
enum Key {
|
|
K_LEFT,
|
|
K_RIGHT,
|
|
K_UP,
|
|
K_DOWN,
|
|
K_JUMP,
|
|
K_POLARITY,
|
|
K_EXIT,
|
|
K_SKIP,
|
|
K_EDITOR,
|
|
K_SCROLL_UP,
|
|
K_SCROLL_DOWN,
|
|
K_DEBUG,
|
|
K_SAVE_REPLAY,
|
|
K_PLAYBACK,
|
|
K_COUNT
|
|
};
|
|
enum KeyState { KS_UP, KS_DOWN, KS_PRESS };
|
|
|
|
typedef short PackedFrame;
|
|
|
|
struct Input {
|
|
enum Key keys[K_COUNT];
|
|
enum KeyState states[K_COUNT];
|
|
int replay_cursor, replay_end, playback;
|
|
PackedFrame replay[REPLAY_SIZE];
|
|
};
|
|
|
|
void input_init(void);
|
|
void input_update(void);
|
|
void input_dump_replay(void);
|
|
void input_load_replay(void);
|
|
|
|
void input_set_down(enum Key);
|
|
void input_set_pressed(enum Key);
|
|
void input_set_up(enum Key);
|
|
|
|
int input_down(enum Key);
|
|
int input_pressed(enum Key);
|
|
int input_up(enum Key);
|