rem: FRAME tintFrame=pSolarSysState->TintFrame; if(tintFrame !=0)
add: FRAME tintFrame; if(pSolarSysState->TintFrame !=0)
context: DrawPlanet (int x, int y, int dy, unsigned int rgb){#if 1	STAMP s;	UBYTE a=128;	s.origin.x = x;	s.origin.y = y;	s.frame = pSolarSysState->TopoFrame;	DrawStamp (&s);	if (pSolarSysState->ShieldFrame!=0)	{		rgb=0x1f<<10;		dy=GetFrameHeight(s.frame);		a=200;	}	if (rgb)	{		UBYTE r,g,b;		DWORD **rgba,p;		COUNT i,j,framew;		FRAME tintFrame=pSolarSysState->TintFrame;		if(tintFrame !=0)		{			DestroyDrawable (ReleaseDrawable (tintFrame));			tintFrame=0;		}		framew=GetFrameWidth(s.frame);		tintFrame = CaptureDrawable (			CreateDrawable (WANT_PIXMAP, framew, (UWORD)dy, 1)				);		rgba=(DWORD **)HMalloc(sizeof(DWORD *)*(dy));		r=(rgb&(0x1f<<10))>>8;		g=(rgb&(0x1f<<5))>>3;		b=(rgb&0x1f)<<2;		p=frame_mapRGBA(tintFrame,r,g,b,a);		for(i=0;i<dy;i++)		{			rgba[i]=(DWORD *)HMalloc(sizeof(DWORD)*framew);			for(j=0;j<framew;j++)				rgba[i][j]=p;		}		process_rgb_bmp(tintFrame,rgba,framew,dy);		SetFrameHot (tintFrame, MAKE_HOT_SPOT (0, 0));		for (i=0;i<dy;i++)			HFree(rgba[i]);		HFree(rgba);		s.frame = tintFrame;		DrawStamp (&s);	}						#else	if (rgb || !pshield_ccb->ccb_HDY)	{		int i, nt, my;		if (!pshield_ccb->ccb_HDY)		{			dy = HEIGHT + NUM_TINTS;			rgb = 0x1f << 10;		}				my = dy - NUM_TINTS;		if (my < 0)		{			nt = NUM_TINTS + my + 1;			my = 0;		}		else if (my >= HEIGHT)		{			nt = NUM_TINTS;			my = HEIGHT - 1;		}		else			nt = NUM_TINTS;				my += y;				surface_ccb.ccb_XPos = x << 16;		surface_ccb.ccb_YPos = y << 16;		surface_ccb.ccb_SourcePtr = planet_ccb.ccb_SourcePtr;		surface_ccb.ccb_PRE0 =				PRE0_BGND				| (((dy + 1) - PRE0_VCNT_PREFETCH) << PRE0_VCNT_SHIFT)				| PRE0_LINEAR				| PRE0_BPP_16;		surface_ccb.ccb_PIXC =				PIXC_DUP (PPMPC_1S_PDC | PPMPC_MS_CCB | PPMPC_MF_6				| PPMPC_SF_8 | PPMPC_2S_0);		add_cel (&surface_ccb);				nt = NUM_TINTS - nt;		for (i = nt; i < NUM_TINTS; i++, my++)		{			if (my >= y && my < y + HEIGHT)			{				if (i == 0)				{					tint_ccb[i].ccb_YPos = y << 16;					tint_ccb[i].ccb_VDY = (my - y + 1) << 16;				}				else					tint_ccb[i].ccb_YPos = my << 16;				tint_ccb[i].ccb_XPos = x << 16;				*((DWORD *)tint_ccb[i].ccb_SourcePtr) = rgb | (rgb << 16) | 0x80008000;				add_cel (&tint_ccb[i]);			}		}	}	else	{		surface_ccb.ccb_XPos = x << 16;		surface_ccb.ccb_YPos = y << 16;		surface_ccb.ccb_SourcePtr = planet_ccb.ccb_SourcePtr;		surface_ccb.ccb_PRE0 =				PRE0_BGND				| ((HEIGHT - PRE0_VCNT_PREFETCH) << PRE0_VCNT_SHIFT)				| PRE0_LINEAR				| PRE0_BPP_16;		surface_ccb.ccb_PIXC = PIXC_UNCODED16;		add_cel (&surface_ccb);	}#endif}