Lines and coloring of planet surface when scanning, from PhracturedBlue

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@344 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-05 19:33:55 +00:00
parent e0c8b82952
commit 1b6fbacf1f
3 changed files with 52 additions and 0 deletions
+46
View File
@@ -751,10 +751,56 @@ DrawPlanet (int x, int y, int dy, unsigned int rgb)
{ {
#if 1 #if 1
STAMP s; STAMP s;
UBYTE a=128;
s.origin.x = x; s.origin.x = x;
s.origin.y = y; s.origin.y = y;
s.frame = pSolarSysState->TopoFrame; s.frame = pSolarSysState->TopoFrame;
DrawStamp (&s); 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 #else
if (rgb || !pshield_ccb->ccb_HDY) if (rgb || !pshield_ccb->ccb_HDY)
{ {
+5
View File
@@ -228,6 +228,11 @@ FreePlanet (void)
DestroyDrawable (ReleaseDrawable (pSolarSysState->ShieldFrame)); DestroyDrawable (ReleaseDrawable (pSolarSysState->ShieldFrame));
pSolarSysState->ShieldFrame=0; pSolarSysState->ShieldFrame=0;
} }
if(pSolarSysState->TintFrame != 0)
{
DestroyDrawable (ReleaseDrawable (pSolarSysState->TintFrame));
pSolarSysState->TintFrame=0;
}
if(pSolarSysState->lpTopoMap!=0) { if(pSolarSysState->lpTopoMap!=0) {
for(i=0;pSolarSysState->lpTopoMap[i]!=NULL;i++) { for(i=0;pSolarSysState->lpTopoMap[i]!=NULL;i++) {
free(pSolarSysState->lpTopoMap[i]); free(pSolarSysState->lpTopoMap[i]);
+1
View File
@@ -166,6 +166,7 @@ typedef struct solarsys_state
FRAME *PlanetFrameArray; FRAME *PlanetFrameArray;
FRAME ScaleFrame[2]; FRAME ScaleFrame[2];
FRAME ShieldFrame; FRAME ShieldFrame;
FRAME TintFrame;
BYTE *isPFADefined; BYTE *isPFADefined;
DWORD **lpTopoMap; DWORD **lpTopoMap;
} SOLARSYS_STATE; } SOLARSYS_STATE;