Zoomed planet view no longer abuses ScaledImg.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@857 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -524,9 +524,8 @@ void rZF_continuous (SDL_Surface *src, SDL_Surface *dst)
|
||||
}
|
||||
|
||||
/* perform a 16x zoom, and then apply a blur filter to the result */
|
||||
SDL_Surface *random16xZoomSurfaceRGBA (SDL_Surface *src)
|
||||
void random16xZoomSurfaceRGBA (SDL_Surface *src, SDL_Surface *dst)
|
||||
{
|
||||
SDL_Surface *dst;
|
||||
#ifdef RND_BLUR_PROFILE
|
||||
clock_t t1 = clock();
|
||||
#endif
|
||||
@@ -534,9 +533,6 @@ SDL_Surface *random16xZoomSurfaceRGBA (SDL_Surface *src)
|
||||
/*
|
||||
* Alloc space to completely contain the zoomed surface
|
||||
*/
|
||||
dst = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w << 2, src->h << 2, 32,
|
||||
src->format->Rmask, src->format->Gmask,
|
||||
src->format->Bmask, src->format->Amask);
|
||||
SDL_LockSurface (src);
|
||||
SDL_LockSurface (dst);
|
||||
#if RANDOM_METHOD == 0
|
||||
@@ -557,17 +553,26 @@ SDL_Surface *random16xZoomSurfaceRGBA (SDL_Surface *src)
|
||||
fprintf(stderr, "Randomize took %f seconds\n",(float)(clock() - t1) / CLOCKS_PER_SEC);
|
||||
#endif
|
||||
blurSurface32 (dst);
|
||||
return (dst);
|
||||
}
|
||||
|
||||
void scale16xRandomizeFrame (FRAMEPTR FramePtr)
|
||||
FRAMEPTR scale16xRandomizeFrame (FRAMEPTR FramePtr)
|
||||
{
|
||||
TFB_Image *tfbImg;
|
||||
TFB_Image *origImg, *newImg;
|
||||
FRAMEPTR NewFrame;
|
||||
UBYTE type;
|
||||
|
||||
tfbImg = FramePtr->image;
|
||||
LockMutex (tfbImg->mutex);
|
||||
tfbImg->ScaledImg = random16xZoomSurfaceRGBA (tfbImg->NormalImg);
|
||||
tfbImg->scale = 4 << 8;
|
||||
UnlockMutex (tfbImg->mutex);
|
||||
type = (UBYTE)TYPE_GET (GetFrameParentDrawable (FramePtr)
|
||||
->FlagsAndIndex) >> FTYPE_SHIFT;
|
||||
NewFrame = CaptureDrawable (
|
||||
CreateDrawable (type,
|
||||
(SIZE)((GetFrameWidth (FramePtr)) << 2),
|
||||
(SIZE)((GetFrameHeight (FramePtr)) << 2), 1));
|
||||
|
||||
newImg = NewFrame->image;
|
||||
origImg = FramePtr->image;
|
||||
LockMutex (origImg->mutex);
|
||||
random16xZoomSurfaceRGBA (origImg->NormalImg, newImg->NormalImg);
|
||||
UnlockMutex (origImg->mutex);
|
||||
return (NewFrame);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1224,14 +1224,12 @@ ScrollPlanetSide (SIZE dx, SIZE dy, SIZE CountDown)
|
||||
ClearDrawable ();
|
||||
s.origin.x = -new_pt.x + (SURFACE_WIDTH >> 1);
|
||||
s.origin.y = -new_pt.y + (SURFACE_HEIGHT >> 1);
|
||||
s.frame = pSolarSysState->TopoFrame;
|
||||
SetGraphicScale (1 << (MAG_SHIFT + 8));
|
||||
s.frame = pSolarSysState->TopoZoomFrame;
|
||||
DrawStamp (&s);
|
||||
s.origin.x += MAP_WIDTH << MAG_SHIFT;
|
||||
DrawStamp (&s);
|
||||
s.origin.x -= MAP_WIDTH << (MAG_SHIFT + 1);
|
||||
DrawStamp (&s);
|
||||
SetGraphicScale (0);
|
||||
}
|
||||
|
||||
BuildObjectList ();
|
||||
@@ -1528,14 +1526,12 @@ InitPlanetSide (void)
|
||||
ClearDrawable ();
|
||||
s.origin.x = -pt.x + (SURFACE_WIDTH >> 1);
|
||||
s.origin.y = -pt.y + (SURFACE_HEIGHT >> 1);
|
||||
s.frame = pSolarSysState->TopoFrame;
|
||||
SetGraphicScale (1 << (MAG_SHIFT + 8));
|
||||
s.frame = pSolarSysState->TopoZoomFrame;
|
||||
DrawStamp (&s);
|
||||
s.origin.x += MAP_WIDTH << MAG_SHIFT;
|
||||
DrawStamp (&s);
|
||||
s.origin.x -= MAP_WIDTH << (MAG_SHIFT + 1);
|
||||
DrawStamp (&s);
|
||||
SetGraphicScale (0);
|
||||
}
|
||||
|
||||
ScreenTransition (3, &r);
|
||||
|
||||
@@ -214,6 +214,8 @@ FreePlanet (void)
|
||||
pSolarSysState->hTopoData = 0;
|
||||
DestroyDrawable (ReleaseDrawable (pSolarSysState->TopoFrame));
|
||||
pSolarSysState->TopoFrame = 0;
|
||||
DestroyDrawable (ReleaseDrawable (pSolarSysState->TopoZoomFrame));
|
||||
pSolarSysState->TopoZoomFrame = 0;
|
||||
DestroyColorMap (ReleaseColorMap (pSolarSysState->OrbitalCMap));
|
||||
pSolarSysState->OrbitalCMap = 0;
|
||||
DestroyDrawable (ReleaseDrawable (pSolarSysState->PlanetFrameArray));
|
||||
|
||||
@@ -153,6 +153,7 @@ typedef struct solarsys_state
|
||||
BYTE thrust_counter, max_ship_speed;
|
||||
|
||||
FRAME TopoFrame;
|
||||
FRAME TopoZoomFrame;
|
||||
MEM_HANDLE hTopoData;
|
||||
PBYTE lpTopoData;
|
||||
STRING XlatRef;
|
||||
|
||||
@@ -49,7 +49,7 @@ void fill_frame_rgb (FRAME FramePtr, DWORD color, int x0, int y0, int x, int y);
|
||||
|
||||
void arith_frame_blit (FRAME srcFrame, RECT *rsrc, FRAME dstFrame, RECT *rdst, int num, int denom);
|
||||
|
||||
void scale16xRandomizeFrame(FRAME FramePtr);
|
||||
FRAME scale16xRandomizeFrame(FRAME FramePtr);
|
||||
|
||||
DWORD **getpixelarray(FRAME FramePtr,int width, int height);
|
||||
|
||||
@@ -1303,7 +1303,7 @@ GeneratePlanetMask (PPLANET_DESC pPlanetDesc, BOOLEAN IsEarth)
|
||||
// from lpTopoData instead of the FRAMPTR though
|
||||
x = MAP_WIDTH + MAP_HEIGHT;
|
||||
y = MAP_HEIGHT;
|
||||
scale16xRandomizeFrame(pSolarSysState->TopoFrame);
|
||||
pSolarSysState->TopoZoomFrame = scale16xRandomizeFrame(pSolarSysState->TopoFrame);
|
||||
pSolarSysState->lpTopoMap = getpixelarray (
|
||||
pSolarSysState->TopoFrame, x, y
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user