Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Sep 8, 2017
1 parent 79f1166 commit 330d8dc
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 111 deletions.
34 changes: 17 additions & 17 deletions gfx/video_shader_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ struct gfx_fbo_scale
enum gfx_scale_type type_y;
float scale_x;
float scale_y;
unsigned abs_x;
unsigned abs_y;
bool fp_fbo;
bool srgb_fbo;
bool valid;
unsigned abs_x;
unsigned abs_y;
};

struct video_shader_parameter
Expand Down Expand Up @@ -113,19 +113,19 @@ struct video_shader_pass

char alias[64];
struct gfx_fbo_scale fbo;
unsigned filter;
enum gfx_wrap_type wrap;
unsigned frame_count_mod;
bool mipmap;
unsigned filter;
unsigned frame_count_mod;
};

struct video_shader_lut
{
char id[64];
char path[PATH_MAX_LENGTH];
unsigned filter;
enum gfx_wrap_type wrap;
bool mipmap;
unsigned filter;
};

/* This is pretty big, shouldn't be put on the stack.
Expand All @@ -134,27 +134,27 @@ struct video_shader
{
enum rarch_shader_type type;

bool modern; /* Only used for XML shaders. */
char prefix[64];
char script_class[512];
char script_path[PATH_MAX_LENGTH];
char *script; /* Dynamically allocated. Must be free'd. Only used by XML. */

unsigned passes;
struct video_shader_pass pass[GFX_MAX_SHADERS];
bool modern; /* Only used for XML shaders. */

unsigned passes;
unsigned luts;
struct video_shader_lut lut[GFX_MAX_TEXTURES];

struct video_shader_parameter parameters[GFX_MAX_PARAMETERS];
unsigned num_parameters;

unsigned variables;
struct state_tracker_uniform_info variable[GFX_MAX_VARIABLES];
char script_path[PATH_MAX_LENGTH];
char *script; /* Dynamically allocated. Must be free'd. Only used by XML. */
char script_class[512];

/* If < 0, no feedback pass is used. Otherwise,
* the FBO after pass #N is passed a texture to next frame. */
int feedback_pass;

struct video_shader_pass pass[GFX_MAX_SHADERS];

struct video_shader_lut lut[GFX_MAX_TEXTURES];

struct video_shader_parameter parameters[GFX_MAX_PARAMETERS];
struct state_tracker_uniform_info variable[GFX_MAX_VARIABLES];
};

/**
Expand Down
12 changes: 5 additions & 7 deletions gfx/video_state_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,22 @@ enum state_ram_type

struct state_tracker_uniform_info
{
char id[64];
uint32_t addr;
enum state_tracker_type type;
enum state_ram_type ram_type;
char id[64];
uint16_t mask;
uint16_t equal;
uint32_t addr;
};

struct state_tracker_info
{
const uint8_t *wram;

const struct state_tracker_uniform_info *info;
unsigned info_elem;

const char *script;
const char *script_class;
bool script_is_file;
const uint8_t *wram;
unsigned info_elem;
const struct state_tracker_uniform_info *info;
};

struct state_tracker_uniform
Expand Down
3 changes: 2 additions & 1 deletion menu/drivers/menu_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action)
selection = MAX(MIN(selection, (menu_entries_get_size() - 1)), 0);

menu_entry_get(&entry, 0, selection, NULL, false);
ret = menu_entry_action(&entry, (unsigned)selection, (enum menu_action)action);
ret = menu_entry_action(&entry,
(unsigned)selection, (enum menu_action)action);

if (ret)
goto end;
Expand Down
30 changes: 15 additions & 15 deletions menu/menu_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,31 +344,31 @@ typedef struct
char scratch_buf[PATH_MAX_LENGTH];
char scratch2_buf[PATH_MAX_LENGTH];

/* path to the currently loaded database playlist file. */
char db_playlist_file[PATH_MAX_LENGTH];

uint64_t state;

struct
{
char msg[1024];
} menu_state;

/* path to the currently loaded database playlist file. */
char db_playlist_file[PATH_MAX_LENGTH];
} menu_handle_t;

typedef struct menu_display_ctx_draw
{
enum menu_display_prim_type prim_type;
float x;
float y;
unsigned width;
unsigned height;
struct video_coords *coords;
void *matrix_data;
uintptr_t texture;
enum menu_display_prim_type prim_type;
float *color;
const float *vertex;
const float *tex_coord;
unsigned width;
unsigned height;
uintptr_t texture;
size_t vertex_count;
struct video_coords *coords;
void *matrix_data;
struct
{
unsigned id;
Expand All @@ -380,12 +380,12 @@ typedef struct menu_display_ctx_draw

typedef struct menu_display_ctx_rotate_draw
{
math_matrix_4x4 *matrix;
bool scale_enable;
float rotation;
float scale_x;
float scale_y;
float scale_z;
bool scale_enable;
math_matrix_4x4 *matrix;
} menu_display_ctx_rotate_draw_t;

typedef struct menu_display_ctx_coord_draw
Expand Down Expand Up @@ -536,21 +536,21 @@ typedef struct menu_ctx_pointer
unsigned x;
unsigned y;
unsigned ptr;
menu_file_list_cbs_t *cbs;
menu_entry_t *entry;
unsigned action;
int retcode;
menu_file_list_cbs_t *cbs;
menu_entry_t *entry;
} menu_ctx_pointer_t;

typedef struct menu_ctx_bind
{
menu_file_list_cbs_t *cbs;
const char *path;
const char *label;
unsigned type;
size_t idx;
uint32_t label_hash;
size_t idx;
int retcode;
menu_file_list_cbs_t *cbs;
} menu_ctx_bind_t;

/**
Expand Down
Loading

0 comments on commit 330d8dc

Please sign in to comment.