gwin->brighten(20);
if(cheat&&alt) { current_res++; if(current_res>=num_res) current_res = 0; gwin->resized(res_list[current_res].x,res_list[current_res].y, res_list[current_res].scale); } else gwin->brighten(20);
static void Handle_keystroke	(	SDLKey sym,	int shift,        int alt,	int ctrl	)	{	static int current_shape = 0, current_frame = 0, current_file = 0;	Vga_file *vga_file;		static int inventory_page = -1, stats_page = -1;	int stepping = 1;		if(alt)		stepping = 10;	// If the user is pressing alt, use a				// larger stepping when cycling shapes	switch (sym)		{	case SDLK_RALT:			// Right alt.	case SDLK_RMETA:		altkeys |= 1;		// Set flag.		break;	case SDLK_LALT:	case SDLK_LMETA:		altkeys |= 2;		break;	case SDLK_PLUS:			// Brighten.	case SDLK_KP_PLUS:		gwin->brighten(20);		break;	case SDLK_MINUS:		// Darken.	case SDLK_KP_MINUS:		gwin->brighten(-20);		break;	case SDLK_b:		Breakpoint();		break;	case SDLK_i:		{		// Show Inventory		if (gwin->get_mode() != Game_window::gump)			inventory_page = stats_page = -1;		if(inventory_page<gwin->get_usecode()->get_party_count())			++inventory_page;		else			inventory_page = 0;		Actor *actor = Get_party_member(inventory_page);		if (actor)			actor->activate(gwin->get_usecode());		if (gwin->get_mode() == Game_window::gump)			mouse->set_shape(Mouse::hand);		break;		}	case SDLK_z:			// Show stats.		{		if (gwin->get_mode() != Game_window::gump)			stats_page = -1;		if (stats_page < gwin->get_usecode()->get_party_count())			++stats_page;		else			stats_page = 0;		Actor *actor = Get_party_member(stats_page);		if (actor)			gwin->show_gump(actor, STATSDISPLAY);		if (gwin->get_mode() == Game_window::gump)			mouse->set_shape(Mouse::hand);		break;		}	case SDLK_c:		{		if (ctrl)		// Create last shape viewed.			{			gwin->get_main_actor()->add(				new Ireg_game_object(current_shape,					current_frame, 0, 0), 1);			break;			}		gwin->toggle_combat();	// Go into combat mode		gwin->paint();		int mx, my;		// Update mouse.		SDL_GetMouseState(&mx, &my);		Set_mouse_and_speed(mx, my);		break;		}	case SDLK_d:			// ctrl-d:  delete what mouse is on.		{		if (ctrl&&cheat)			{			int x, y;			SDL_GetMouseState(&x, &y);			x = x>>scale;			y = y>>scale;			Game_object *obj = gwin->find_object(x, y);			if (obj)				{				obj->remove_this();				gwin->paint();				}			}		break;		}	case SDLK_h:		{		char buf[512];		sprintf(buf, "EXULT - Keyboard commands\n\n"			"Arrow keys - scroll map\n"			"Plus-Minus - Increment-decrement brightness\n"			"e - Toggle eggs visibility\n"			"PgUp/PgDn - Show next-previous shape file\n"			"vV - Show next-previous shape\n"			"fF - Show next-previous frame\n"			"c - Combat mode\n"			"i - Show inventory\n"			"l - Decrement lift\n"			"m - Turn on/off music\n"			"p - Repaint screen\n"			"z - Show stats\n"			"alt-x, F10, ESC - Exit\n"			"ctrl-m - Get 100 gold coins\n"			"ctrl-t - Fake time period change\n"			"ctrl-w - Test weather\n"			"F4 - Toggle fullscreen\n"		);					gwin->paint_text_box(2, buf, 			15, 15, 300, 400);		gwin->paint();		break;		}	case SDLK_ESCAPE:		// ESC key.		inventory_page = stats_page = -1;		if (gwin->get_mode() == Game_window::gump)			gwin->end_gump_mode();		else			// For now, quit.			Okay_to_quit();		break;	case SDLK_m:		if (ctrl&&cheat) {	// CTRL-m:  get 100 gold coins!			gwin->get_main_actor()->add_quantity(100, 644);			break;		} else {			static int mnum = 0;			if (shift && mnum > 0)				audio->start_music(--mnum, 0);			else				audio->start_music(mnum++, 0);		}		break;	case SDLK_l:			// Decrement skip_lift.		if(!cheat)			break;		if (gwin->skip_lift == 16)			gwin->skip_lift = 11;		else			gwin->skip_lift--;		if (gwin->skip_lift <= 0)			gwin->skip_lift = 16;#if DEBUG		cout << "Skip_lift = " << gwin->skip_lift << endl;#endif					// FALL THROUGH.	case SDLK_p:			// Rerender image.		gwin->paint();		break;	case SDLK_e:		if(!cheat)			break;		gwin->paint_eggs = !gwin->paint_eggs;		gwin->paint();		break;	case SDLK_f:		// Show next frame		if(!cheat)			break;		vga_file = gwin->get_shape_file_data(current_file);		if (!shift) {			current_frame += stepping;			if(current_frame>=vga_file->get_num_frames(current_shape))				current_frame = 0;		} else {			current_frame -= stepping;			if(current_frame<0)				current_frame = vga_file->get_num_frames(current_shape);		}		shape_showcase(current_file, current_shape, current_frame);		break;	case SDLK_r:		if (ctrl)		// Restore from 'gamedat'.			{			if (gwin->read())				cout << "Restore from 'gamedat' successful"<<endl;			gwin->paint();			break;			}		break;	case SDLK_s:		if (ctrl)		// Save to 'gamedat'.			{			if (gwin->write())				cout << "Save to 'gamedat' successful"<<endl;			}		else			{			File_gump_object *fileio = new File_gump_object();			Modal_gump(fileio, Mouse::hand);			delete fileio;			}		break;	case SDLK_v:		if(!cheat)			break;					// Show next shape.		current_frame = 0;		vga_file = gwin->get_shape_file_data(current_file);		if (!shift) {			current_shape += alt ? 20 : 1;			if(current_shape>=vga_file->get_num_shapes())				current_shape = 0;		} else {			current_shape -= alt ? 20 : 1;			if(current_shape<0)				current_shape = vga_file->get_num_shapes()-1;		}		shape_showcase(current_file, current_shape, current_frame);		break;	case SDLK_t:			// 'Target' mode.		{		if (ctrl&&cheat)		// 'T':  Fake next time change.			{			gwin->fake_next_period();			break;			}		int x, y;		if (alt&&cheat)		// Teleport.			{			SDL_GetMouseState(&x, &y);			x = x>>scale;			y = y>>scale;			Tile_coord t(gwin->get_scrolltx() + x/tilesize,				gwin->get_scrollty() + y/tilesize, 0);			gwin->teleport_party(t);			break;			}		if (!Get_click(x, y, Mouse::greenselect))			break;		gwin->double_clicked(x, y);		if (gwin->get_mode() == Game_window::gump)			mouse->set_shape(Mouse::hand);		break;		}	case SDLK_w:			// Test weather.		if (ctrl&&cheat)		// Duration is 4*number secs.			{			static int wcnt = 0, wmax = 1;			if (wcnt == 0)				gwin->add_effect(new Clouds_effect(15));			else if (wcnt == 1)				gwin->add_effect(						new Lightning_effect(2));			wcnt = (wcnt + 1)%wmax;			}		break;	case SDLK_x:			// Alt-x means quit.		if (alt)			Okay_to_quit();		break;	case SDLK_PAGEUP:		if(!cheat)			break;		current_shape=0;		current_frame=0;		--current_file;		if(current_file<0)			current_file = gwin->get_shape_file_count()-1;		shape_showcase(current_file, current_shape, current_frame);		break;	case SDLK_PAGEDOWN:		if(!cheat)			break;		current_shape=0;		current_frame=0;		++current_file;		if(current_file==gwin->get_shape_file_count())			current_file = 0;		shape_showcase(current_file, current_shape, current_frame);		break;	case SDLK_RIGHT:		if(!cheat)			break;		for (int i = 16; i; i--)			gwin->view_right();		break;	case SDLK_LEFT:		if(!cheat)			break;		for (int i = 16; i; i--)			gwin->view_left();		break;	case SDLK_DOWN:		if(!cheat)			break;		for (int i = 16; i; i--)			gwin->view_down();		break;	case SDLK_UP:		if(!cheat)			break;		for (int i = 16; i; i--)			gwin->view_up();		break;	case SDLK_HOME:		if(!cheat)			break;		gwin->center_view(gwin->get_main_actor()->get_abs_tile_coord());		gwin->paint();		break;	case SDLK_F4:		gwin->get_win()->toggle_fullscreen();		gwin->paint();		break;	case SDLK_F10:		if(!cheat)			break;		{			Titles titles;			titles.end_game(true);		}		break;	default:		break;	}}