static void finalize_level( void ) { /* set alpha keys to OPAQUE */ SDL_SetAlpha( paddle_pic, 0,0 ); SDL_SetAlpha( weapon_pic, 0,0 ); SDL_SetAlpha( extra_pic, 0,0 ); SDL_SetAlpha( ball_pic, 0,0 ); SDL_SetAlpha( shot_pic, 0,0 ); SDL_SetAlpha( display_font->surface, 0,0 ); /* reset ball graphic */ ball_pic_x_offset = 0; /* reset shrapnells */ shrapnells_reset(); /* reset shine */ shine_reset(); /* reset explosions */ exps_clear(); exps_set_dark( 0 ); /* delete offscreen */ stk_surface_free( &offscreen ); /* clear credits */ credit_clear(); /* clear displays */ displays_clear(); /* clear game contexts */ if ( game->game_type == GT_LOCAL ) game_finalize( local_game ); game_finalize( game ); }
/* a player won the game */ TEG_STATUS clitok_winner( char *str ) { PARSER p; DELIM igualador={ ':', ':', ':' }; DELIM separador={ ',', ',', ',' }; int numjug; int mission; PCPLAYER pJ; p.igualador = &igualador; p.separador = &separador; p.data = str; if( strlen(str)==0 ) goto error; if( parser_call( &p ) && p.hay_otro ) { numjug = atoi( p.token ); } else goto error; if( parser_call( &p ) && !p.hay_otro ) { mission = atoi( p.token ); } else goto error; if( player_whois( numjug, &pJ) != TEG_STATUS_SUCCESS) goto error; if( mission == -1 ) mission = 0; if( mission < 0 || mission >= missions_cant() ) goto error; textmsg( M_IMP,_("Player %s(%s) is the WINNER"), pJ->name, _(g_colores[pJ->color]) ); gui_winner( pJ->numjug, mission ); ESTADO_SET( PLAYER_STATUS_HABILITADO ); gui_sensi(); game_finalize(); return TEG_STATUS_SUCCESS; error: textmsg(M_ERR,"Error in clitok_winner()"); return TEG_STATUS_ERROR; }