(360) Replace static function return_to_game() with calls to new

rarch_settings_change
This commit is contained in:
TwinAphex51224 2012-05-29 02:05:23 +02:00
parent e49e23687a
commit 87d04b4bbd
3 changed files with 71 additions and 71 deletions

View File

@ -33,13 +33,6 @@ filebrowser_t browser;
filebrowser_t tmp_browser; filebrowser_t tmp_browser;
uint32_t set_shader = 0; uint32_t set_shader = 0;
static void return_to_game (void)
{
g_console.frame_advance_enable = false;
g_console.menu_enable = false;
g_console.mode_switch = MODE_EMULATION;
}
static void return_to_dashboard (void) static void return_to_dashboard (void)
{ {
g_console.menu_enable = false; g_console.menu_enable = false;
@ -349,16 +342,16 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
{ {
case MENU_ITEM_LOAD_STATE: case MENU_ITEM_LOAD_STATE:
if (g_console.emulator_initialized) if (g_console.emulator_initialized)
{ {
rarch_load_state(); rarch_load_state();
return_to_game(); rarch_settings_change(S_RETURN_TO_GAME);
} }
break; break;
case MENU_ITEM_SAVE_STATE: case MENU_ITEM_SAVE_STATE:
if (g_console.emulator_initialized) if (g_console.emulator_initialized)
{ {
rarch_save_state(); rarch_save_state();
return_to_game(); rarch_settings_change(S_RETURN_TO_GAME);
} }
break; break;
case MENU_ITEM_KEEP_ASPECT_RATIO: case MENU_ITEM_KEEP_ASPECT_RATIO:
@ -386,22 +379,22 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
case MENU_ITEM_ORIENTATION: case MENU_ITEM_ORIENTATION:
switch(g_console.screen_orientation) switch(g_console.screen_orientation)
{ {
case ORIENTATION_NORMAL: case ORIENTATION_NORMAL:
g_console.screen_orientation = ORIENTATION_VERTICAL; g_console.screen_orientation = ORIENTATION_VERTICAL;
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Vertical"); m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Vertical");
break; break;
case ORIENTATION_VERTICAL: case ORIENTATION_VERTICAL:
g_console.screen_orientation = ORIENTATION_FLIPPED; g_console.screen_orientation = ORIENTATION_FLIPPED;
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Flipped"); m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Flipped");
break; break;
case ORIENTATION_FLIPPED: case ORIENTATION_FLIPPED:
g_console.screen_orientation = ORIENTATION_FLIPPED_ROTATED; g_console.screen_orientation = ORIENTATION_FLIPPED_ROTATED;
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Flipped Rotated"); m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Flipped Rotated");
break; break;
case ORIENTATION_FLIPPED_ROTATED: case ORIENTATION_FLIPPED_ROTATED:
g_console.screen_orientation = ORIENTATION_NORMAL; g_console.screen_orientation = ORIENTATION_NORMAL;
m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Normal"); m_quickmenulist.SetText(MENU_ITEM_ORIENTATION, L"Orientation: Normal");
break; break;
} }
video_xdk360.set_rotation(driver.video_data, g_console.screen_orientation); video_xdk360.set_rotation(driver.video_data, g_console.screen_orientation);
break; break;
@ -415,29 +408,25 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
break; break;
case MENU_ITEM_FRAME_ADVANCE: case MENU_ITEM_FRAME_ADVANCE:
if (g_console.emulator_initialized) if (g_console.emulator_initialized)
{ rarch_settings_change(S_FRAME_ADVANCE);
g_console.frame_advance_enable = true;
g_console.menu_enable = false;
g_console.mode_switch = MODE_EMULATION;
}
break; break;
case MENU_ITEM_SCREENSHOT_MODE: case MENU_ITEM_SCREENSHOT_MODE:
if (g_console.info_msg_enable) if (g_console.info_msg_enable)
{ {
msg_queue_clear(g_extern.msg_queue); msg_queue_clear(g_extern.msg_queue);
msg_queue_push(g_extern.msg_queue, "TODO - Not yet implemented.", 1, 180); msg_queue_push(g_extern.msg_queue, "TODO - Not yet implemented.", 1, 180);
} }
break; break;
case MENU_ITEM_RESET: case MENU_ITEM_RESET:
if (g_console.emulator_initialized) if (g_console.emulator_initialized)
{ {
return_to_game(); rarch_settings_change(S_RETURN_TO_GAME);
rarch_game_reset(); rarch_game_reset();
} }
break; break;
case MENU_ITEM_RETURN_TO_GAME: case MENU_ITEM_RETURN_TO_GAME:
if (g_console.emulator_initialized) if (g_console.emulator_initialized)
return_to_game(); rarch_settings_change(S_RETURN_TO_GAME);
break; break;
case MENU_ITEM_RETURN_TO_DASHBOARD: case MENU_ITEM_RETURN_TO_DASHBOARD:
return_to_dashboard(); return_to_dashboard();
@ -506,7 +495,7 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
{ {
memset(g_console.rom_path, 0, sizeof(g_console.rom_path)); memset(g_console.rom_path, 0, sizeof(g_console.rom_path));
snprintf(g_console.rom_path, sizeof(g_console.rom_path), "%s\\%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), strbuffer); snprintf(g_console.rom_path, sizeof(g_console.rom_path), "%s\\%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), strbuffer);
return_to_game(); rarch_settings_change(S_RETURN_TO_GAME);
g_console.initialize_rarch_enable = 1; g_console.initialize_rarch_enable = 1;
} }
} }

