Add RUNLOOP_CTL_GET_WINDOWED_SCALE
This commit is contained in:
parent
c5df156f23
commit
fcde5ae8ff
|
@ -1010,10 +1010,14 @@ bool event_command(enum event_command cmd)
|
||||||
case EVENT_CMD_RESIZE_WINDOWED_SCALE:
|
case EVENT_CMD_RESIZE_WINDOWED_SCALE:
|
||||||
{
|
{
|
||||||
unsigned idx = 0;
|
unsigned idx = 0;
|
||||||
if (global->pending.windowed_scale == 0)
|
unsigned *window_scale = NULL;
|
||||||
|
|
||||||
|
runloop_ctl(RUNLOOP_CTL_GET_WINDOWED_SCALE, &window_scale);
|
||||||
|
|
||||||
|
if (*window_scale == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
settings->video.scale = global->pending.windowed_scale;
|
settings->video.scale = *window_scale;
|
||||||
|
|
||||||
if (!settings->video.fullscreen)
|
if (!settings->video.fullscreen)
|
||||||
event_command(EVENT_CMD_REINIT);
|
event_command(EVENT_CMD_REINIT);
|
||||||
|
|
|
@ -383,6 +383,14 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||||
break;
|
break;
|
||||||
case RUNLOOP_CTL_IS_PERFCNT_ENABLE:
|
case RUNLOOP_CTL_IS_PERFCNT_ENABLE:
|
||||||
return runloop_perfcnt_enable;
|
return runloop_perfcnt_enable;
|
||||||
|
case RUNLOOP_CTL_GET_WINDOWED_SCALE:
|
||||||
|
{
|
||||||
|
unsigned **scale = (unsigned**)data;
|
||||||
|
if (!scale)
|
||||||
|
return false;
|
||||||
|
*scale = (unsigned*)&global->pending.windowed_scale;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case RUNLOOP_CTL_SET_WINDOWED_SCALE:
|
case RUNLOOP_CTL_SET_WINDOWED_SCALE:
|
||||||
{
|
{
|
||||||
unsigned *idx = (unsigned*)data;
|
unsigned *idx = (unsigned*)data;
|
||||||
|
|
|
@ -35,6 +35,7 @@ extern "C" {
|
||||||
enum runloop_ctl_state
|
enum runloop_ctl_state
|
||||||
{
|
{
|
||||||
RUNLOOP_CTL_IS_IDLE = 0,
|
RUNLOOP_CTL_IS_IDLE = 0,
|
||||||
|
RUNLOOP_CTL_GET_WINDOWED_SCALE,
|
||||||
RUNLOOP_CTL_SET_WINDOWED_SCALE,
|
RUNLOOP_CTL_SET_WINDOWED_SCALE,
|
||||||
RUNLOOP_CTL_SET_IDLE,
|
RUNLOOP_CTL_SET_IDLE,
|
||||||
RUNLOOP_CTL_CHECK_IDLE_STATE,
|
RUNLOOP_CTL_CHECK_IDLE_STATE,
|
||||||
|
|
Loading…
Reference in New Issue