コード例 #1
0
ファイル: main-gtk.cpp プロジェクト: bowkenken/lnl
gint	handle_map_draw( gpointer p )
{
	static long	flagDrawing = false;

	if( flagDrawing )
		return TRUE;
	flagDrawing = true;
	gui_begin();

	gJoystick.checkEvent();

	if( get_scene() == SCENE_N_LAST_BOSS ){
		if( !gPcgDun.drawLastBoss() ){
			gui_end();
			flagDrawing = false;
			return TRUE;
		}
	} else if( chk_scene_group( SCENE_GROUP_N_TITLE ) ){
		gPcgDun.drawTitle();
	} else if( chk_scene_group( SCENE_GROUP_N_ENDING ) ){
		gPcgDun.drawEnding();
	} else if( chk_scene_group( SCENE_GROUP_N_GAME_OVER ) ){
		gPcgDun.drawGameOver();
#if	0
	} else if( chk_scene_group( SCENE_GROUP_N_SEL_GRAPH ) ){
		if( gSelMbrGraph != NULL )
			gSelMbrGraph->redraw();
#endif
	} else {
		gui_end();
		flagDrawing = false;
		return TRUE;
	}

	GtkWidget *drawingArea = (GtkWidget *)p;
	GdkRectangle rect;
	rect.x = 0;
	rect.y = 0;
	rect.width = drawingArea->allocation.width;
	rect.height = drawingArea->allocation.height;
	gtk_widget_draw( GTK_WIDGET( drawingArea ), &rect );

	gui_end();
	flagDrawing = false;
	return TRUE;
}
コード例 #2
0
void main_end(void)
{
#ifndef __APPLE__
	gpuinfo_end();
#endif
//	voxel_end();
	ocl_end();
	gui_end();
	http_end();
}
コード例 #3
0
ファイル: menu.c プロジェクト: ionbladez/ohboy-zipit
int launcher(){;

	char *rom = 0;
	char *dir = rc_getstr("romdir");
	char version_str[80];
    
    snprintf(version_str, sizeof(version_str)-1, "gnuboy %s", VERSION);

	gui_begin();

launcher:
	dialog_begin("OhBoy http://ohboy.googlecode.com/", version_str);
	dialog_text("Load ROM",NULL,FIELD_SELECTABLE);
	dialog_text("Options",NULL,FIELD_SELECTABLE);
	dialog_text("Controls",NULL,FIELD_SELECTABLE);
	dialog_text("About",NULL,FIELD_SELECTABLE);
	dialog_text("Quit","",FIELD_SELECTABLE);

#ifdef DINGOO_NATIVE
	dialog_text(NULL, NULL, 0); /* blank line */
	dialog_text("Menu:", NULL, 0);
	dialog_text(" Slide Power", NULL, 0);
#endif /* DINGOO_NATIVE */

	switch(dialog_end()){
		case 1:
			rom = menu_requestfile(NULL,"Select Rom",dir,"gb;gbc;zip");
			if(!rom) goto launcher;
			break;
		case 2:
			if(!menu_options()) goto launcher;
			break;
		case 3:
			if(!menu_controls()) goto launcher;
			break;
		case 4:
			if(!menu_about()) goto launcher;
			break;
		case 5:
			SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
			SDL_Quit();
			exit(0);
		default:
			goto launcher;
	}

	gui_end();

	return rom;
}
コード例 #4
0
ファイル: kernel.c プロジェクト: Jille/karel-cli
int
main(int argc, char **argv) {
	kareltje.x = 1;
	kareltje.y = MAP_HEIGHT / 2;
	kareltje.dir = OOST;
#ifdef __FreeBSD__
	srandomdev();
#else
	srandom(time(NULL) ^ getpid());
#endif
	if(argc == 1) {
		printf("Usage: %s <command, [command... ]>\n", argv[0]);
		printf("commands: ");
		for(const command* cmd = commands; cmd->name != NULL;cmd++) {
			printf("%s", cmd->name);
			if ((cmd+1)->name != NULL) printf(", ");
		}
		printf("\n");
		exit(0);
	}
	gui_init();
	resetmap();
	gui_refresh(map, &kareltje);
	while(--argc) {
		++argv;
		const command* cmd = commands;
		while(cmd->name != NULL) {
			if (strcmp(*argv, cmd->name) == 0) {
				cmd->cmd();
				break;
			}
			cmd++;
		}
		if (cmd->name == NULL) {
			gui_die("Onbekende functie");
		}
	}
	gui_end();
	return 0;
}
コード例 #5
0
ファイル: test-gtk.c プロジェクト: 16L/power86
int main(int argc, char **argv)
{
    //int i;
    /*Ycodelist *c;*/
    gui_init(&argc, &argv);
    gui_startup();
    /*c = y_code_new(stdin);
    y_code_dump(c);
    y_mem_new(0x120);
    y_code_map(c);
    y_mem_dump(stdout);
    y_fetch_init(0x0);
    y_decode_init();
    y_arrange_init();
    y_reg_init();
    y_memory_init();
    for (i = 1; s_fetch_mode != Y_MODE_ABORT ||
                s_decode_mode != Y_MODE_ABORT; ++i){
        y_memory();
        y_exec();
        y_decode();
        y_fetch();
        y_msg_f(Y_MSG_DEBUG, "=========== Cycle %3d ============\n",i);
        dump_reg_state();
        dump_memory_stage();
        dump_exec();
        dump_decode();
        dump_fetch();
        //y_mem_dump(stdout);
    }
    gui_startup();
    y_mem_dump(stdout);
    y_mem_free();
    y_code_free(c);*/
    gui_end();
    return 0;
}
コード例 #6
0
ファイル: menu.c プロジェクト: ionbladez/ohboy-zipit
int menu(){

	char *dir;
	int mexit=0;
	static char *loadrom;
	int old_upscale = 0, new_upscale = 0;

	old_upscale = rc_getint("upscaler");
	gui_begin();
	while(!mexit){
		dialog_begin(rom.name,"ohBoy");

		dialog_text("Back to Game",NULL,FIELD_SELECTABLE);
		dialog_text("Load State",NULL,FIELD_SELECTABLE);
		dialog_text("Save State",NULL,FIELD_SELECTABLE);
		dialog_text("Reset Game",NULL,FIELD_SELECTABLE);
		dialog_text(NULL,NULL,0);
		dialog_text("Load ROM",NULL,FIELD_SELECTABLE);
		dialog_text("Options",NULL,FIELD_SELECTABLE);
		dialog_text("Controls",NULL,FIELD_SELECTABLE);
		dialog_text("About",NULL,FIELD_SELECTABLE);
		dialog_text("Quit","",FIELD_SELECTABLE);
		
#ifdef DINGOO_NATIVE
		dialog_text(NULL, NULL, 0); /* blank line */
		dialog_text("Menu:", NULL, 0);
		dialog_text(" Slide Power", NULL, 0);
#endif /* DINGOO_NATIVE */

		switch(dialog_end()){
			case 2:
				if(menu_state(0)) mexit=1;
				break;
			case 3:
				if(menu_state(1)) mexit=1;
				break;
			case 4:
				rc_command("reset");
				mexit=1;
				break;
			case 6:
				dir = rc_getstr("romdir");
				if(loadrom = menu_requestfile(NULL,"Select Rom",dir,"gb;gbc;zip")) {
					loader_unload();
					ohb_loadrom(loadrom);
					mexit=1;
				}
				break;
			case 7:
				if(menu_options()) mexit=1;
				break;
			case 8:
				if(menu_controls()) mexit=1;
				break;
			case 9:
				if(menu_about()) mexit=0;
				break;
			case 10:
				exit(0);
				break;
			default:
				mexit=1;
				break;
		}
	}
	new_upscale = rc_getint("upscaler");
	if (old_upscale != new_upscale)
		scaler_init(new_upscale);
	gui_end();

	return 0;
}