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

📄 games_help.c

📁 几个嵌入式手机平台小游戏c源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
#ifdef __cplusplus
extern "C" {
#endif
/*==================================================================================================

    MODULE NAME : module-filename.c

    GENERAL DESCRIPTION
        General description of this grouping of functions.

    TECHFAITH Telecom Confidential Proprietary
    (c) Copyright 2002 by TECHFAITH Telecom Corp. All Rights Reserved.
====================================================================================================

    Revision History
   
    Modification                  Tracking
    Date         Author           Number      Description of changes
    ----------   --------------   ---------   -----------------------------------------------------------------------------------
    MM/DD/YYYY   name of author   crxxxxx     Brief description of changes made

    03/13/2003   Steven Lai       PP00159     Removed some useless code

    05/27/2003   Chenyu           P000436     Fix sublcd & game display
    03-06-3      Chenyu           P00502      Fix game tetris
    03-06-24     Chenyu           P00666      Fix bugs of games
                                                - 1.in game cargador, missed call will stop animation.
                                                - 2.in game help incoming missed call, softkey display wrong.
                                                - 3.it can't exit highscroe by press "Back"
                                                - 4.it can't back exit game by press "CLR"

    07/02/2003   Steven Lai       C000662     Add a sound-switch for Games App
                                              replace all the App_change_state() with Games_change_state()
                                              fixed some bugs
    10/16/2003   Chenxiao         P001823     delete RUI in help entry in amazon project
    02/24/2004   lixingbo         p002467     Modify the game for dolphin.
    03/16/2004   Steven li        c002661     change menu item structure to support diable menu item .      
    04/16/2004   caoyanqing       c003008     add the corresponding part of fruit_game app.
    06/182004    lixingbo         p006238     Modify some bugs for lotus about help.
    08/02/2004   Steven Lai       p007452     Optimize some code; Remove some useless image resource

    Self-documenting Code
    Describe/explain low-level design of this module and/or group of funtions and/or specific
    funtion that are hard to understand by reading code and thus requires detail description.
    Free format !
        
====================================================================================================
    INCLUDE FILES
==================================================================================================*/
#include <stdlib.h>

#include "APP_include.h"

#include "MENU_main.h"
#include "MENU_display.h"
#include "MENU_item.h"

#include "uhapi.h"

#include "GAMES_main.h"
#include "Easy_Text_Viewer.h"

/*==================================================================================================
    LOCAL FUNCTION PROTOTYPES
==================================================================================================*/
void Games_Help_entry(void);
void Games_Help_exit(void);
void Games_Help_Handler
( 
    OPUS_EVENT_ENUM_TYPE   event,
    void                   *pMess, 
    OP_BOOLEAN             *handle
);
static void Games_Help_view_handler ( OPUS_EVENT_ENUM_TYPE   event, 
                                 void                   *pMess, 
                                 OP_BOOLEAN             *handle );

static void Games_Help_Menu_Handler
( 
    OPUS_EVENT_ENUM_TYPE   event,
    void                   *pMess, 
    OP_BOOLEAN             *handle
);
static void Games_Help_Process
(
    OP_UINT8   select_item
);
static void Games_Help_keymap_display(void);
static void Games_Help_Init(void);
static void Games_Help_view_entry(void);
static void Games_Help_view_Init(void);
static void Games_Help_Cargador_keymap(void);
static void Games_Help_Gopher_keymap(void);
static void Games_Help_Huarong_keymap(void);
static void Games_Help_Lightup_keymap(void);
static void Games_Help_keymap_handler
( 
    OPUS_EVENT_ENUM_TYPE   event, 
    void                   *pMess, 
    OP_BOOLEAN             *handle 
);

void Games_Help_draw_text 
(
    OP_INT16           x,
    OP_INT16           y,
    OP_INT16           xlimit,
    OP_UINT8           *text,
    DS_FONTATTR        fontattr,
    DS_COLOR           fontcolor,
    DS_COLOR           backcolor
);

void Games_Help_draw_text_rm 
(
    OP_INT16           x,
    OP_INT16           y,
    OP_INT16           xlimit,
    RM_RESOURCE_ID_T    res_id,
    DS_FONTATTR        fontattr,
    DS_COLOR           fontcolor,
    DS_COLOR           backcolor
);


/*==================================================================================================
    LOCAL CONSTANTS
==================================================================================================*/

/*==================================================================================================
    LOCAL TYPEDEFS - Structure, Union, Enumerations...etc
==================================================================================================*/

/*
 * description of this structure, if needed. - Remember self documenting code
 */
MENU_ITEM_STRUCTURE_NAME_T const games_help_menu[] =
{
  { PMPT_LIST_GAME_GUIDE,  NULL_ICON,  OP_FALSE,  OP_NULL, OP_NULL,    OP_NULL},
};
 
MENU_TIER_STRUCTURE_NAME_T games_help_menu_tier =
{
  PMPT_TITLE_GAMES, 
  TITLE_NORMAL,
  MA_NUMBER,
  0,
  (void *)games_help_menu,
  (sizeof(games_help_menu) /
  sizeof(MENU_ITEM_STRUCTURE_NAME_T))
};

typedef enum
{
    MENU,
    GAME_GUIDE,
}HELP_STATUS; 


/*==================================================================================================
    LOCAL MACROS
==================================================================================================*/
/*
 * description of this macro, if needed. - Remember self documenting code
 */

/*==================================================================================================
    LOCAL VARIABLES
==================================================================================================*/
static HELP_STATUS status;
static MENU_SELECT_PARAMS   help_menu_para;
static MENU_TIER_STRUCTURE_NAME_T   *help_menu;
static OP_UINT8  select_item;

/*
 * Current viewer handle
 */
static HETV        hETV = OP_NULL;
RM_RESOURCE_ID_T    title_id;
RM_RESOURCE_ID_T    message_id;

static OP_UINT8 *text_str;

/*==================================================================================================
    GLOBAL VARIABLES
==================================================================================================*/
extern APP_GAMES_STRUCTURE_NAME_T   gamesApp_data;
extern APP_SUBSTATE_STRUCTURE_NAME_T games_substate;



/*==================================================================================================
    LOCAL FUNCTIONS
==================================================================================================*/

/*==================================================================================================
    FUNCTION: Games_Game_help_entry

    DESCRIPTION:
        Description of this specific function.

    ARGUMENTS PASSED:

    RETURN VALUE:

    IMPORTANT NOTES:
        
==================================================================================================*/
void Games_Help_entry(void)
{
    switch (gamesApp_data.game_id)
    {
#ifdef GAMES_CARGADOR
        case APP_GAMES_CARGADOR :   /* if having define the keymap guide, display a menu */
            status = GAME_GUIDE;
            title_id=PMPT_LIST_CARGADOR;
            message_id=PMPT_TEXT_CARGADOR_HELP;
            Games_Help_view_entry();
            break;
#endif
#ifdef GAMES_FALLBALL
        case APP_GAMES_FALLBALL :
            status = GAME_GUIDE;
            title_id=PMPT_LIST_GOPHERS;
            message_id=PMPT_TEXT_GOPHER_HELP;
            Games_Help_view_entry();
            break;
#endif

#ifdef GAMES_HUARONG
        case APP_GAMES_HUARONG:   /* having not define the keymap guide, enter game guide directly */
            status = GAME_GUIDE;
            title_id=PMPT_LIST_HUARONG;
            message_id=PMPT_TEXT_HUARONG_HELP;
            Games_Help_view_entry();
            break;
#endif

#ifdef GAMES_LIGHTUP
        case APP_GAMES_LIGHTUP:   /* having not define the keymap guide, enter game guide directly */
            status = GAME_GUIDE;
            title_id=PMPT_LIST_LIGHTUP;
            message_id=PMPT_TEXT_LIGHTUP_HELP;
            Games_Help_view_entry();
            break;
#endif

#ifdef GAMES_GOPHER
        case APP_GAMES_GOPHER:   /* having not define the keymap guide, enter game guide directly */
            status = GAME_GUIDE;
            title_id=PMPT_LIST_STARWAR;
            message_id=PMPT_TEXT_STARWAR_HELP;
            Games_Help_view_entry();
            break;
#endif

#ifdef GAMES_TETRIS

       case APP_GAMES_TETRIS:
            status = GAME_GUIDE;
            title_id=PMPT_LIST_TETRIS;
            message_id=    PMPT_TEXT_TETRIS_HELP;
            Games_Help_view_entry();

           
            break;
#endif

#ifdef GAMES_FRUIT
        case APP_GAMES_FRUIT:   /* fruit*/
            status = GAME_GUIDE;
            title_id=PMPT_LIST_FRUIT;
            message_id=PMPT_LIST_FRUIT_HELP;
            Games_Help_view_entry();
            break;
#endif
        default:
            break;
    }

}

/*==================================================================================================
    FUNCTION: Games_Help_exit

    DESCRIPTION:
        Description of this specific function.

    ARGUMENTS PASSED:

    RETURN VALUE:

    IMPORTANT NOTES:
        
==================================================================================================*/
void Games_Help_exit(void)
{
  if(text_str!=OP_NULL)
    op_free(text_str);
}

/*==================================================================================================
    FUNCTION: Games_Help_Handler

    DESCRIPTION:

    ARGUMENTS PASSED:

    RETURN VALUE:

    IMPORTANT NOTES:
==================================================================================================*/
void Games_Help_Handler
( 
    OPUS_EVENT_ENUM_TYPE   event,
    void                   *pMess, 
    OP_BOOLEAN             *handle
)
{
    switch(status)
    {
        case MENU:
            Games_Help_Menu_Handler( event, pMess, handle);
            break;


        case GAME_GUIDE:
            Games_Help_view_handler( event, pMess, handle);
            break;
    }
}


/*==================================================================================================
    FUNCTION: Games_Help_Init

    DESCRIPTION:

⌨️ 快捷键说明

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