View File

@ -26,26 +26,35 @@ void rarch_settings_change(unsigned setting)
{ {
switch(setting) switch(setting)
{ {
case S_FRAME_ADVANCE:
g_console.frame_advance_enable = true;
g_console.menu_enable = false;
g_console.mode_switch = MODE_EMULATION;
break;
case S_HW_TEXTURE_FILTER: case S_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth; g_settings.video.smooth = !g_settings.video.smooth;
break; break;
case S_HW_TEXTURE_FILTER_2: case S_HW_TEXTURE_FILTER_2:
g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth; g_settings.video.second_pass_smooth = !g_settings.video.second_pass_smooth;
break; break;
case S_OVERSCAN_DECREMENT: case S_OVERSCAN_DECREMENT:
g_console.overscan_amount -= 0.01f; g_console.overscan_amount -= 0.01f;
g_console.overscan_enable = true; g_console.overscan_enable = true;
if(g_console.overscan_amount == 0.0f)
if(g_console.overscan_amount == 0.0f)
g_console.overscan_enable = false; g_console.overscan_enable = false;
break; break;
case S_OVERSCAN_INCREMENT: case S_OVERSCAN_INCREMENT:
g_console.overscan_amount += 0.01f; g_console.overscan_amount += 0.01f;
g_console.overscan_enable = true; g_console.overscan_enable = true;
if(g_console.overscan_amount == 0.0f)
if(g_console.overscan_amount == 0.0f)
g_console.overscan_enable = 0; g_console.overscan_enable = 0;
break; break;
case S_RETURN_TO_GAME:
g_console.frame_advance_enable = false;
//g_console.ingame_menu_item = 0;
g_console.menu_enable = false;
g_console.mode_switch = MODE_EMULATION;
break;
case S_ROTATION_DECREMENT: case S_ROTATION_DECREMENT:
if(g_console.screen_orientation > ORIENTATION_NORMAL) if(g_console.screen_orientation > ORIENTATION_NORMAL)
g_console.screen_orientation--; g_console.screen_orientation--;
@ -55,28 +64,28 @@ void rarch_settings_change(unsigned setting)
g_console.screen_orientation++; g_console.screen_orientation++;
break; break;
case S_SAVESTATE_DECREMENT: case S_SAVESTATE_DECREMENT:
if(g_extern.state_slot != 0) if(g_extern.state_slot != 0)
g_extern.state_slot--; g_extern.state_slot--;
break; break;
case S_SAVESTATE_INCREMENT: case S_SAVESTATE_INCREMENT:
g_extern.state_slot++; g_extern.state_slot++;
break; break;
case S_SCALE_ENABLED: case S_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled; g_console.fbo_enabled = !g_console.fbo_enabled;
break; break;
case S_SCALE_FACTOR_DECREMENT: case S_SCALE_FACTOR_DECREMENT:
g_settings.video.fbo_scale_x -= 1.0f; g_settings.video.fbo_scale_x -= 1.0f;
g_settings.video.fbo_scale_y -= 1.0f; g_settings.video.fbo_scale_y -= 1.0f;
break; break;
case S_SCALE_FACTOR_INCREMENT: case S_SCALE_FACTOR_INCREMENT:
g_settings.video.fbo_scale_x += 1.0f; g_settings.video.fbo_scale_x += 1.0f;
g_settings.video.fbo_scale_y += 1.0f; g_settings.video.fbo_scale_y += 1.0f;
break; break;
case S_THROTTLE: case S_THROTTLE:
g_console.throttle_enable = !g_console.throttle_enable; g_console.throttle_enable = !g_console.throttle_enable;
break; break;
case S_TRIPLE_BUFFERING: case S_TRIPLE_BUFFERING:
g_console.triple_buffering_enable = !g_console.triple_buffering_enable; g_console.triple_buffering_enable = !g_console.triple_buffering_enable;
break; break;
} }
} }
@ -89,29 +98,29 @@ void rarch_settings_default(unsigned setting)
g_settings.video.smooth = 1; g_settings.video.smooth = 1;
break; break;
case S_DEF_HW_TEXTURE_FILTER_2: case S_DEF_HW_TEXTURE_FILTER_2:
g_settings.video.second_pass_smooth = 1; g_settings.video.second_pass_smooth = 1;
break; break;
case S_DEF_OVERSCAN: case S_DEF_OVERSCAN:
g_console.overscan_amount = 0.0f; g_console.overscan_amount = 0.0f;
g_console.overscan_enable = false; g_console.overscan_enable = false;
break; break;
case S_DEF_THROTTLE: case S_DEF_THROTTLE:
g_console.throttle_enable = true; g_console.throttle_enable = true;
break; break;
case S_DEF_TRIPLE_BUFFERING: case S_DEF_TRIPLE_BUFFERING:
g_console.triple_buffering_enable = true; g_console.triple_buffering_enable = true;
break; break;
case S_DEF_SAVE_STATE: case S_DEF_SAVE_STATE:
g_extern.state_slot = 0; g_extern.state_slot = 0;
break; break;
case S_DEF_SCALE_ENABLED: case S_DEF_SCALE_ENABLED:
g_console.fbo_enabled = true; g_console.fbo_enabled = true;
g_settings.video.fbo_scale_x = 2.0f; g_settings.video.fbo_scale_x = 2.0f;
g_settings.video.fbo_scale_y = 2.0f; g_settings.video.fbo_scale_y = 2.0f;
break; break;
case S_DEF_SCALE_FACTOR: case S_DEF_SCALE_FACTOR:
g_settings.video.fbo_scale_x = 2.0f; g_settings.video.fbo_scale_x = 2.0f;
g_settings.video.fbo_scale_y = 2.0f; g_settings.video.fbo_scale_y = 2.0f;
break; break;
} }
} }

View File

@ -19,10 +19,12 @@
enum enum
{ {
S_HW_TEXTURE_FILTER = 0, S_FRAME_ADVANCE = 0,
S_HW_TEXTURE_FILTER,
S_HW_TEXTURE_FILTER_2, S_HW_TEXTURE_FILTER_2,
S_OVERSCAN_DECREMENT, S_OVERSCAN_DECREMENT,
S_OVERSCAN_INCREMENT, S_OVERSCAN_INCREMENT,
S_RETURN_TO_GAME,
S_ROTATION_DECREMENT, S_ROTATION_DECREMENT,
S_ROTATION_INCREMENT, S_ROTATION_INCREMENT,
S_SAVESTATE_DECREMENT, S_SAVESTATE_DECREMENT,