(RMenu) Move more code to context file

This commit is contained in:
Twinaphex 2012-08-18 23:50:21 +02:00
parent 0be71f9d08
commit 2ebba4a347
4 changed files with 25 additions and 24 deletions

View File

@ -14,6 +14,10 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_SYSUTILS
#include <cell/sysmodule.h>
#endif
#include "../rmenu.h"
#include "../../../gfx/context/ps3_ctx.h"
@ -47,6 +51,14 @@ static void rmenu_ctx_ps3_render_bg(rmenu_position_t *position)
(void)position;
}
static void rmenu_ctx_ps3_swap_buffers(void)
{
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
}
const rmenu_context_t rmenu_ctx_ps3 = {
.clear = rmenu_ctx_ps3_clear,
.blend = rmenu_ctx_ps3_blend,
@ -54,4 +66,5 @@ const rmenu_context_t rmenu_ctx_ps3 = {
.init_textures = rmenu_ctx_ps3_init_textures,
.render_selection_panel = rmenu_ctx_ps3_render_selection_panel,
.render_bg = rmenu_ctx_ps3_render_bg,
};
.swap_buffers = rmenu_ctx_ps3_swap_buffers,
};

View File

@ -89,6 +89,11 @@ static void rmenu_ctx_xdk_render_bg(rmenu_position_t *position)
texture_image_render(&m_menuMainBG);
}
static void rmenu_ctx_xdk_swap_buffers(void)
{
gfx_ctx_swap_buffers();
}
const rmenu_context_t rmenu_ctx_xdk = {
rmenu_ctx_xdk_clear,
rmenu_ctx_xdk_blend,
@ -96,4 +101,5 @@ const rmenu_context_t rmenu_ctx_xdk = {
rmenu_ctx_xdk_init_textures,
rmenu_ctx_xdk_render_selection_panel,
rmenu_ctx_xdk_render_bg,
rmenu_ctx_xdk_swap_buffers,
};

View File

@ -16,7 +16,6 @@
#if defined(__CELLOS_LV2__)
#include <sdk_version.h>
#include <cell/sysmodule.h>
#include <sysutil/sysutil_screenshot.h>
#if(CELL_SDK_VERSION > 0x340000)
@ -51,12 +50,6 @@
#endif
#include "../../gfx/gfx_context.h"
#if defined(__CELLOS_LV2__)
#include "../../gfx/context/ps3_ctx.h"
#elif defined(_XBOX)
#include "../../gfx/context/xdk_ctx.h"
#endif
#if defined(HAVE_CG)
#include "../../gfx/shader_cg.h"
#endif
@ -1002,10 +995,7 @@ static void rarch_filename_input_and_save (unsigned filename_type)
while(OSK_IS_RUNNING(g_console.oskutil_handle))
{
context->clear();
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
context->swap_buffers();
}
if(g_console.oskutil_handle.text_can_be_fetched)
@ -1038,10 +1028,7 @@ static void rarch_filename_input_and_save (unsigned filename_type)
{
/* OSK Util gets updated */
context->clear();
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
context->swap_buffers();
}
if(g_console.oskutil_handle.text_can_be_fetched)
@ -1412,10 +1399,7 @@ static void producesettingentry(menu *current_menu, item *items, unsigned switch
while(OSK_IS_RUNNING(g_console.oskutil_handle))
{
context->clear();
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
context->swap_buffers();
}
if(g_console.oskutil_handle.text_can_be_fetched)
@ -2557,10 +2541,7 @@ void menu_loop(void)
render_msg_place_func(msg_queue_x_position, msg_queue_y_position, msg_queue_font_size, WHITE, message);
}
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
context->swap_buffers();
if(current_menu->enum_id == INGAME_MENU_RESIZE && (old_state & (1 << RETRO_DEVICE_ID_JOYPAD_Y)) || current_menu->enum_id == INGAME_MENU_SCREENSHOT)
{ }

View File

@ -111,6 +111,7 @@ typedef struct rmenu_context
void (*init_textures)(void);
void (*render_selection_panel)(rmenu_position_t *position);
void (*render_bg)(rmenu_position_t *position);
void (*swap_buffers)(void);
} rmenu_context_t;
enum