mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-17 22:00:26 +02:00
The stick moves the player through the game's input state (keyboard_controls_update), as the keys do, so it moves with a southpaw or legacy stick layout too, where it was the left stick. The buttons are named by the profile's button layout, which the game sends the overlay as it changes (host_touch_bindings): with Swap triggers the right trigger's button says Grenade. No control is smaller than a finger (48 dp across). The overlay's opacity can be set; a floating move stick (off by default) goes where the thumb lands in the lower left. Hide is remembered, and Hide and Options act as the finger lifts on them, so a swipe that starts on them aims rather than opens the options mid-fight. A label too long for its button is drawn smaller. TouchControls, TouchLayout, GyroscopeAim and HaloActivity's touch layout files in the repository's style; the layout file is version 3 (opacity, floating stick), and versions 1 and 2 still load. CI runs the layout tests.
78 lines
1.9 KiB
C
78 lines
1.9 KiB
C
/*
|
|
INPUT_ABSTRACTION.H
|
|
|
|
header included in hcex build.
|
|
*/
|
|
|
|
#ifndef __INPUT_ABSTRACTION_H
|
|
#define __INPUT_ABSTRACTION_H
|
|
#pragma once
|
|
|
|
/* ---------- headers */
|
|
|
|
#include "cseries/cseries.h"
|
|
|
|
/* ---------- constants */
|
|
|
|
/* ---------- macros */
|
|
|
|
/* ---------- structures */
|
|
|
|
struct game_input_preferences
|
|
{
|
|
real yaw_rate;
|
|
real pitch_rate;
|
|
byte game_control_to_xbox_buttons[12];
|
|
short joystick_controls;
|
|
boolean invert_look;
|
|
boolean invert_look_aircraft_control;
|
|
};
|
|
|
|
struct game_input_state;
|
|
|
|
typedef char verify_game_input_preferences_size[
|
|
sizeof(struct game_input_preferences) == 0x18 ? 1 : -1];
|
|
|
|
/* ---------- prototypes/INPUT_ABSTRACTION.C */
|
|
|
|
void input_abstraction_initialize(
|
|
void);
|
|
void input_abstraction_dispose(
|
|
void);
|
|
void input_abstraction_update(
|
|
void);
|
|
void input_abstraction_update_device_changes(
|
|
unsigned long device_change_flags);
|
|
void input_abstraction_reset_controller_detection_timer(
|
|
void);
|
|
void input_abstraction_get_local_player_preferences(
|
|
short local_player_index,
|
|
struct game_input_preferences *preferences);
|
|
void input_abstraction_update_local_player_preferences(
|
|
short controller_index,
|
|
struct game_input_preferences const *preferences);
|
|
struct game_input_state *input_abstraction_get_input_state(
|
|
short local_player_index);
|
|
/* port: the keyboard and mouse's own controls (input_abstraction.c) */
|
|
boolean input_abstraction_port_reload(
|
|
short controller_index);
|
|
byte input_abstraction_port_accept(
|
|
short controller_index);
|
|
boolean input_abstraction_port_action_only(
|
|
short controller_index);
|
|
real input_abstraction_port_primary_trigger(
|
|
short controller_index);
|
|
/* port: the game control on each of the controller's buttons, and the
|
|
player's look inverted as its stick is (the touch controls) */
|
|
void input_abstraction_port_button_controls(
|
|
short controller_index,
|
|
short *controls);
|
|
boolean input_abstraction_port_look_inverted(
|
|
short controller_index);
|
|
|
|
/* ---------- globals */
|
|
|
|
/* ---------- public code */
|
|
|
|
#endif // __INPUT_ABSTRACTION_H
|