l0ci's fixes (planet scan is now correctly erased, initial display of the
planet landing is now correct) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@288 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1204,11 +1204,12 @@ ScrollPlanetSide (SIZE dx, SIZE dy, SIZE CountDown)
|
||||
|
||||
BatchGraphics ();
|
||||
|
||||
// Display planet area, accounting for horizontal wrapping if
|
||||
// near the edges.
|
||||
{
|
||||
STAMP s;
|
||||
|
||||
ClearDrawable ();
|
||||
|
||||
s.origin.x = -new_pt.x + (SURFACE_WIDTH >> 1);
|
||||
s.origin.y = -new_pt.y + (SURFACE_HEIGHT >> 1);
|
||||
s.frame = pSolarSysState->TopoFrame;
|
||||
@@ -1452,24 +1453,26 @@ InitPlanetSide (void)
|
||||
SetContext (SpaceContext);
|
||||
AnimateLaunch (LanderFrame[5], FALSE);
|
||||
|
||||
// Adjust pSolarSysState->MenuState.first_item by a random jitter.
|
||||
#define RANDOM_MISS 64
|
||||
pt.x = pSolarSysState->MenuState.first_item.x
|
||||
- RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1));
|
||||
pt = pSolarSysState->MenuState.first_item;
|
||||
|
||||
// Jitter the X landing point.
|
||||
pt.x -= RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1));
|
||||
if (pt.x < 0)
|
||||
pt.x += (MAP_WIDTH << MAG_SHIFT);
|
||||
else if (pt.x >= (MAP_WIDTH << MAG_SHIFT))
|
||||
pt.x -= (MAP_WIDTH << MAG_SHIFT);
|
||||
|
||||
pt.y = pSolarSysState->MenuState.first_item.y
|
||||
- RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1));
|
||||
// Jitter the Y landing point.
|
||||
pt.y -= RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1));
|
||||
if (pt.y < 0)
|
||||
pt.y = 0;
|
||||
else if (pt.y >= (MAP_HEIGHT << MAG_SHIFT))
|
||||
pt.y = (MAP_HEIGHT << MAG_SHIFT) - 1;
|
||||
|
||||
// Put this back in as our original menu choice.
|
||||
pSolarSysState->MenuState.first_item = pt;
|
||||
pt.x >>= MAG_SHIFT;
|
||||
pt.y >>= MAG_SHIFT;
|
||||
|
||||
#ifdef NEVER
|
||||
SetContext (ScanContext);
|
||||
@@ -1484,11 +1487,6 @@ InitPlanetSide (void)
|
||||
SetContext (SpaceContext);
|
||||
SetContextFont (TinyFont);
|
||||
|
||||
pt.x = pSolarSysState->MenuState.first_item.x - (SURFACE_WIDTH >> 1); // was SPACE_
|
||||
if (pt.x < 0)
|
||||
pt.x += MAP_WIDTH << MAG_SHIFT;
|
||||
pt.y = pSolarSysState->MenuState.first_item.y - (SURFACE_HEIGHT >> 1); // was SPACE_
|
||||
|
||||
{
|
||||
RECT r;
|
||||
|
||||
@@ -1504,13 +1502,19 @@ InitPlanetSide (void)
|
||||
{
|
||||
STAMP s;
|
||||
|
||||
// Note - This code is the same as in ScrollPlanetSize,
|
||||
// Display planet area, accounting for horizontal wrapping if
|
||||
// near the edges.
|
||||
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));
|
||||
DrawStamp (&s);
|
||||
s.origin.x += MAP_WIDTH << MAG_SHIFT;
|
||||
DrawStamp (&s);
|
||||
s.origin.x -= MAP_WIDTH << (MAG_SHIFT + 1);
|
||||
DrawStamp (&s);
|
||||
SetGraphicScale (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,10 @@ EraseCoarseScan (void)
|
||||
{
|
||||
RECT r, tr;
|
||||
extern FRAME SpaceJunkFrame;
|
||||
const int leftScanWidth = 60;
|
||||
const int rightScanWidth = 60;
|
||||
const int leftScanOffset = 20;
|
||||
const int rightScanOffset = 45;
|
||||
|
||||
SetSemaphore (GraphicsSem);
|
||||
SetContext (SpaceContext);
|
||||
@@ -70,12 +74,13 @@ EraseCoarseScan (void)
|
||||
|
||||
GetFrameRect (SetAbsFrameIndex (SpaceJunkFrame, 20), &tr);
|
||||
r = tr;
|
||||
r.extent.width = 70;
|
||||
r.corner.x += leftScanOffset;
|
||||
r.extent.width = leftScanWidth;
|
||||
RepairBackRect (&r);
|
||||
|
||||
r = tr;
|
||||
r.corner.x += (r.extent.width - 70);
|
||||
r.extent.width = 70;
|
||||
r.corner.x += (r.extent.width - rightScanOffset);
|
||||
r.extent.width = rightScanWidth;
|
||||
RepairBackRect (&r);
|
||||
|
||||
ClearSemaphore (GraphicsSem);
|
||||
|
||||
Reference in New Issue
Block a user