Esempio n. 1
0
File: main.c Progetto: Eaeth/myNCCL
int main()
{
	fb_info fb_inf;
	pid_t pid;
	pid_t mp3_id;

	if (init_frambuffer(&fb_inf) < 0){
		fprintf(stderr, "Error initial framebuffer\n");
		return 1;
	}

	filename_list();		//jpeg file txt

	pid = fork();
	if (pid == 0) start_mp3(fb_inf);
	mp3_id = pid;

	disp_background("../jpeg/welcome/background.jpg", fb_inf);
	disp_constellation("../jpeg/welcome/constellation.jpg", fb_inf);

	welcome_screen(fb_inf);

	if (mouse_operate(fb_inf, &mp3_id))
	{
		kill(mp3_id, SIGKILL);
		wait(NULL);
	}

	exit_screen(fb_inf);

	munmap(fb_inf.fbmem, fb_inf.w * fb_inf.h * fb_inf.bpp / 8);

	return 0;
}
void exit_alphabet_game(alphabet_game_t *alphabet_game)
{
	//printf("I'm %s() at %d in %s\n",__func__,__LINE__,__FILE__);
	alphabet_game_t *ag=alphabet_game;
	if(NULL==ag){
		return;
	}
	
	ctrl_tool_free(ag->child_status_help);	
	ctrl_tool_free(ag->child_status_start);
	ctrl_tool_free(ag->main_status);
	exit_screen(&ag->scr);
	
	free(ag);
	ag=NULL;
	
	return ;
}