本文整理汇总了C++中running_machine::paused方法的典型用法代码示例。如果您正苦于以下问题:C++ running_machine::paused方法的具体用法?C++ running_machine::paused怎么用?C++ running_machine::paused使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类running_machine
的用法示例。
在下文中一共展示了running_machine::paused方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ui_gfx_ui_handler
UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 uistate)
{
ui_gfx_state *state = &ui_gfx;
/* if we have nothing, implicitly cancel */
if (machine.total_colors() == 0 && machine.colortable == NULL && machine.gfx[0] == NULL && machine.tilemap().count() == 0)
goto cancel;
/* if we're not paused, mark the bitmap dirty */
if (!machine.paused())
state->bitmap_dirty = TRUE;
/* switch off the state to display something */
again:
switch (state->mode)
{
case 0:
/* if we have a palette, display it */
if (machine.total_colors() > 0)
{
palette_handler(machine, container, state);
break;
}
/* fall through...*/
state->mode++;
case 1:
/* if we have graphics sets, display them */
if (machine.gfx[0] != NULL)
{
gfxset_handler(machine, container, state);
break;
}
/* fall through...*/
state->mode++;
case 2:
/* if we have tilemaps, display them */
if (machine.tilemap().count() > 0)
{
tilemap_handler(machine, container, state);
break;
}
state->mode = 0;
goto again;
}
/* handle keys */
if (ui_input_pressed(machine, IPT_UI_SELECT))
{
state->mode = (state->mode + 1) % 3;
state->bitmap_dirty = TRUE;
}
if (ui_input_pressed(machine, IPT_UI_PAUSE))
{
if (machine.paused())
machine.resume();
else
machine.pause();
}
if (ui_input_pressed(machine, IPT_UI_CANCEL) || ui_input_pressed(machine, IPT_UI_SHOW_GFX))
goto cancel;
return uistate;
cancel:
if (!uistate)
machine.resume();
state->bitmap_dirty = TRUE;
return UI_HANDLER_CANCEL;
}
示例2: ui_gfx_ui_handler
UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 uistate)
{
ui_gfx_state &state = ui_gfx;
// if we have nothing, implicitly cancel
if (!ui_gfx_is_relevant(machine))
goto cancel;
// if we're not paused, mark the bitmap dirty
if (!machine.paused())
state.bitmap_dirty = true;
// switch off the state to display something
again:
switch (state.mode)
{
case UI_GFX_PALETTE:
// if we have a palette, display it
if (state.palette.devcount > 0)
{
palette_handler(machine, container, state);
break;
}
// fall through...
state.mode++;
case UI_GFX_GFXSET:
// if we have graphics sets, display them
if (state.gfxset.devcount > 0)
{
gfxset_handler(machine, container, state);
break;
}
// fall through...
state.mode++;
case UI_GFX_TILEMAP:
// if we have tilemaps, display them
if (machine.tilemap().count() > 0)
{
tilemap_handler(machine, container, state);
break;
}
state.mode = UI_GFX_PALETTE;
goto again;
}
// handle keys
if (ui_input_pressed(machine, IPT_UI_SELECT))
{
state.mode = (state.mode + 1) % 3;
state.bitmap_dirty = true;
}
if (ui_input_pressed(machine, IPT_UI_PAUSE))
{
if (machine.paused())
machine.resume();
else
machine.pause();
}
if (ui_input_pressed(machine, IPT_UI_CANCEL) || ui_input_pressed(machine, IPT_UI_SHOW_GFX))
goto cancel;
return uistate;
cancel:
if (!uistate)
machine.resume();
state.bitmap_dirty = true;
return UI_HANDLER_CANCEL;
}