RetroArch
Classes | Macros | Typedefs | Functions | Variables
input_overlay.c File Reference
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <math.h>
#include <clamping.h>
#include "../configuration.h"
#include "../verbosity.h"
#include "../gfx/video_driver.h"
#include "input_overlay.h"
Include dependency graph for input_overlay.c:

Classes

struct  input_overlay_state
 
struct  input_overlay
 

Macros

#define OVERLAY_GET_KEY(state, key)   (((state)->keys[(key) / 32] >> ((key) % 32)) & 1)
 
#define OVERLAY_SET_KEY(state, key)   (state)->keys[(key) / 32] |= 1 << ((key) % 32)
 
#define MAX_VISIBILITY   32
 

Typedefs

typedef struct input_overlay_state input_overlay_state_t
 

Functions

static bool input_overlay_add_inputs_inner (overlay_desc_t *desc, unsigned port, unsigned analog_dpad_mode)
 
static bool input_overlay_add_inputs (input_overlay_t *ol, unsigned port, unsigned analog_dpad_mode)
 
static void input_overlay_scale (struct overlay *ol, float scale)
 
static void input_overlay_set_vertex_geom (input_overlay_t *ol)
 
void input_overlay_set_scale_factor (input_overlay_t *ol, float scale)
 
void input_overlay_free_overlay (struct overlay *overlay)
 
static void input_overlay_free_overlays (input_overlay_t *ol)
 
static void input_overlay_load_active (input_overlay_t *ol, float opacity)
 
static void input_overlay_enable (input_overlay_t *ol, bool enable)
 
static bool inside_hitbox (const struct overlay_desc *desc, float x, float y)
 
static void input_overlay_poll (input_overlay_t *ol, input_overlay_state_t *out, int16_t norm_x, int16_t norm_y)
 
static void input_overlay_update_desc_geom (input_overlay_t *ol, struct overlay_desc *desc)
 
static void input_overlay_post_poll (input_overlay_t *ol, float opacity)
 
static void input_overlay_poll_clear (input_overlay_t *ol, float opacity)
 
void input_overlay_next (input_overlay_t *ol, float opacity)
 
void input_overlay_free (input_overlay_t *ol)
 
void input_overlay_loaded (void *task_data, void *user_data, const char *err)
 
void input_overlay_set_visibility (int overlay_idx, enum overlay_visibility vis)
 
static enum overlay_visibility input_overlay_get_visibility (int overlay_idx)
 
static bool input_overlay_is_hidden (int overlay_idx)
 
void input_overlay_set_alpha_mod (input_overlay_t *ol, float mod)
 
bool input_overlay_is_alive (input_overlay_t *ol)
 
bool input_overlay_key_pressed (input_overlay_t *ol, unsigned key)
 
void input_poll_overlay (input_overlay_t *ol, float opacity, unsigned analog_dpad_mode, float axis_threshold)
 
void input_state_overlay (input_overlay_t *ol, int16_t *ret, unsigned port, unsigned device, unsigned idx, unsigned id)
 

Variables

static enum overlay_visibilityvisibility = NULL
 
input_overlay_toverlay_ptr = NULL
 

Macro Definition Documentation

◆ MAX_VISIBILITY

#define MAX_VISIBILITY   32

◆ OVERLAY_GET_KEY

#define OVERLAY_GET_KEY (   state,
  key 
)    (((state)->keys[(key) / 32] >> ((key) % 32)) & 1)

◆ OVERLAY_SET_KEY

#define OVERLAY_SET_KEY (   state,
  key 
)    (state)->keys[(key) / 32] |= 1 << ((key) % 32)

Typedef Documentation

◆ input_overlay_state_t

Function Documentation

◆ input_overlay_add_inputs()

