rem: TFB_DrawCommand DC; TFB_Image *mmimg = ((PFRAME_DESC)SetEquFrameIndex (
add: PFRAME_DESC frame = (PFRAME_DESC)SetAbsFrameIndex (
context: PostProcessQueue (register VIEW_STATE view_state, register SIZE scroll_x,		register SIZE scroll_y){	POINT delta;#ifdef OLD_ZOOM	register BYTE reduction;#else	register SIZE reduction;#endif	register HELEMENT hElement;#ifdef KDEBUG	fprintf (stderr, "PostProcess:\n");#endif#ifdef OLD_ZOOM	reduction = (BYTE)(GLOBAL (cur_state) + ONE_SHIFT);#else	reduction = zoom_out << ONE_SHIFT;#endif	hElement = GetHeadElement ();	while (hElement != 0)	{		register ELEMENT_FLAGS state_flags;		ELEMENTPTR ElementPtr;		HELEMENT hNextElement;		LockElement (hElement, &ElementPtr);		state_flags = ElementPtr->state_flags;		if (state_flags & PRE_PROCESS)		{			if (!(state_flags & COLLISION))				ElementPtr->state_flags &= ~DEFY_PHYSICS;			else				ElementPtr->state_flags &= ~COLLISION;			if (state_flags & POST_PROCESS)				delta.x = delta.y = 0;			else			{				delta.x = scroll_x;				delta.y = scroll_y;			}		}		else		{			HELEMENT hPostElement;			hPostElement = hElement;			do			{				ELEMENTPTR PostElementPtr;				LockElement (hPostElement, &PostElementPtr);				if (!(PostElementPtr->state_flags & PRE_PROCESS))					PreProcess (PostElementPtr);				hNextElement = GetSuccElement (PostElementPtr);				if (CollidingElement (PostElementPtr)						&& !(PostElementPtr->state_flags & COLLISION))					ProcessCollisions (GetHeadElement (), PostElementPtr,							MAX_TIME_VALUE, PRE_PROCESS | POST_PROCESS);				UnlockElement (hPostElement);			} while ((hPostElement = hNextElement) != 0);			scroll_x = scroll_y = 0;			delta.x = delta.y = 0; /* because these are										  * newly added elements										  * that are already in										  * adjusted coordinates										  */			state_flags = ElementPtr->state_flags;		}		if (state_flags & DISAPPEARING)		{			hNextElement = GetSuccElement (ElementPtr);			UnlockElement (hElement);			RemoveElement (hElement);			FreeElement (hElement);		}		else		{			GRAPHICS_PRIM ObjType;			ObjType = GetPrimType (&DisplayArray[ElementPtr->PrimIndex]);			if (view_state != VIEW_STABLE					|| (state_flags & (APPEARING | CHANGING)))			{				POINT next;				if (ObjType == LINE_PRIM)				{					SIZE dx, dy;					dx = ElementPtr->next.location.x							- ElementPtr->current.location.x;					dy = ElementPtr->next.location.y							- ElementPtr->current.location.y;					next.x = WRAP_X (ElementPtr->current.location.x + delta.x);					next.y = WRAP_Y (ElementPtr->current.location.y + delta.y);#ifdef OLD_ZOOM					DisplayArray[ElementPtr->PrimIndex].Object.Line.first.x =							(next.x - SpaceOrg.x) >> reduction;					DisplayArray[ElementPtr->PrimIndex].Object.Line.first.y =							(next.y - SpaceOrg.y) >> reduction;#else					DisplayArray[ElementPtr->PrimIndex].Object.Line.first.x =							((next.x - SpaceOrg.x) << ZOOM_SHIFT) / reduction;					DisplayArray[ElementPtr->PrimIndex].Object.Line.first.y =							((next.y - SpaceOrg.y) << ZOOM_SHIFT) / reduction;#endif					next.x += dx;					next.y += dy;#ifdef OLD_ZOOM					DisplayArray[ElementPtr->PrimIndex].Object.Line.second.x =							(next.x - SpaceOrg.x) >> reduction;					DisplayArray[ElementPtr->PrimIndex].Object.Line.second.y =							(next.y - SpaceOrg.y) >> reduction;#else					DisplayArray[ElementPtr->PrimIndex].Object.Line.second.x =							((next.x - SpaceOrg.x) << ZOOM_SHIFT) / reduction;					DisplayArray[ElementPtr->PrimIndex].Object.Line.second.y =							((next.y - SpaceOrg.y) << ZOOM_SHIFT) / reduction;#endif				}				else				{					next.x = WRAP_X (ElementPtr->next.location.x + delta.x);					next.y = WRAP_Y (ElementPtr->next.location.y + delta.y);#ifdef OLD_ZOOM					DisplayArray[ElementPtr->PrimIndex].Object.Point.x =							(next.x - SpaceOrg.x) >> reduction;					DisplayArray[ElementPtr->PrimIndex].Object.Point.y =							(next.y - SpaceOrg.y) >> reduction;#else					DisplayArray[ElementPtr->PrimIndex].Object.Point.x =							((next.x - SpaceOrg.x) << ZOOM_SHIFT) / reduction;					DisplayArray[ElementPtr->PrimIndex].Object.Point.y =							((next.y - SpaceOrg.y) << ZOOM_SHIFT) / reduction;#endif					if (ObjType == STAMP_PRIM							|| ObjType == STAMPFILL_PRIM)					{						if (view_state == VIEW_CHANGE								|| (state_flags & (APPEARING | CHANGING)))						{#ifdef OLD_ZOOM							ElementPtr->next.image.frame =#ifdef SAFE									SetAbsFrameIndex (									ElementPtr->next.image.farray									[GLOBAL (cur_state)],									GetFrameIndex (ElementPtr->next.image.frame));#else /* SAFE */									SetEquFrameIndex (									ElementPtr->next.image.farray									[GLOBAL (cur_state)],									ElementPtr->next.image.frame);#endif /* SAFE */#else							COUNT index, scale;														CALC_ZOOM_STUFF (&index, &scale);							ElementPtr->next.image.frame =#ifdef SAFE									SetAbsFrameIndex (									ElementPtr->next.image.farray									[index],									GetFrameIndex (ElementPtr->next.image.frame));#else /* SAFE */									SetEquFrameIndex (									ElementPtr->next.image.farray									[index],									ElementPtr->next.image.frame);#endif /* SAFE */							if (optMeleeScale == TFB_SCALE_TRILINEAR && index < 2 && scale != 256)							{								// enqueues drawcommand to assign next (smaller) zoom								// level image as mipmap, needed for trilinear scaling								TFB_DrawCommand DC;																TFB_Image *mmimg =									((PFRAME_DESC)SetEquFrameIndex (									ElementPtr->next.image.farray									[index + 1],									ElementPtr->next.image.frame))->image;																DC.Type = TFB_DRAWCOMMANDTYPE_SETMIPMAP;								DC.data.setmipmap.image = ((PFRAME_DESC)ElementPtr->next.image.frame)->image;								LockMutex (mmimg->mutex);								DC.data.setmipmap.mipmap = mmimg->NormalImg;								UnlockMutex (mmimg->mutex);								TFB_EnqueueDrawCommand (&DC);							}#endif						}						DisplayArray[ElementPtr->PrimIndex].Object.Stamp.frame =								ElementPtr->next.image.frame;					}				}				ElementPtr->next.location = next;			}			PostProcess (ElementPtr);			if (ObjType < NUM_PRIMS)				InsertPrim (&DisplayLinks, ElementPtr->PrimIndex, END_OF_LIST);			hNextElement = GetSuccElement (ElementPtr);			UnlockElement (hElement);		}		hElement = hNextElement;	}#ifdef KDEBUG	fprintf (stderr, "PostProcess: exit\n");#endif}