Skip to content

Commit

Permalink
Cut down on some more superfluous wrapper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jul 12, 2015
1 parent 19542d4 commit 2aac645
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
16 changes: 0 additions & 16 deletions gfx/video_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,22 +324,6 @@ retro_proc_address_t video_driver_get_proc_address(const char *sym)
return NULL;
}

bool video_driver_is_alive(void)
{
driver_t *driver = driver_get_ptr();
const video_driver_t *video = video_driver_ctx_get_ptr();

return video->alive(driver->video_data);
}

bool video_driver_has_focus(void)
{
driver_t *driver = driver_get_ptr();
const video_driver_t *video = video_driver_ctx_get_ptr();

return video->focus(driver->video_data);
}

bool video_driver_set_shader(enum rarch_shader_type type,
const char *path)
{
Expand Down
4 changes: 0 additions & 4 deletions gfx/video_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ uintptr_t video_driver_get_current_framebuffer(void);

retro_proc_address_t video_driver_get_proc_address(const char *sym);

bool video_driver_is_alive(void);

bool video_driver_has_focus(void);

bool video_driver_set_shader(enum rarch_shader_type type,
const char *shader);

Expand Down
9 changes: 7 additions & 2 deletions runloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ static bool check_pause(bool pause_pressed, bool frameadvance_pressed)
enum event_command cmd = EVENT_CMD_NONE;
bool old_is_paused = runloop ? runloop->is_paused : false;
settings_t *settings = config_get_ptr();
driver_t *driver = driver_get_ptr();
const video_driver_t *video = driver ? (const video_driver_t*)driver->video :
NULL;

/* FRAMEADVANCE will set us into pause mode. */
pause_pressed |= !runloop->is_paused && frameadvance_pressed;

if (settings->pause_nonactive)
focus = video_driver_has_focus();
focus = video->focus(driver->video_data);

if (focus && pause_pressed)
cmd = EVENT_CMD_PAUSE_TOGGLE;
Expand Down Expand Up @@ -635,10 +638,12 @@ static int do_state_checks(event_cmd_state_t *cmd)
static INLINE int time_to_exit(event_cmd_state_t *cmd)
{
runloop_t *runloop = rarch_main_get_ptr();
driver_t *driver = driver_get_ptr();
const video_driver_t *video = driver ? (const video_driver_t*)driver->video : NULL;
global_t *global = global_get_ptr();
rarch_system_info_t *system = rarch_system_info_get_ptr();
bool shutdown_pressed = system->shutdown;
bool video_alive = video_driver_is_alive();
bool video_alive = video->alive(driver->video_data);
bool movie_end = (global->bsv.movie_end && global->bsv.eof_exit);
uint64_t frame_count = video_driver_get_frame_count();
bool frame_count_end = (runloop->frames.video.max &&
Expand Down

0 comments on commit 2aac645

Please sign in to comment.