Пример #1
0
void menu_picked(int index, void* context) {
	show_loading();

	switch(index) {
		case 0:
			window_stack_pop(true);
			init_notification_list_window();
			break;
	}
}
Пример #2
0
// seg000:0000
void far pop_main() {
	// debug only: check that the sequence table deobfuscation did not mess things up
	#ifdef CHECK_SEQTABLE_MATCHES_ORIGINAL
	check_seqtable_matches_original();
	#endif

	load_options();
	apply_seqtbl_patches();

	char sprintf_temp[100];
	int i;

	dathandle = open_dat("PRINCE.DAT", 0);

	/*video_mode =*/ parse_grmode();

	init_timer(60);
	parse_cmdline_sound();

	set_hc_pal();

	current_target_surface = rect_sthg(onscreen_surface_, &screen_rect);
	show_loading();
	set_joy_mode();
	cheats_enabled = check_param("megahit") != NULL;
#ifdef __DEBUG__
	cheats_enabled = 1; // debug
#endif
	draw_mode = check_param("draw") != NULL && cheats_enabled;
	demo_mode = check_param("demo") != NULL;

	init_copyprot_dialog();
#ifdef USE_REPLAY
	init_record_replay();
#endif

	if (cheats_enabled
		#ifdef USE_REPLAY
		|| recording
        #endif
			) {
		for (i = 14; i >= 0; --i) {
			snprintf(sprintf_temp, sizeof(sprintf_temp), "%d", i);
			if (check_param(sprintf_temp)) {
				start_level = i;
				break;
			}
		}
	}

	init_game_main();
}
Пример #3
0
void window_load(Window *me) {
	setCurWindow(0);

	show_loading();

	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);
	dict_write_uint8(iterator, 0, 0);
	app_message_outbox_send();

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_comm_set_sniff_interval(SNIFF_INTERVAL_NORMAL);
}
void menu_picked(int index, void* context)
{
	show_loading();

	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);

	dict_write_uint8(iterator, 0, 6);
	dict_write_uint8(iterator, 1, index);

	app_message_outbox_send();

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_comm_set_sniff_interval(SNIFF_INTERVAL_NORMAL);
}
Пример #5
0
static void window_appears(Window *me)
{
	if (closingMode)
	{
		closeApp();
		app_timer_register(3000, closing_timer, NULL);
	}
	else if (menuLoaded)
	{
		main_menu_show_menu();
	}
	else
	{
		show_loading();
	}

	setCurWindow(0);
}
void menu_picked(int index, void* context)
{
	show_loading();

	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);
  if(isNotificationListenerSupported == 1){
	  dict_write_uint8(iterator, 0, 6);
	  dict_write_uint8(iterator, 1, index);
	} else {
	  dict_write_uint8(iterator, 0, 6);
	  dict_write_uint8(iterator, 1, 1);
	}

	app_message_outbox_send();

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_comm_set_sniff_interval(SNIFF_INTERVAL_NORMAL);
}
Пример #7
0
int main( int argc, char* args[] )
{
    //Quit flag
    bool quit = false;
    //Initialize
    if( init() == false )
    {
        return 1;
    }

    //Load the files
    if( load_files() == false )
    {
        return 1;
    }

    //Apply the background
    show_screen();
    //While the user hasn't quit
    while( quit == false )
    {
      if( Mix_PlayingMusic() == 0 )
	{
	  //Play the music
	  if( Mix_PlayMusic( music, -1 ) == -1 )
	    {
	      return 1;
	    }
	}
        //While there's events to handle
      while( SDL_PollEvent( &event ) )
	{
	  if(event.type==SDL_KEYDOWN)
	    {
	      if(event.key.keysym.sym==SDLK_w)
		{
		  Mix_PlayChannel(-1,jump,0);
		  if(arrowPos==2 && screenNum==0) // main menu is showing
		    {
		      arrowPos=0;
		    }
		  else if((arrowPos==1 || arrowPos==2 || arrowPos==3)&&screenNum==1) // options is showing
		    {
		      if(arrowPos==3)
			{
			  arrowPos-=2;
			}
		      else
			{
			  arrowPos=0;
			}
		    }
		  else
		    {
		      arrowPos=arrowPos;
		    }
		}
	      else if(event.key.keysym.sym==SDLK_d)
		{
		  Mix_PlayChannel(-1,fire,0);
		  if(arrowPos==0 && screenNum==0)
		    {
		      arrowPos=1;
		    }
		  else if(arrowPos==1 && screenNum==1)
		    {
		      arrowPos=2;
		    }
		  else
		    {
		      arrowPos=arrowPos;
		    }
		}
	      else if(event.key.keysym.sym==SDLK_a)
		{
		  if(arrowPos==1 && screenNum==0)
		    {
		      arrowPos=0;
		    }
		  else if(arrowPos==2 && screenNum==1)
		    {
		      arrowPos=1;
		    }
		  else
		    {
		      arrowPos=arrowPos;
		    }
		}
	      else if(event.key.keysym.sym==SDLK_s)
		{
		  if((arrowPos==0 || arrowPos==1) && screenNum==0)
		    {
		      arrowPos=2;
		    }
		  else if(arrowPos<3 && screenNum==1)
		    {
		      if(arrowPos==0)
			{
			  arrowPos++;
			}
		      else
			{
			  arrowPos=3;
			}
		    }
		  else
		    {
		      arrowPos=arrowPos;
		    }
		}
	      else if(event.key.keysym.sym==SDLK_e)
		{
		  if((arrowPos==0 || arrowPos==1) && screenNum==0)
		    {
		      screenNum=2;
		      quit=true;
		    }
		  else if(arrowPos==2 && screenNum==0)
		    {
		      arrowPos=0;
		      screenNum=1;
		    }	  
		  else if(arrowPos==3 && screenNum==1)
		    {
		      screenNum=0;
		      arrowPos=0;
		    }
		}

	    }
	  if(screenNum==0)
	    {
	      show_screen();
	    }
	  else if(screenNum==1)
	    {
	      show_options();
	    }
	  else
	    {
	      show_loading();
	    }
	}
      //If the user has Xed out the window
      if( event.type == SDL_QUIT )
	{
	  //Quit the program
	  quit = true;
	}
    }
    SDL_Delay(500);
    //Free surfaces, fonts and sounds
    //then quit SDL_mixer, SDL_ttf and SDL
    clean_up();

    return 0;
}