From 1b6fbacf1f8f392f5ace777f745ba8a1c52d83e6 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Thu, 5 Dec 2002 19:33:55 +0000 Subject: [PATCH] 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 --- sc2/src/sc2code/planets/pl_stuff.c | 46 ++++++++++++++++++++++++++++++ sc2/src/sc2code/planets/planets.c | 5 ++++ sc2/src/sc2code/planets/planets.h | 1 + 3 files changed, 52 insertions(+) diff --git a/sc2/src/sc2code/planets/pl_stuff.c b/sc2/src/sc2code/planets/pl_stuff.c index 01c760218..a1a703c27 100644 --- a/sc2/src/sc2code/planets/pl_stuff.c +++ b/sc2/src/sc2code/planets/pl_stuff.c @@ -751,10 +751,56 @@ 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;iccb_HDY) { diff --git a/sc2/src/sc2code/planets/planets.c b/sc2/src/sc2code/planets/planets.c index 2cc7a8c63..6b72f86b7 100644 --- a/sc2/src/sc2code/planets/planets.c +++ b/sc2/src/sc2code/planets/planets.c @@ -228,6 +228,11 @@ FreePlanet (void) DestroyDrawable (ReleaseDrawable (pSolarSysState->ShieldFrame)); pSolarSysState->ShieldFrame=0; } + if(pSolarSysState->TintFrame != 0) + { + DestroyDrawable (ReleaseDrawable (pSolarSysState->TintFrame)); + pSolarSysState->TintFrame=0; + } if(pSolarSysState->lpTopoMap!=0) { for(i=0;pSolarSysState->lpTopoMap[i]!=NULL;i++) { free(pSolarSysState->lpTopoMap[i]); diff --git a/sc2/src/sc2code/planets/planets.h b/sc2/src/sc2code/planets/planets.h index eb5a9f246..c73b11b1a 100644 --- a/sc2/src/sc2code/planets/planets.h +++ b/sc2/src/sc2code/planets/planets.h @@ -166,6 +166,7 @@ typedef struct solarsys_state FRAME *PlanetFrameArray; FRAME ScaleFrame[2]; FRAME ShieldFrame; + FRAME TintFrame; BYTE *isPFADefined; DWORD **lpTopoMap; } SOLARSYS_STATE;