(360) Simplify filtering types to 'point filtering' and 'linear

interpolation' (anisotropic is useless for 2D) - also get rid
of filter_type member in g_console
This commit is contained in:
TwinAphex51224 2012-02-13 15:16:01 +01:00
parent eeafd335fa
commit 1307648d08
4 changed files with 19 additions and 36 deletions

View File

@ -53,7 +53,6 @@ char SYS_CONFIG_FILE[MAX_PATH_LENGTH];
extern "C" int __stdcall ObCreateSymbolicLink( STRING*, STRING*);
int Mounted[20];
uint64_t ingame_menu_item = 0;
int ssnes_main(int argc, char *argv[]);
@ -131,6 +130,7 @@ static void set_default_settings (void)
//g_settings
g_settings.rewind_enable = false;
g_settings.video.vsync = true;
g_settings.video.smooth = true;
//g_console
g_console.block_config_read = true;
@ -139,7 +139,6 @@ static void set_default_settings (void)
g_console.emulator_initialized = 0;
g_console.mode_switch = MODE_MENU;
strlcpy(g_console.default_rom_startup_dir, "game:\\roms\\", sizeof(g_console.default_rom_startup_dir));
g_console.filter_type = D3DTEXF_LINEAR;
//g_extern
g_extern.state_slot = 0;
@ -173,12 +172,12 @@ static void init_settings (void)
// g_settings
CONFIG_GET_BOOL(rewind_enable, "rewind_enable");
CONFIG_GET_BOOL(video.smooth, "video_smooth");
CONFIG_GET_BOOL(video.vsync, "video_vsync");
// g_console
CONFIG_GET_BOOL_CONSOLE(throttle_enable, "throttle_enable");
CONFIG_GET_STRING_CONSOLE(default_rom_startup_dir, "default_rom_startup_dir");
CONFIG_GET_INT_CONSOLE(filter_type, "filter_type");
// g_extern
CONFIG_GET_INT_EXTERN(state_slot, "state_slot");
@ -201,12 +200,12 @@ static void save_settings (void)
// g_settings
config_set_bool(conf, "rewind_enable", g_settings.rewind_enable);
config_set_bool(conf, "video_smooth", g_settings.video.smooth);
config_set_bool(conf, "video_vsync", g_settings.video.vsync);
// g_console
config_set_string(conf, "default_rom_startup_dir", g_console.default_rom_startup_dir);
config_set_bool(conf, "throttle_enable", g_console.throttle_enable);
config_set_int(conf, "filter_type", g_console.filter_type);
// g_extern
config_set_int(conf, "state_slot", g_extern.state_slot);
@ -302,12 +301,12 @@ static void ingame_menu (void)
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B)
{
g_console.frame_advance_enable = false;
ingame_menu_item = 0;
g_console.ingame_menu_item = 0;
g_console.ingame_menu_enable = false;
g_console.mode_switch = MODE_EMULATION;
}
switch(ingame_menu_item)
switch(g_console.ingame_menu_item)
{
case MENU_ITEM_LOAD_STATE:
break;
@ -364,7 +363,7 @@ begin_loop:
if(g_console.mode_switch == MODE_EMULATION)
{
bool repeat = false;
if(ingame_menu_item != 0)
if(g_console.ingame_menu_item != 0)
g_console.ingame_menu_enable = true;
input_xdk360.poll(NULL);

View File

@ -87,18 +87,12 @@ static void set_filter_element(int index, CXuiControl * obj)
{
switch(index)
{
case D3DTEXF_NONE:
obj->SetText(L"None");
break;
case D3DTEXF_POINT:
case FALSE:
obj->SetText(L"Point filtering");
break;
case D3DTEXF_LINEAR:
case TRUE:
obj->SetText(L"Linear interpolation");
break;
case D3DTEXF_ANISOTROPIC:
obj->SetText(L"Anisotropic filtering");
break;
}
}
@ -109,7 +103,7 @@ HRESULT CSSNESSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
GetChildById(L"XuiBackButton1", &m_back);
GetChildById(L"XuiBtnHWFilter", &m_hw_filter);
set_filter_element(g_console.filter_type, &m_hw_filter);
set_filter_element(g_settings.video.smooth, &m_hw_filter);
m_rewind_cb.SetCheck(g_settings.rewind_enable);
return S_OK;
}
@ -180,21 +174,7 @@ HRESULT CSSNESSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
}
else if ( hObjPressed == m_hw_filter)
{
switch(g_console.filter_type)
{
case D3DTEXF_NONE:
g_console.filter_type = D3DTEXF_LINEAR;
break;
case D3DTEXF_POINT:
g_console.filter_type = D3DTEXF_NONE;
break;
case D3DTEXF_LINEAR:
g_console.filter_type = D3DTEXF_ANISOTROPIC;
break;
case D3DTEXF_ANISOTROPIC:
g_console.filter_type = D3DTEXF_POINT;
break;
}
g_settings.video.smooth = !g_settings.video.smooth;
}
else if ( hObjPressed == m_back )
{
@ -207,7 +187,7 @@ HRESULT CSSNESSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
NavigateBack(app.hMainScene);
}
set_filter_element(g_console.filter_type, &m_hw_filter);
set_filter_element(g_settings.video.smooth, &m_hw_filter);
bHandled = TRUE;
return S_OK;
}

View File

@ -117,6 +117,11 @@ static void *xdk360_gfx_init(const video_info_t *video, const input_driver_t **i
XGetVideoMode(&vid->video_mode);
memset(&vid->d3dpp, 0, sizeof(vid->d3dpp));
// no letterboxing in 4:3 mode (if widescreen is
// unsupported
if(!vid->video_mode.fIsWideScreen)
vid->d3dpp.Flags |= D3DPRESENTFLAG_NO_LETTERBOX;
vid->d3dpp.BackBufferWidth = vid->video_mode.fIsHiDef ? 1280 : 640;
vid->d3dpp.BackBufferHeight = vid->video_mode.fIsHiDef ? 720 : 480;
@ -262,8 +267,8 @@ static bool xdk360_gfx_frame(void *data, const void *frame,
}
vid->xdk360_render_device->SetTexture(0, vid->lpTexture);
vid->xdk360_render_device->SetSamplerState(0, D3DSAMP_MINFILTER, g_console.filter_type);
vid->xdk360_render_device->SetSamplerState(0, D3DSAMP_MAGFILTER, g_console.filter_type);
vid->xdk360_render_device->SetSamplerState(0, D3DSAMP_MINFILTER, g_settings.video.smooth ? D3DTEXF_LINEAR : D3DTEXF_POINT);
vid->xdk360_render_device->SetSamplerState(0, D3DSAMP_MAGFILTER, g_settings.video.smooth ? D3DTEXF_LINEAR : D3DTEXF_POINT);
vid->xdk360_render_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);
vid->xdk360_render_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER);
@ -346,7 +351,7 @@ void xdk360_video_init(void)
// Might have to supply correct values here.
video_info.vsync = g_settings.video.vsync;
video_info.force_aspect = false;
video_info.smooth = true;
video_info.smooth = g_settings.video.smooth;
video_info.input_scale = 2;
g_d3d = xdk360_gfx_init(&video_info, NULL, NULL);

View File

@ -185,7 +185,6 @@ struct console_settings
float overscan_amount;
uint32_t aspect_ratio_index;
uint32_t emulator_initialized;
uint32_t filter_type;
uint32_t screen_orientation;
uint32_t current_resolution_index;
uint32_t current_resolution_id;