(PS3) Removed g_frame_count - will use pointer to gl->frame_count

This commit is contained in:
Twinaphex 2012-05-26 18:18:09 +02:00
parent e34f6aa774
commit c40edf878c
5 changed files with 24 additions and 13 deletions

View File

@ -61,3 +61,8 @@ void gfx_ctx_check_window(bool *quit,
if(gl->should_resize)
*resize = true;
}
bool gfx_ctx_window_has_focus(void)
{
return true;
}

View File

@ -175,6 +175,7 @@ static uint64_t old_state = 0;
static void set_delay_speed(unsigned delaymode)
{
unsigned speed;
gl_t * gl = driver.video_data;
speed = 0;
@ -203,6 +204,7 @@ static void set_delay_speed(unsigned delaymode)
static void browser_update(filebrowser_t * b)
{
uint64_t state, diff_state, button_was_pressed;
gl_t * gl = driver.video_data;
state = cell_pad_input_poll_device(0);
diff_state = old_state ^ state;
@ -830,6 +832,7 @@ static void select_file(uint32_t menu_id)
char extensions[256], title[256], object[256], comment[256], dir_path[MAX_PATH_LENGTH],
path[MAX_PATH_LENGTH], *separatorslash;
uint64_t state, diff_state, button_was_pressed;
gl_t * gl = driver.video_data;
state = cell_pad_input_poll_device(0);
diff_state = old_state ^ state;
@ -972,6 +975,7 @@ static void select_directory(uint32_t menu_id)
{
char path[1024], newpath[1024], *separatorslash;
uint64_t state, diff_state, button_was_pressed;
gl_t * gl = driver.video_data;
state = cell_pad_input_poll_device(0);
diff_state = old_state ^ state;
@ -1821,6 +1825,7 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
static void select_setting(menu * menu_obj)
{
uint64_t state, diff_state, button_was_pressed, i;
gl_t * gl = driver.video_data;
state = cell_pad_input_poll_device(0);
diff_state = old_state ^ state;
@ -1924,6 +1929,7 @@ static void select_rom(void)
{
char newpath[1024], *separatorslash;
uint64_t state, diff_state, button_was_pressed;
gl_t * gl = driver.video_data;
state = cell_pad_input_poll_device(0);
diff_state = old_state ^ state;
@ -2539,6 +2545,8 @@ void menu_init (void)
void menu_loop(void)
{
gl_t * gl = driver.video_data;
menuStack[0] = menu_filebrowser;
menuStack[0].enum_id = FILE_BROWSER_MENU;

View File

@ -291,6 +291,8 @@ void ps3_input_map_dpad_to_stick(uint32_t map_dpad_enum, uint32_t controller_id)
static bool ps3_key_pressed(void *data, int key)
{
(void)data;
gl_t *gl = driver.video_data;
switch (key)
{
case RARCH_FAST_FORWARD_HOLD_KEY:

View File

@ -110,8 +110,6 @@ struct {
CellVideoOutState g_video_state;
} ps3_gl;
unsigned g_frame_count;
#ifdef HAVE_FBO
#if defined(_WIN32) && !defined(RARCH_CONSOLE)
static PFNGLGENFRAMEBUFFERSPROC pglGenFramebuffers = NULL;
@ -637,7 +635,7 @@ void gl_frame_menu (void)
{
gl_t *gl = driver.video_data;
g_frame_count++;
gl->frame_count++;
if(!gl)
return;
@ -645,7 +643,7 @@ void gl_frame_menu (void)
gl_shader_use(RARCH_CG_MENU_SHADER_INDEX);
gl_shader_set_params(gl->win_width, gl->win_height, gl->win_width,
gl->win_height, gl->win_width, gl->win_height, g_frame_count,
gl->win_height, gl->win_width, gl->win_height, gl->frame_count,
NULL, NULL, NULL, 0);
set_viewport_force_full(gl, gl->win_width, gl->win_height);
@ -703,7 +701,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
gl_t *gl = data;
gl_shader_use(1);
g_frame_count++;
gl->frame_count++;
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
@ -762,7 +760,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
gl_shader_set_params(width, height,
gl->tex_w, gl->tex_h,
gl->vp_width, gl->vp_height,
g_frame_count, &tex_info, gl->prev_info, fbo_tex_info, fbo_tex_info_cnt);
gl->frame_count, &tex_info, gl->prev_info, fbo_tex_info, fbo_tex_info_cnt);
glDrawArrays(GL_QUADS, 0, 4);
@ -807,7 +805,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
set_viewport_force_full(gl, rect->img_width, rect->img_height);
gl_shader_set_params(prev_rect->img_width, prev_rect->img_height,
prev_rect->width, prev_rect->height,
gl->vp_width, gl->vp_height, g_frame_count,
gl->vp_width, gl->vp_height, gl->frame_count,
&tex_info, gl->prev_info, fbo_tex_info, fbo_tex_info_cnt);
glDrawArrays(GL_QUADS, 0, 4);
@ -832,7 +830,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
set_viewport(gl, gl->win_width, gl->win_height);
gl_shader_set_params(prev_rect->img_width, prev_rect->img_height,
prev_rect->width, prev_rect->height,
gl->vp_width, gl->vp_height, g_frame_count,
gl->vp_width, gl->vp_height, gl->frame_count,
&tex_info, gl->prev_info, fbo_tex_info, fbo_tex_info_cnt);
glVertexPointer(2, GL_FLOAT, 0, vertex_ptr);
@ -1122,7 +1120,7 @@ static bool gl_alive(void *data)
static bool gl_focus(void *data)
{
(void)data;
return true;
return gfx_ctx_window_has_focus();
}
static void ps3graphics_set_swap_block_swap(void * data, bool toggle)

View File

@ -33,9 +33,9 @@ enum
#define MIN_SCALING_FACTOR (1.0f)
#define MAX_SCALING_FACTOR (4.0f)
#define IS_TIMER_NOT_EXPIRED(getter) (g_frame_count < getter)
#define IS_TIMER_NOT_EXPIRED(getter) (gl->frame_count < getter)
#define IS_TIMER_EXPIRED(getter) (!(IS_TIMER_NOT_EXPIRED(getter)))
#define SET_TIMER_EXPIRATION(setter, value) setter = g_frame_count + value;
#define SET_TIMER_EXPIRATION(setter, value) setter = gl->frame_count + value;
bool ps3_setup_texture(void);
const char * ps3_get_resolution_label(uint32_t resolution);
@ -61,6 +61,4 @@ bool gl_cg_load_shader(unsigned index, const char *path);
unsigned gl_cg_get_lut_info(struct gl_cg_lut_info *info, unsigned elems);
extern unsigned g_frame_count;
#endif