coastline 0.0.4
Loading...
Searching...
No Matches
playerinput.h
Go to the documentation of this file.
1#ifndef COASTLINE_PLAYERINPUT_H
2#define COASTLINE_PLAYERINPUT_H
3
4#include "common/types.h"
5
6#if TGR_BOSS_RALLY && defined(errno)
7/* The C library macro would replace controller error fields. */
8#pragma push_macro("errno")
9#undef errno
10#define COASTLINE_RESTORE_ERRNO_MACRO
11#endif
12#include <PR/os_cont.h>
13#ifdef COASTLINE_RESTORE_ERRNO_MACRO
14#pragma pop_macro("errno")
15#undef COASTLINE_RESTORE_ERRNO_MACRO
16#endif
17
19#if TGR_BOSS_RALLY
20#define MAX_PLAYERS 16
21#else
22#define MAX_PLAYERS 4
23#endif
24
26#define INPUT_HISTORY_SIZE 128
27
29#define INPUT_RECORDERS 2
30
94
95#ifdef __cplusplus
96extern "C" {
97#endif
98
110
122
134
145#if TGR_PLATFORM == TGR_PLATFORM_SDL
147#else
149#endif
150
161
162#ifdef __cplusplus
163}
164#endif
165
166#endif /* COASTLINE_PLAYERINPUT_H */
void TranslateControllerInput(PlayerInputState *state)
Read the pad of a player into buttons, race actions for the button layout, and the stick,...
The controllers and the Controller Pak file system.
#define MAXCONTROLLERS
The ports of the console.
Definition os_cont.h:17
#define INPUT_RECORDERS
The recordings of the input a player can make at once.
Definition playerinput.h:29
#define MAX_PLAYERS
Number of input slots.
Definition playerinput.h:22
OSContPad g_aContPadData[MAX_PLAYERS]
Emulated controller pads for four ports, or every player slot on SDL.
#define INPUT_HISTORY_SIZE
The button changes a player's input remembers, for the cheat codes.
Definition playerinput.h:26
PlayerInputState g_aPlayerInputState[MAX_PLAYERS]
Input state of every player.
void ConsumeInputFlags(PlayerInputState *state)
Drop from the input the held buttons that are still pressed, and forget the held buttons that are rel...
void TransferFlags(PlayerInputState *state, s32 mask)
Move buttons out of the input until they are released, for a single action per press.
void InitPlayerInputState(PlayerInputState *state)
Reset the input of a player.
The buttons and stick of a controller.
Definition os_cont.h:107
The input of one player.
Definition playerinput.h:32
u16 history[INPUT_HISTORY_SIZE]
Definition playerinput.h:54
s32 recordLimits[INPUT_RECORDERS]
Definition playerinput.h:50
OSContPad * pad
Definition playerinput.h:57
u8 * recordBuffers[INPUT_RECORDERS]
Definition playerinput.h:46
u32 buttons
Definition playerinput.h:33
s32 repeatRight
Definition playerinput.h:39
s32 playbackPosition
Definition playerinput.h:52
s32 playerIndex
Definition playerinput.h:56
s32 controllerMissing
Definition playerinput.h:45
f32 stickX
Definition playerinput.h:40
f32 steering
Definition playerinput.h:42
s32 repeatLeft
Definition playerinput.h:38
u8 * playbackBuffer
Definition playerinput.h:51
u32 heldButtons
Definition playerinput.h:34
s32 playbackLimit
Definition playerinput.h:53
u8 controllerLayout
Definition playerinput.h:44
f32 stickY
Definition playerinput.h:41
s32 historyIndex
Definition playerinput.h:55
s8 steeringInput
Definition playerinput.h:43
s32 repeatUp
Definition playerinput.h:36
s32 repeatDown
Definition playerinput.h:37
s32 recordPositions[INPUT_RECORDERS]
Definition playerinput.h:48
The integer and floating-point types of the console, for headers shared with Windows.
unsigned int u32
Definition ultratypes.h:20
signed char s8
Definition ultratypes.h:23
float f32
Definition ultratypes.h:38
unsigned short u16
Definition ultratypes.h:19
int s32
Definition ultratypes.h:25
unsigned char u8
Definition ultratypes.h:18