1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00

Reduce references to global->cheat

This commit is contained in:
twinaphex 2015-12-01 03:03:33 +01:00
parent dbb3d8f770
commit e0ec68a73d
3 changed files with 5 additions and 9 deletions

View File

@ -330,8 +330,10 @@ void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx)
RARCH_LOG("%s\n", msg);
}
void cheat_manager_toggle_index(cheat_manager_t *handle, unsigned i)
void cheat_manager_toggle_index(unsigned i)
{
global_t *global = global_get_ptr();
cheat_manager_t *handle = global->cheat;
if (!handle)
return;

View File

@ -57,7 +57,7 @@ void cheat_manager_apply_cheats(void);
void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx);
void cheat_manager_toggle_index(cheat_manager_t *handle, unsigned i);
void cheat_manager_toggle_index(unsigned i);
unsigned cheat_manager_get_buf_size(void);

View File

@ -71,13 +71,7 @@ int shader_action_parameter_preset_right(unsigned type, const char *label,
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
bool wraparound)
{
global_t *global = global_get_ptr();
cheat_manager_t *cheat = global->cheat;
if (!cheat)
return -1;
cheat_manager_toggle_index(cheat, idx);
cheat_manager_toggle_index(idx);
return 0;
}