GameFramework.h
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:28k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36. *
  37.  * Filename:
  38.  * ---------
  39.  *  GameFramework.h
  40.   *
  41.  * Project:
  42.  * --------
  43.  *  MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *  Game framework header file.
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  *------------------------------------------------------------------------------
  96.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  97.  *============================================================================
  98.  ****************************************************************************/
  99. #ifndef __GAME_FRAMEWORK__
  100. #define __GAME_FRAMEWORK__
  101. #include "GameDefs.h"   /* include GAME_BASE id */
  102. /****************************************************************************
  103. * Define                                                              
  104. *****************************************************************************/
  105. #define GFX                      (g_gfx_cntx)
  106. #define GFX_MAX_LEVEL_COUNT      (5)
  107. #define GFX_MAX_MENU_ITEM_COUNT  (9)
  108. #define GFX_MAX_TYPE_COUNT   (2)     //KP Jerry on 2007-3-23
  109. #define GFX_AUDIO_GAMEOVER       (862)
  110. #define GFX_AUDIO_COMPLETE       (310)
  111. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  112. #define GFX_AUDIO_DUMMYBACKGROUND_MIDI  (94)
  113. #endif 
  114. /****************************************************************************
  115. * Struct / Typedef                                                                 
  116. *****************************************************************************/
  117. /* Screen ID */
  118. typedef enum
  119. {
  120.     GFX_MENU_SCREEN = GAME_FRAMEWORK + 1,
  121.     GFX_GAME_SCREEN,
  122.     GFX_LEVEL_SCREEN,
  123.     GFX_TYPE_SCREEN,     //KP Jerry add on 2007-3-23
  124.     GFX_GRADE_SCREEN,
  125.     GFX_HELP_SCREEN,
  126.     GFX_GAMEOVER_SCREEN
  127. } mmi_gfx_scr_id;
  128. typedef struct
  129. {
  130.     /* Game menu */
  131.     U16 game_img_id;        /* game icon img ID */
  132.     U16 game_str_id;        /* game name string ID */
  133.     U16 menu_resume_str_id; /* resume game string ID [OPTIONAL] */
  134.     U16 menu_new_str_id;    /* new game string ID    [REQUIRED] */
  135.     U16 menu_level_str_id;  /* game level string ID  [OPTIONAL] */
  136.     U16 menu_grade_str_id;  /* best grade string ID  [OPTIONAL] */
  137.     U16 menu_help_str_id;   /* help string ID     [OPTIONAL] */
  138.     /* level / grade */
  139.     U8 level_count;                                 /* how many levels */
  140.     U16 level_str_id_list[GFX_MAX_LEVEL_COUNT];     /* level string ID */
  141.     U16 grade_nvram_id_list[GFX_MAX_LEVEL_COUNT];   /* grade slot in NVRAM */
  142.     U8 level_nvram_id;                              /* current lvl idnex stored in NVRAM */
  143.     /* help */
  144.     U16 help_str_id;    /* help description string id */
  145.     /* misc */
  146.     S16 *grade_value_ptr;   /* ptr to current level's grade */
  147.     U8 *level_index_ptr;    /* ptr to current level index */
  148.     BOOL *is_new_game;      /* ptr to new game flag */
  149.     /* function ptr */
  150.       S16(*best_grade_func_ptr) (S16 old_grade, S16 new_grade); /* function to calculate best grade */
  151.     void (*enter_game_func_ptr) (void);     /* function to enter game */
  152.     void (*exit_game_func_ptr) (void);      /* function to exit game */
  153.     void (*draw_gameover_func_ptr) (void);  /* function to draw gameover screen */
  154.     /* some flags */
  155.     BOOL is_keypad_audio_enable;    /* play keypad tone or not */
  156. //KP Jerry add for vsmj type on 2007-03-21 start
  157.     U16 menu_type_str_id;  /* game level string ID  [OPTIONAL] */
  158.     U8 type_count;                                 /* how many types */
  159.     U16 type_str_id_list[GFX_MAX_TYPE_COUNT];     /* tYPE  string ID */
  160.     U8 *type_index_ptr;    /* ptr to current type index */
  161.     U8 type_nvram_id;                              /* current lvl idnex stored in NVRAM */
  162. //KP Jerry add for vsmj type on 2007-03-21 end
  163. } mmi_gfx_game_data_struct;
  164. typedef struct
  165. {
  166.     mmi_gfx_game_data_struct game_data;
  167.     BOOL is_vib_on;
  168. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  169.     BOOL is_background_music_on;
  170.     BOOL is_sound_effect_on;
  171. #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  172.     BOOL is_aud_on;
  173. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  174.     U8 aud_volume;
  175.     BOOL is_level_changed;
  176.     BOOL is_gameover;
  177.     BOOL is_first_time_enter_gameover;
  178.     BOOL is_resume_game;
  179.     S32 hilight_index;
  180.     BOOL is_type_changed;     //KP Jerry add on 2007-3-23
  181. } mmi_gfx_cntx_struct;
  182. /****************************************************************************
  183. * Global Variable
  184. *****************************************************************************/
  185. extern mmi_gfx_cntx_struct g_gfx_cntx;
  186. extern __align(2)
  187.      const U8 g_gfx_audio_gameover[862];
  188.      extern __align(2)
  189.      const U8 g_gfx_audio_complete[310];
  190. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  191.      extern S32 dummy_background_midi;  /* /for dummy background */
  192.      extern __align(2)
  193.      const U8 g_gfx_Dummy_background_midi[94];
  194. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  195. /****************************************************************************
  196. * Global Function
  197. *****************************************************************************/
  198.      extern void mmi_gfx_entry_menu_screen(void);       /* called by Game.c to enter game menu */
  199.      extern void mmi_gfx_entry_gameover_screen(void);   /* called by each game to enter gameover screen */
  200.      extern void mmi_gfx_draw_gameover_screen(U16 text_img_id, U16 box_img_id, U16 pic_img_id, S32 score);
  201.      extern void mmi_gfx_store_setting(void);
  202.      extern void mmi_gfx_load_setting(void);
  203.      extern BOOL mmi_gfx_is_aud_on(void);
  204.      extern BOOL mmi_gfx_is_vib_on(void);
  205.      extern U8 mmi_gfx_get_audio_vol(void);
  206.      extern void mmi_gfx_volume_up(void);
  207.      extern void mmi_gfx_volume_down(void);
  208. #ifndef __MMI_GAME_MULTICHANNEL_SOUND__
  209. /****************************************************************************
  210. * MACRO
  211. *****************************************************************************/
  212. #define GFX_PLAY_AUDIO_DVI(raw_data, size, play_style)                     
  213. do{                                                                        
  214.    if(GFX.is_aud_on && GFX.is_first_time_enter_gameover)                   
  215.    {                                                                       
  216.       mdi_audio_play_string_with_vol_path_non_block(  (void*)raw_data,     
  217.                                                       (U32)size,           
  218.                                                       MDI_FORMAT_DVI_ADPCM,
  219.                                                       play_style,          
  220.                                                       NULL,                
  221.                                                       NULL,                
  222.                                                       GFX.aud_volume,      
  223.                                                       MDI_DEVICE_SPEAKER2);
  224.    }                                                                       
  225. }while(0)
  226. #define GFX_PLAY_AUDIO_WAV(raw_data, size, play_style)                     
  227. do{                                                                        
  228.    if(GFX.is_aud_on && GFX.is_first_time_enter_gameover)                   
  229.    {                                                                       
  230.       mdi_audio_play_string_with_vol_path_non_block(  (void*)raw_data,     
  231.                                                       (U32)size,           
  232.                                                       MDI_FORMAT_WAV,      
  233.                                                       play_style,          
  234.                                                       NULL,                
  235.                                                       NULL,                
  236.                                                       GFX.aud_volume,      
  237.                                                       MDI_DEVICE_SPEAKER2);
  238.    }                                                                       
  239. }while(0)
  240. #define GFX_PLAY_AUDIO_MIDI(raw_data, size, play_style)                    
  241. do{                                                                        
  242.    if(GFX.is_aud_on && GFX.is_first_time_enter_gameover)                   
  243.    {                                                                       
  244.       mdi_audio_play_string_with_vol_path_non_block(  (void*)raw_data,     
  245.                                                       (U32)size,           
  246.                                                       MDI_FORMAT_SMF,      
  247.                                                       play_style,          
  248.                                                       NULL,                
  249.                                                       NULL,                
  250.                                                       GFX.aud_volume,      
  251.                                                       MDI_DEVICE_SPEAKER2);
  252.    }                                                                       
  253. }while(0)
  254. #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  255. /****************************************************************************
  256. * MACRO
  257. *****************************************************************************/
  258. #define GFX_PLAY_AUDIO_DVI(raw_data, size, play_style)                     
  259. do{                                                                        
  260.    if(GFX.is_first_time_enter_gameover)                                    
  261.    {                                                                       
  262.       mdi_audio_play_string_with_vol_path_non_block(  (void*)raw_data,     
  263.                                                       (U32)size,           
  264.                                                       MDI_FORMAT_DVI_ADPCM,
  265.                                                       play_style,          
  266.                                                       NULL,                
  267.                                                       NULL,                
  268.                                                       GFX.aud_volume,      
  269.                                                       MDI_DEVICE_SPEAKER2);
  270.    }                                                                       
  271. }while(0)
  272. #define GFX_PLAY_AUDIO_WAV(raw_data, size, play_style)                     
  273. do{                                                                        
  274.    if(GFX.is_first_time_enter_gameover)                                    
  275.    {                                                                       
  276.       mdi_audio_play_string_with_vol_path_non_block(  (void*)raw_data,     
  277.                                                       (U32)size,           
  278.                                                       MDI_FORMAT_WAV,      
  279.                                                       play_style,          
  280.                                                       NULL,                
  281.                                                       NULL,                
  282.                                                       GFX.aud_volume,      
  283.                                                       MDI_DEVICE_SPEAKER2);
  284.    }                                                                       
  285. }while(0)
  286. #define GFX_PLAY_AUDIO_MIDI(raw_data, size, play_style)                    
  287. do{                                                                        
  288.    if(GFX.is_first_time_enter_gameover)                                    
  289.    {                                                                       
  290.       mdi_audio_play_string_with_vol_path_non_block(  (void*)raw_data,     
  291.                                                       (U32)size,           
  292.                                                       MDI_FORMAT_SMF,      
  293.                                                       play_style,          
  294.                                                       NULL,                
  295.                                                       NULL,                
  296.                                                       GFX.aud_volume,      
  297.                                                       MDI_DEVICE_SPEAKER2);
  298.    }                                                                       
  299. }while(0)
  300. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ /* /__MMI_GAME_MULTICHANNEL_SOUND__ */
  301. #define GFX_PLAY_VIBRATION()                            
  302. do{                                                     
  303.    if(GFX.is_vib_on && GFX.is_first_time_enter_gameover)
  304.    {                                                    
  305.       PlayVibratorOnce();                               
  306.    }                                                    
  307. }while(0)
  308. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  309. #define GFX_PLAY_AUDIO_GAMEOVER()                                                        
  310. do{                                                                                      
  311.    if(GFX.is_background_music_on==TRUE)                                                  
  312.    GFX_PLAY_AUDIO_MIDI(g_gfx_audio_gameover, GFX_AUDIO_GAMEOVER, DEVICE_AUDIO_PLAY_ONCE);
  313. }while(0)
  314. #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ /* /__MMI_GAME_MULTICHANNEL_SOUND__ */
  315. #define GFX_PLAY_AUDIO_GAMEOVER()                                                        
  316. do{                                                                                      
  317.    GFX_PLAY_AUDIO_MIDI(g_gfx_audio_gameover, GFX_AUDIO_GAMEOVER, DEVICE_AUDIO_PLAY_ONCE);
  318. }while(0)
  319. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ /* /__MMI_GAME_MULTICHANNEL_SOUND__ */
  320. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  321. #define GFX_PLAY_AUDIO_COMPLETE()                                                     
  322.    do{                                                                                   
  323.    if(GFX.is_background_music_on==TRUE)                                                  
  324.    GFX_PLAY_AUDIO_MIDI(g_gfx_audio_complete, GFX_AUDIO_COMPLETE, DEVICE_AUDIO_PLAY_ONCE);
  325.    }while(0)
  326. #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  327. #define GFX_PLAY_AUDIO_COMPLETE()                                                        
  328.    do{                                                                                   
  329.    if(GFX.is_aud_on==TRUE)                                                               
  330.    GFX_PLAY_AUDIO_MIDI(g_gfx_audio_complete, GFX_AUDIO_COMPLETE, DEVICE_AUDIO_PLAY_ONCE);
  331.    }while(0)
  332. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  333. /******************************************************************************************/
  334. /* *************MULTICHANNEL SOUND APIS BASED MACROS *************************************
  335.  *******************************************************************************************
  336.  ******************************************************************************************/
  337. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  338.    /* midi files are to be used both for background and sound effects */
  339. /* MIDI OPEN-depending upon handleno paramter handle##handleno will be created */
  340. #define GFX_OPEN_MULTICHANNEL_MIDI(raw_data, size, repeats,handleno)            
  341.    do{                                                                          
  342.       if( (GFX.is_background_music_on==TRUE) || (GFX.is_sound_effect_on==TRUE) )
  343.       {                                                                         
  344.       handleno=mdi_audio_mma_open_midi((void*) raw_data,                        
  345.                                       (U32)size,                                
  346.                                       repeats,                                  
  347.                                       NULL);                                    
  348.       }                                                                         
  349.    }while(0)
  350. /* MIDI PLAY */
  351. #define GFX_PLAY_MULTICHANNEL_MIDI(handle)                                                       
  352.       do{                                                                                        
  353.       if( ((GFX.is_background_music_on==TRUE) || (GFX.is_sound_effect_on==TRUE)) && (handle!= 0))
  354.       {                                                                                          
  355.          mdi_audio_set_headset_mode_output_path(MDI_DEVICE_SPEAKER2);                            
  356.          mdi_audio_set_volume(VOL_TYPE_MEDIA,GFX.aud_volume);                                    
  357.          mdi_audio_mma_play_midi( handle);                                                       
  358.       }                                                                                          
  359.    }while(0)
  360. /* MIDI STOP */
  361. #define GFX_STOP_MULTICHANNEL_MIDI(handle)                                                       
  362.       do{                                                                                        
  363.       if( ((GFX.is_background_music_on==TRUE) || (GFX.is_sound_effect_on==TRUE)) && (handle!= 0))
  364.       {                                                                                          
  365.          mdi_audio_mma_stop_midi( handle);                                                       
  366.       }                                                                                          
  367.    }while(0)
  368. /* MIDI CLOSE */
  369. #define GFX_CLOSE_MULTICHANNEL_MIDI(handle)                                                      
  370.       do{                                                                                        
  371.       if( ((GFX.is_background_music_on==TRUE) || (GFX.is_sound_effect_on==TRUE))&& (handle!= 0) )
  372.       {                                                                                          
  373.          mdi_audio_mma_close_midi( handle);                                                      
  374.       }                                                                                          
  375.    }while(0)
  376.    /* waves files are to be used for sound effects */
  377. /* WAV OPEN-depending upon handleno paramter handle##handleno will be created */
  378. #define GFX_OPEN_MULTICHANNEL_WAV(raw_data, size, repeats,handleno) 
  379.       do{                                                           
  380.       if(GFX.is_sound_effect_on)                                    
  381.       {                                                             
  382.       handleno=mdi_audio_mma_open_wav((void*) raw_data,             
  383.                                       (U32)size,                    
  384.                                       repeats,                      
  385.                                       NULL);                        
  386.        }                                                            
  387.    }while(0)
  388. /* WAV PLAY */
  389. #define GFX_PLAY_MULTICHANNEL_WAV(handle) 
  390.       do{                                 
  391.       if(GFX.is_sound_effect_on)          
  392.       {                                   
  393.          mdi_audio_set_headset_mode_output_path(MDI_DEVICE_SPEAKER2);
  394.          mdi_audio_set_volume(VOL_TYPE_MEDIA,GFX.aud_volume);      
  395.          mdi_audio_mma_play_wav( handle); 
  396.       }                                   
  397.    }while(0)
  398. /* WAV STOP */
  399. #define GFX_STOP_MULTICHANNEL_WAV(handle)     
  400.       do{                                     
  401.       if(GFX.is_sound_effect_on && handle!= 0)
  402.       {                                       
  403.          mdi_audio_mma_stop_wav( handle);     
  404.       }                                       
  405.    }while(0)
  406. /* WAV CLOSE */
  407. #define GFX_CLOSE_MULTICHANNEL_WAV(handle)    
  408.    do{                                        
  409.       if(GFX.is_sound_effect_on && handle!= 0)
  410.       {                                       
  411.          mdi_audio_mma_close_wav( handle);    
  412.       }                                       
  413.    }while(0)
  414. #define GFX_OPEN_BACKGROUND_SOUND(raw_data, size, handleno)       
  415.       do {                                                        
  416.          if(GFX.is_background_music_on != FALSE)                  
  417.          {                                                        
  418.             GFX_OPEN_MULTICHANNEL_MIDI(raw_data,size,0,handleno); 
  419.          }                                                        
  420.       }while(0)
  421. #define GFX_PLAY_BACKGROUND_SOUND(handle)    
  422.    do{                                       
  423.       if(GFX.is_background_music_on !=FALSE) 
  424.       {                                      
  425.          GFX_PLAY_MULTICHANNEL_MIDI(handle); 
  426.       }                                      
  427.    }while(0)
  428. #define GFX_STOP_BACKGROUND_SOUND(handle)                   
  429.    do{                                                      
  430.       if(GFX.is_background_music_on !=FALSE && handle!= 0)  
  431.       {                                                     
  432.          GFX_STOP_MULTICHANNEL_MIDI(handle);                
  433.       }                                                     
  434.    }while(0)
  435. #define GFX_CLOSE_BACKGROUND_SOUND(handle)                
  436.    do{                                                    
  437.       if(GFX.is_background_music_on !=FALSE && handle!= 0)
  438.       {                                                   
  439.          GFX_CLOSE_MULTICHANNEL_MIDI(handle);             
  440.       }                                                   
  441.    }while(0)
  442. /* when midi is used for sound effects */
  443. #define GFX_OPEN_SOUND_EFFECTS_MIDI(raw_data, size, repeats,handleno)   
  444.       do {                                                              
  445.          if(GFX.is_sound_effect_on != FALSE)                            
  446.          {                                                              
  447.             GFX_OPEN_MULTICHANNEL_MIDI(raw_data,size,repeats,handleno); 
  448.          }                                                              
  449.       }while(0)
  450. #define GFX_PLAY_SOUND_EFFECTS_MIDI(handle)  
  451.    do{                                       
  452.       if(GFX.is_sound_effect_on !=FALSE)     
  453.       {                                      
  454.          GFX_PLAY_MULTICHANNEL_MIDI(handle); 
  455.       }                                      
  456.    }while(0)
  457. #define GFX_STOP_SOUND_EFFECTS_MIDI(handle)              
  458.    do{                                                   
  459.       if(GFX.is_sound_effect_on !=FALSE && handle!= 0)   
  460.       {                                                  
  461.          GFX_STOP_MULTICHANNEL_MIDI(handle);             
  462.       }                                                  
  463.    }while(0)
  464. #define GFX_CLOSE_SOUND_EFFECTS_MIDI(handle)          
  465.    do{                                                
  466.       if(GFX.is_sound_effect_on !=FALSE && handle!= 0)
  467.       {                                               
  468.          GFX_CLOSE_MULTICHANNEL_MIDI(handle);         
  469.       }                                               
  470.    }while(0)
  471. /* when midi is used for silent sound(dummy) midi */
  472. #define GFX_OPEN_DUMMY_BACKGROUND_SOUND()                                                                                     
  473.       do {                                                                                                                    
  474.          if(GFX.is_background_music_on == FALSE  &&  GFX.is_sound_effect_on==TRUE)                                            
  475.          {                                                                                                                    
  476.             GFX_OPEN_MULTICHANNEL_MIDI(g_gfx_Dummy_background_midi,GFX_AUDIO_DUMMYBACKGROUND_MIDI,0,dummy_background_midi);   
  477.          }                                                                                                                    
  478.       }while(0)
  479. #define GFX_PLAY_DUMMY_BACKGROUND_SOUND()                                        
  480.    do{                                                                           
  481.       if(GFX.is_background_music_on == FALSE  &&  GFX.is_sound_effect_on==TRUE)  
  482.       {                                                                          
  483.          GFX_PLAY_MULTICHANNEL_MIDI(dummy_background_midi);                      
  484.       }                                                                          
  485.    }while(0)
  486. #define GFX_STOP_DUMMY_BACKGROUND_SOUND()                                        
  487.    do{                                                                           
  488.       if(GFX.is_background_music_on == FALSE  &&  GFX.is_sound_effect_on==TRUE)  
  489.       {                                                                          
  490.          GFX_STOP_MULTICHANNEL_MIDI(dummy_background_midi);                      
  491.       }                                                                          
  492.    }while(0)
  493. #define GFX_CLOSE_DUMMY_BACKGROUND_SOUND()                                       
  494.    do{                                                                           
  495.       if(GFX.is_background_music_on == FALSE  &&  GFX.is_sound_effect_on==TRUE)  
  496.       {                                                                          
  497.          GFX_CLOSE_MULTICHANNEL_MIDI(dummy_background_midi);                     
  498.       }                                                                          
  499.    }while(0)
  500. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  501. #endif /* __GAME_FRAMEWORK__ */