int scale = gwin->get_win()->get_scale();
int scale = gwin->get_fastmouse() ? 1 : gwin->get_win()->get_scale();
static void Handle_events	(	)	{	uint32 last_repaint = 0;	// For insuring animation repaints.	uint32 last_rotate = 0;	/*	 *	Main event loop.	 */	while (!quitting_time)		{#ifdef USE_EXULTSTUDIO		Server_delay();		// Handle requests.#else		Delay();		// Wait a fraction of a second.#endif		// Mouse scale factor		int scale = gwin->get_win()->get_scale();		Mouse::mouse->hide();		// Turn off mouse.		Mouse::mouse_update = false;					// Get current time.		uint32 ticks = SDL_GetTicks();		Game::set_ticks(ticks);		SDL_Event event;		while (!quitting_time && SDL_PollEvent(&event))			Handle_event(event);					// Animate unless dormant.		if (gwin->have_focus() && !dragging)			gwin->get_tqueue()->activate(ticks);					// Show animation every 1/20 sec.		if (ticks > last_repaint + 50 || gwin->was_painted())					// This avoids jumpy walking:			{			gwin->paint_dirty();			while (ticks > last_repaint+50)last_repaint += 50;			int x, y;// Check for 'stuck' Avatar.			if (!gwin->is_moving() &&			    !gwin->was_teleported())				{				int ms = SDL_GetMouseState(&x, &y);				if ((SDL_BUTTON(3) & ms) &&				    (Game::get_game_type() == SERPENT_ISLE ||					gwin->get_usecode()->get_global_flag(					   Usecode_machine::did_first_scene)))					gwin->start_actor(x/scale, y/scale, 						Mouse::mouse->avatar_speed);				}			}		if (show_mouse)			Mouse::mouse->show();	// Re-display mouse.					// Rotate less often if scaling and not paletized.		int rot_speed = 100 << (gwin->get_win()->is_palettized()||scale==1?0:1);		if (ticks > last_rotate + rot_speed)			{		// (Blits in simulated 8-bit mode.)			gwin->get_win()->rotate_colors(0xf8, 4, 0);			gwin->get_win()->rotate_colors(0xf4, 4, 0);			gwin->get_win()->rotate_colors(0xf0, 4, 0);			gwin->get_win()->rotate_colors(0xe8, 8, 0);			gwin->get_win()->rotate_colors(0xe0, 8, 1);			while (ticks > last_rotate + rot_speed) last_rotate += rot_speed;					// Non palettized needs explicit blit.			if (!gwin->get_win()->is_palettized())				gwin->set_painted();			}		if (!gwin->show() &&	// Blit to screen if necessary.		    Mouse::mouse_update)	// If not, did mouse change?			Mouse::mouse->blit_dirty();		}	}