rem: if (next_reduction == 0 && LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE) next_reduction += REDUCTION_SHIFT; #else COUNT next_reduction; #ifdef KDEBUG fprintf (stderr, "CalcReduction:\n"); #endif if (LOBYTE (GLOBAL (CurrentActivity)) > IN_ENCOUNTER) return (1 << ZOOM_SHIFT);  dx = (dx * MAX_ZOOM_OUT) / (LOG_SPACE_WIDTH >> 2); if (dx < (1 << ZOOM_SHIFT)) dx = 1 << ZOOM_SHIFT; else if (dx > MAX_ZOOM_OUT) dx = MAX_ZOOM_OUT;  dy = (dy * MAX_ZOOM_OUT) / (LOG_SPACE_HEIGHT >> 2); if (dy < (1 << ZOOM_SHIFT)) dy = 1 << ZOOM_SHIFT; else if (dy > MAX_ZOOM_OUT) dy = MAX_ZOOM_OUT;  if (dy > dx) next_reduction = dy; else next_reduction = dx;  if (next_reduction < (2 << ZOOM_SHIFT) && LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE) next_reduction = (2 << ZOOM_SHIFT);
context: CalcReduction (SIZE dx, SIZE dy)#endif{#ifdef OLD_ZOOM	BYTE next_reduction;	SIZE sdx, sdy;	if (LOBYTE (GLOBAL (CurrentActivity)) > IN_ENCOUNTER)		return (0);	sdx = dx;	sdy = dy;	for (next_reduction = MAX_VIS_REDUCTION;			(dx <<= REDUCTION_SHIFT) <= TRANSITION_WIDTH			&& (dy <<= REDUCTION_SHIFT) <= TRANSITION_HEIGHT			&& next_reduction > 0;			next_reduction -= REDUCTION_SHIFT)		;			/* check for "real" zoom in */	if (next_reduction < GLOBAL (cur_state)			&& GLOBAL (cur_state) <= MAX_VIS_REDUCTION)	{#define HYSTERESIS_X DISPLAY_TO_WORLD(24)#define HYSTERESIS_Y DISPLAY_TO_WORLD(20)		if (((sdx + HYSTERESIS_X)				<< (MAX_VIS_REDUCTION - next_reduction)) > TRANSITION_WIDTH				|| ((sdy + HYSTERESIS_Y)				<< (MAX_VIS_REDUCTION - next_reduction)) > TRANSITION_HEIGHT)		   /* if we don't zoom in, we want to stay at next+1 */		   next_reduction += REDUCTION_SHIFT;	}	if (next_reduction == 0			&& LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE)		next_reduction += REDUCTION_SHIFT;#else	COUNT next_reduction;#ifdef KDEBUG	fprintf (stderr, "CalcReduction:\n");#endif	if (LOBYTE (GLOBAL (CurrentActivity)) > IN_ENCOUNTER)		return (1 << ZOOM_SHIFT);			dx = (dx * MAX_ZOOM_OUT) / (LOG_SPACE_WIDTH >> 2);	if (dx < (1 << ZOOM_SHIFT))		dx = 1 << ZOOM_SHIFT;	else if (dx > MAX_ZOOM_OUT)		dx = MAX_ZOOM_OUT;			dy = (dy * MAX_ZOOM_OUT) / (LOG_SPACE_HEIGHT >> 2);	if (dy < (1 << ZOOM_SHIFT))		dy = 1 << ZOOM_SHIFT;	else if (dy > MAX_ZOOM_OUT)		dy = MAX_ZOOM_OUT;			if (dy > dx)		next_reduction = dy;	else		next_reduction = dx;	if (next_reduction < (2 << ZOOM_SHIFT)			&& LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE)		next_reduction = (2 << ZOOM_SHIFT);#ifdef KDEBUG	fprintf (stderr, "CalcReduction: exit\n");#endif#endif	return (next_reduction);}