static bool input_overlay_add_inputs ( input_overlay_t ol,
unsigned  port,
unsigned  analog_dpad_mode 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_add_inputs_inner()

static bool input_overlay_add_inputs_inner ( overlay_desc_t desc,
unsigned  port,
unsigned  analog_dpad_mode 
)
static

input_overlay_add_inputs: : pointer to overlay : the user to show the inputs of

Adds inputs from current_input to the overlay, so it's displayed returns true if an input that is pressed will change the overlay

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_enable()

static void input_overlay_enable ( input_overlay_t ol,
bool  enable 
)
static

input_overlay_enable: : Enable or disable the overlay

Enable or disable the overlay.

Here is the caller graph for this function:

◆ input_overlay_free()

void input_overlay_free ( input_overlay_t ol)

input_overlay_free: : Overlay handle.

Frees overlay handle.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_free_overlay()

void input_overlay_free_overlay ( struct overlay overlay)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_free_overlays()

static void input_overlay_free_overlays ( input_overlay_t ol)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_get_visibility()

static enum overlay_visibility input_overlay_get_visibility ( int  overlay_idx)
static
Here is the caller graph for this function:

◆ input_overlay_is_alive()

bool input_overlay_is_alive ( input_overlay_t ol)
Here is the caller graph for this function:

◆ input_overlay_is_hidden()

static bool input_overlay_is_hidden ( int  overlay_idx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_key_pressed()

bool input_overlay_key_pressed ( input_overlay_t ol,
unsigned  key 
)
Here is the caller graph for this function:

◆ input_overlay_load_active()

static void input_overlay_load_active ( input_overlay_t ol,
float  opacity 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_loaded()

void input_overlay_loaded ( void task_data,
void user_data,
const char *  err 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_next()

void input_overlay_next ( input_overlay_t ol,
float  opacity 
)

input_overlay_next: : Overlay handle.

Switch to the next available overlay screen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_poll()

static void input_overlay_poll ( input_overlay_t ol,
input_overlay_state_t out,
int16_t  norm_x,
int16_t  norm_y 
)
static

input_overlay_poll: : Polled output data. : Normalized X coordinate. : Normalized Y coordinate.

Polls input overlay.

and are the result of input_translate_coord_viewport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_poll_clear()

static void input_overlay_poll_clear ( input_overlay_t ol,
float  opacity 
)
static

input_overlay_poll_clear: : overlay handle

Call when there is nothing to poll. Allows overlay to clear certain state.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_post_poll()

static void input_overlay_post_poll ( input_overlay_t ol,
float  opacity 
)
static

input_overlay_post_poll:

Called after all the input_overlay_poll() calls to update the range modifiers for pressed/unpressed regions and alpha mods.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_scale()

static void input_overlay_scale ( struct overlay ol,
float  scale 
)
static

input_overlay_scale: : Overlay handle. : Scaling factor.

Scales overlay and all its associated descriptors by a given scaling factor ().

Here is the caller graph for this function:

◆ input_overlay_set_alpha_mod()

void input_overlay_set_alpha_mod ( input_overlay_t ol,
float  mod 
)

input_overlay_set_alpha_mod: : Overlay handle. : New modulating factor to apply.

Sets a modulating factor for alpha channel. Default is 1.0. The alpha factor is applied for all overlays.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_set_scale_factor()

void input_overlay_set_scale_factor ( input_overlay_t ol,
float  scale 
)

input_overlay_set_scale_factor: : Overlay handle. : Factor of scale to apply.

Scales the overlay by a factor of scale.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_overlay_set_vertex_geom()

static void input_overlay_set_vertex_geom ( input_overlay_t ol)
static
Here is the caller graph for this function:

◆ input_overlay_set_visibility()

void input_overlay_set_visibility ( int  overlay_idx,
enum overlay_visibility  vis 
)
Here is the caller graph for this function:

◆ input_overlay_update_desc_geom()

static void input_overlay_update_desc_geom ( input_overlay_t ol,
struct overlay_desc desc 
)
static

input_overlay_update_desc_geom: : overlay handle. : overlay descriptors handle.

Update input overlay descriptors' vertex geometry.

Here is the caller graph for this function:

◆ input_poll_overlay()

void input_poll_overlay ( input_overlay_t ol,
float  opacity,
unsigned  analog_dpad_mode,
float  axis_threshold 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_state_overlay()

void input_state_overlay ( input_overlay_t ol,
int16_t ret,
unsigned  port,
unsigned  device,
unsigned  idx,
unsigned  id 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ inside_hitbox()

static bool inside_hitbox ( const struct overlay_desc desc,
float  x,
float  y 
)
static

inside_hitbox: : Overlay descriptor handle. : X coordinate value. : Y coordinate value.

Check whether the given and coordinates of the overlay descriptor is inside the overlay descriptor's hitbox.

Returns: true (1) if X, Y coordinates are inside a hitbox, otherwise false (0).

Here is the caller graph for this function:

Variable Documentation

◆ overlay_ptr

input_overlay_t* overlay_ptr = NULL

◆ visibility

enum overlay_visibility* visibility = NULL
static