Пример #1
0
bool GW_GameEngine_VTech::do_setmode(int mode)
{
    switch (mode)
    {
    case MODE_OFF:
        data_stopalltimers();
        data_stopallsounds();
        data_hideall(true);
        break;
    case MODE_IDLE:
        data_stopalltimers();
        data_showall();
        // reset numbers
        display_number(1, 8, false);
        display_number(2, 8, false);
        display_number(3, 8, false);
        display_number(4, 8, false);
        gameover_=true;
        break;
    case MODE_GAMEA:
    case MODE_GAMEB:
        if ((GetMode()!=MODE_GAMEA&&GetMode()!=MODE_GAMEB)||gameover_)
            do_game_start(mode);
        break;
    case MODE_TIME1:
        data_stopalltimers();
        data_hideall(true);
        data().position_get(PS_TIME1)->show();
        clock_update(mode);
        break;
    case MODE_TIME2:
        data_stopalltimers();
        data_hideall(true);
        data().position_get(PS_TIME2)->show();
        clock_update(mode);
        break;
    case MODE_ALARM:
        data_stopalltimers();
        data_hideall(true);
        data().position_get(PS_ALARM)->show();
        clock_update(mode);
        break;
    case MODE_CHRONO:
        data_stopalltimers();
        data_hideall(true);
        data().position_get(PS_CHRONO)->show();
        clock_update(mode);
        break;
    case MODE_DATE:
        data_stopalltimers();
        data_hideall(true);
        data().position_get(PS_DATE)->show();
        clock_update(mode);
        break;
    default:
        return false;
        break;
    }
    return true;
}
Пример #2
0
bool GW_Game_DKong::do_setmode(int mode)
{
    switch (mode)
    {
    case MODE_OFF:
        data_stopalltimers();
        data_stopallsounds();
        data_hideall(true);
        break;
    case MODE_IDLE:
        data_stopalltimers();
        data_showall();
        // reset numbers
        display_number(1, 1, false);
        display_number(2, 2, false);
        display_number(3, 0, false);
        display_number(4, 0, false);
        break;
    case MODE_GAMEA:
    case MODE_GAMEB:
/*
        if ((GetMode()!=MODE_GAMEA&&GetMode()!=MODE_GAMEB))
            do_game_start(mode);
*/
        break;
    case MODE_TIME:
        data_stopalltimers();
        data_hideall(true);
        //data().position_get(PS_TIME1)->show();
        clock_update(mode);
        break;
    case MODE_ALARM:
        data_stopalltimers();
        data_hideall(true);
        data().position_get(PS_ALARM)->show();
        clock_update(mode);
        break;
    default:
        return false;
        break;
    }
    return true;
}