⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 game.c

📁 MTK平台中可移植的五子棋游戏
💻 C
📖 第 1 页 / 共 3 页
字号:
    #ifdef IS_COLORBALL_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_SNAKE_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_SMASH_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_DOLL_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_NINJA_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_MAJUNG_BASE_GAME
            GAME_SWITCH(game_majung, Majung_Enter_GFX);
    #endif 

    #ifdef IS_MEMORY_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_COPTER_BASE_GAME
            GAME_SWITCH(game_copter, mmi_gx_copter_enter_gfx);
    #endif 

    #ifdef IS_PUZZLE_BASE_GAME
            GAME_SWITCH(game_puzzle, mmi_gx_puzzle_enter_gfx);
    #endif 

    #ifdef IS_PANDA_BASE_GAME
            GAME_SWITCH(game_panda, mmi_gx_panda_enter_gfx);
    #endif 

    #ifdef IS_STAIR_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_UFO_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_DANCE_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_MAGICSUSHI_BASE_GAME
            GAME_SWITCH(game_magicsushi, mmi_gx_magicsushi_enter_gfx);
    #endif 

    #ifdef IS_FRUIT_BASE_GAME
/* under construction !*/
    #endif 

    #ifdef IS_VSMJ_BASE_GAME
/* under construction !*/
    #endif 

	#ifdef __MMI_GAME_WUZHIQI__
	GAME_SWITCH(game_wuzhiqi,mmi_game_wuzhiqi);
	#endif

        default:
            SetLeftSoftkeyFunction(mmi_game_entry_setting_screen, KEY_EVENT_UP);
            SetKeyHandler(mmi_game_entry_setting_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
            break;

    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_game_highlight_app
 * DESCRIPTION
 *  highlight game app menitem
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#if defined(__MMI_GAME__)
void mmi_game_highlight_app(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    SetLeftSoftkeyFunction(mmi_game_entry_app_screen, KEY_EVENT_UP);
    SetKeyHandler(mmi_game_entry_app_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
}
#endif /* defined(__MMI_GAME__) */ 


/*****************************************************************************
 * FUNCTION
 *  mmi_game_entry_app_screen
 * DESCRIPTION
 *  entry game app screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_game_entry_app_screen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *guiBuffer;
    UI_time t;
    U16 menu_str[game_list_count + 1];
    U16 menu_img[game_list_count + 1];
    U16 index = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* str and img +1 for setting */

#ifdef IS_F1RACE_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_F1RACE_BASE_GAME */ 

#ifdef IS_HANOI_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_HANOI_BASE_GAME */ 

#ifdef IS_RICHES_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_RICHES_BASE_GAME */ 

#ifdef IS_COLORBALL_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_COLORBALL_BASE_GAME */ 

#ifdef IS_SNAKE_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_SNAKE_BASE_GAME */ 

#ifdef IS_SMASH_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_SMASH_BASE_GAME */ 

#ifdef IS_DOLL_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_DOLL_BASE_GAME */ 

#ifdef IS_NINJA_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_NINJA_BASE_GAME */ 

#ifdef IS_MAJUNG_BASE_GAME
    menu_str[index] = STR_GX_MAJUNG_GAME_NAME;
    menu_img[index++] = IMG_GX_MAJUNG_GAME_ICON;
#endif /* IS_MAJUNG_BASE_GAME */ 

#ifdef IS_MEMORY_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_MEMORY_BASE_GAME */ 

#ifdef IS_COPTER_BASE_GAME
    /* copter */
#if defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__)
    menu_str[index] = STR_ID_GX_COPTER_GAME_NAME;

    /* sub */
#elif defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__)
    menu_str[index] = STR_ID_GX_COPTER_GAME_NAME_SUBMARINE;

    /* jet */
#elif defined(__MMI_GAME_JET_128x128__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
    menu_str[index] = STR_ID_GX_COPTER_GAME_NAME_JET;
#endif 

    menu_img[index++] = IMG_ID_GX_COPTER_GAME_ICON;

#endif /* IS_COPTER_BASE_GAME */ 

#ifdef IS_PUZZLE_BASE_GAME
    menu_str[index] = STR_ID_GX_PUZZLE_GAME_NAME;
    menu_img[index++] = IMG_ID_GX_PUZZLE_GAME_ICON;
#endif /* IS_PUZZLE_BASE_GAME */ 

#ifdef IS_PANDA_BASE_GAME
    /* panda */
#if defined(__MMI_GAME_PANDA_128x128__) || defined(__MMI_GAME_PANDA_128x160__) || defined(__MMI_GAME_PANDA_176x220__)
    menu_str[index] = STR_ID_GX_PANDA_GAME_NAME;

    /* monkey */
#elif defined(__MMI_GAME_MONKEY_128x128__) || defined(__MMI_GAME_MONKEY_128x160__) || defined(__MMI_GAME_MONKEY_176x220__)
    menu_str[index] = STR_ID_GX_PANDA_GAME_NAME_MONKEY;
#endif 

    menu_img[index++] = IMG_ID_GX_PANDA_GAME_ICON;

#endif /* IS_PANDA_BASE_GAME */ 

#ifdef IS_STAIR_BASE_GAME
/* under construction !*/
/* under construction !*/
#if defined(__MMI_GAME_CHICKEN_128x160__) || defined(__MMI_GAME_CHICKEN_128x128__)
/* under construction !*/
/* under construction !*/
/* under construction !*/
#elif defined(__MMI_GAME_ROBOT_176x220__) || defined(__MMI_GAME_ROBOT_128x160__)
/* under construction !*/
/* under construction !*/
#endif 
/* under construction !*/
/* under construction !*/
#endif /* IS_STAIR_BASE_GAME */ 

#ifdef IS_UFO_BASE_GAME
/* under construction !*/
/* under construction !*/
#if defined(__MMI_GAME_UFO_128x160__) || defined(__MMI_GAME_UFO_128x128__) || defined(__MMI_GAME_UFO_176x220__)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#elif defined(__MMI_GAME_AIRFORCE_128x160__) || defined(__MMI_GAME_AIRFORCE_128x128__)
/* under construction !*/
/* under construction !*/
#endif 
/* under construction !*/
#endif /* IS_UFO_BASE_GAME */ 

#ifdef IS_DANCE_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_DANCE_BASE_GAME */ 

#ifdef IS_MAGICSUSHI_BASE_GAME
    menu_str[index] = STR_ID_GX_MAGICSUSHI_GAME_NAME;
    menu_img[index++] = IMG_ID_GX_MAGICSUSHI_GAME_ICON;
#endif /* IS_MAGICSUSHI_BASE_GAME */ 

#ifdef IS_FRUIT_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_FRUIT_BASE_GAME */ 

#ifdef IS_VSMJ_BASE_GAME
/* under construction !*/
/* under construction !*/
#endif /* IS_VSMJ_BASE_GAME */ 

#ifdef __MMI_GAME_WUZHIQI__
    menu_str[index] = STR_ID_GAME_WUZHIQI;
    menu_img[index++] = IMG_ID_GAME_WUZHIQI;
#endif
    menu_str[index] = STR_ID_GAME_SETTING;
    menu_img[index++] = IMG_ID_GAME_SETTING;

    /* Set random seed */
    GetDateTime(&t);
    srand(t.nMin);

    //get current language , used for multi-language
#ifdef __MMI_GAME_MULTI_LANGUAGE_SUPPORT__
    g_mmi_game_current_language_index = mmi_gfx_get_current_language_index(); 
#endif
    
    EntryNewScreen(SCR_ID_GAME, NULL, mmi_game_entry_app_screen, NULL);

    guiBuffer = GetCurrGuiBuffer(SCR_ID_GAME);

    RegisterHighlightHandler(mmi_game_highlight_hdlr);

    ShowCategory15Screen(
        STR_GAME_CAPTION,
        MAIN_MENU_TITLE_FUNANDGAMES_ICON,
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_BACK,
        IMG_GLOBAL_BACK,
        index,
        menu_str,
        menu_img,
        1,
        0,
        guiBuffer);

    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
    SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW,KEY_EVENT_DOWN);

    /* load game settings */
    mmi_gfx_load_setting();
}


/*****************************************************************************
 * FUNCTION
 *  mmi_game_entry_setting_screen
 * DESCRIPTION
 *  entry point for game setting screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_game_entry_setting_screen(void)
{
#if defined(__MMI_GAME__)
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    U8 *guiBuffer;
    U8 *inputBuffer;
    U16 inputBufferSize;
    S32 item_offset = 0;

    MMI_ID_TYPE item_icons[] = 
    {
    #if defined(__MMI_GAME__)
    #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
        IMG_ID_GAME_SETTING_BACK_AUD,
        0,
        IMG_ID_GAME_SETTING_AUD,
        0,
    #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
        IMG_ID_GAME_SETTING_AUD,
        0,
    #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
        IMG_ID_GAME_SETTING_VIB,
        0,
    #endif /* defined(__MMI_GAME__) */ 
    };

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -