From 4c5d5130d4655f8f6547e97e78d2fac99c059c9d Mon Sep 17 00:00:00 2001 From: gewlitys Date: Tue, 10 Dec 2002 18:15:40 +0000 Subject: [PATCH] Earth topo map is now tinted as should, from PhracturedBlue git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@392 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/planets/lander.c | 2 +- sc2/src/sc2code/planets/pl_stuff.c | 6 ------ sc2/src/sc2code/planets/plangen.c | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/sc2/src/sc2code/planets/lander.c b/sc2/src/sc2code/planets/lander.c index 363849baa..7d1eb94f5 100644 --- a/sc2/src/sc2code/planets/lander.c +++ b/sc2/src/sc2code/planets/lander.c @@ -21,7 +21,7 @@ #include "lifeform.h" #include "libs/graphics/gfx_common.h" -//define SPIN_ON_LAUNCH tolet the planet spin while +//define SPIN_ON_LAUNCH to let the planet spin while // the lander animation is playing #undef SPIN_ON_LAUNCH diff --git a/sc2/src/sc2code/planets/pl_stuff.c b/sc2/src/sc2code/planets/pl_stuff.c index 98c5f5df6..a2a050017 100644 --- a/sc2/src/sc2code/planets/pl_stuff.c +++ b/sc2/src/sc2code/planets/pl_stuff.c @@ -138,12 +138,6 @@ DrawPlanet (int x, int y, int dy, unsigned int rgb) s.origin.x = x; s.origin.y = y; s.frame = pSolarSysState->TopoFrame; - if (pSolarSysState->ShieldFrame != 0) - { - rgb = 0x1f << 10; - dy = GetFrameHeight (s.frame); - a = 200; - } BatchGraphics (); if (! rgb) DrawStamp (&s); diff --git a/sc2/src/sc2code/planets/plangen.c b/sc2/src/sc2code/planets/plangen.c index 24d02726e..29e690ee8 100644 --- a/sc2/src/sc2code/planets/plangen.c +++ b/sc2/src/sc2code/planets/plangen.c @@ -24,6 +24,10 @@ #define PROFILE 1 #define ROTATION_TIME 12 +// define USE_ALPHA_SHIELD to use an aloha overlay instead of +// an additive overlay for the shield effect +#undef USE_ALPHA_SHIELD + extern void DeltaTopography (COUNT num_iterations, PSBYTE DepthArray, PRECT pRect, SIZE depth_delta); @@ -41,6 +45,10 @@ void process_rgb_bmp (FRAME FramePtr, DWORD *rgba, int maxx, int maxy); FRAME stretch_frame (FRAME FramePtr, int neww, int newh,int destroy); +void fill_frame_rgb (FRAME FramePtr, DWORD color, int x0, int y0, int x, int y); + +void add_sub_frame (FRAME srcFrame, RECT *rsrc, FRAME dstFrame, RECT *rdst, int add_sub); + DWORD **getpixelarray(FRAME FramePtr,int width, int height); #define NUM_BATCH_POINTS 64 @@ -468,6 +476,22 @@ static void CreateShieldMask () SetFrameHot (ShieldFrame, MAKE_HOT_SPOT (SHIELD_RADIUS + 1,SHIELD_RADIUS + 1)); HFree(rgba); pSolarSysState->ShieldFrame = ShieldFrame; + { + // Applythe shield to the topo data + UBYTE a, blit_type; + FRAME tintFrame = pSolarSysState->TintFrame[0]; +#ifdef USE_ALPHA_SHIELD + a = 200; + blit_type = 0; +#else + a = 255; + blit_type = 1; +#endif + p = frame_mapRGBA (tintFrame, 255, 0, 0, a); + fill_frame_rgb (tintFrame, p, 0, 0, 0, 0); + add_sub_frame (tintFrame, NULL, pSolarSysState->TopoFrame, NULL, blit_type); + } + } // RenderLevelMasks builds a frame for the rotating planet view