void tab_select_effect_bHandle(void* opaque, GEventGWinButton* event){ struct tab_select_effect_t *tmp = (struct tab_select_effect_t*)opaque; uint32_t i; for(i = 0; i < EFFECT_NUM; i++){ if ((event)->gwin == tmp->btn_effectTypes[i]){ attachEffect(selectedEffectStage, i); SwitchTab(PARAM_TAB); } } if ((event)->gwin == tmp->btn_back){ SwitchTab(PARAM_TAB); } return; }
/* ===================== pushEffect ===================== */ void pushEffect( effectType_t type, place_t place ) { game_t *game = NULL; effect_t eff; effectList_t *effListNode; effectList_t *tmp1, *tmp2; effListNode = tmp1 = tmp2 = NULL; //check effect type validity if( type >= EFFLIST_SIZE ) { return; } //determine game switch( place ) { case LEFTGAME: game = k_system.pLeftGame; break; case RIGHTGAME: game = k_system.pRightGame; break; default: return; } //check game validity if( game == NULL ) { return; } //remove previous illumination effect, //so that it doesn't interfere with the current one. // //FIXME: isn't there a better approach ? // if( type == EFFECT_GROUND_ILLUMINATE ) { tmp1 = game->effectList; while( tmp1 ) { tmp2 = tmp1->pNext; if( tmp1->effect.type == type ) { popTimeSlice( tmp1->effect.guid ); } tmp1 = tmp2; } } N_Memset( &eff, 0, sizeof( eff ) ); eff.type = type; eff.place = place; eff.init = FALSE; eff.bEnded = FALSE; effListNode = attachEffect( &eff ); effListNode->effect.guid = pushTimeSlice( TIME_EFFECT, kEffects[type].interval, kEffects[type].ttl, effListNode, EFFECT, TRUE ); }