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:
gewlitys
2002-12-02 01:45:50 +00:00
parent a23fdabda8
commit d26a57d61c
2 changed files with 27 additions and 18 deletions
+19 -15
View File
@@ -1204,11 +1204,12 @@ ScrollPlanetSide (SIZE dx, SIZE dy, SIZE CountDown)
BatchGraphics (); BatchGraphics ();
// Display planet area, accounting for horizontal wrapping if
// near the edges.
{ {
STAMP s; STAMP s;
ClearDrawable (); ClearDrawable ();
s.origin.x = -new_pt.x + (SURFACE_WIDTH >> 1); s.origin.x = -new_pt.x + (SURFACE_WIDTH >> 1);
s.origin.y = -new_pt.y + (SURFACE_HEIGHT >> 1); s.origin.y = -new_pt.y + (SURFACE_HEIGHT >> 1);
s.frame = pSolarSysState->TopoFrame; s.frame = pSolarSysState->TopoFrame;
@@ -1452,24 +1453,26 @@ InitPlanetSide (void)
SetContext (SpaceContext); SetContext (SpaceContext);
AnimateLaunch (LanderFrame[5], FALSE); AnimateLaunch (LanderFrame[5], FALSE);
// Adjust pSolarSysState->MenuState.first_item by a random jitter.
#define RANDOM_MISS 64 #define RANDOM_MISS 64
pt.x = pSolarSysState->MenuState.first_item.x pt = pSolarSysState->MenuState.first_item;
- RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1));
// Jitter the X landing point.
pt.x -= RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1));
if (pt.x < 0) if (pt.x < 0)
pt.x += (MAP_WIDTH << MAG_SHIFT); pt.x += (MAP_WIDTH << MAG_SHIFT);
else if (pt.x >= (MAP_WIDTH << MAG_SHIFT)) else if (pt.x >= (MAP_WIDTH << MAG_SHIFT))
pt.x -= (MAP_WIDTH << MAG_SHIFT); pt.x -= (MAP_WIDTH << MAG_SHIFT);
pt.y = pSolarSysState->MenuState.first_item.y // Jitter the Y landing point.
- RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1)); pt.y -= RANDOM_MISS + (SIZE)(LOWORD (Random ()) % (RANDOM_MISS << 1));
if (pt.y < 0) if (pt.y < 0)
pt.y = 0; pt.y = 0;
else if (pt.y >= (MAP_HEIGHT << MAG_SHIFT)) else if (pt.y >= (MAP_HEIGHT << MAG_SHIFT))
pt.y = (MAP_HEIGHT << MAG_SHIFT) - 1; pt.y = (MAP_HEIGHT << MAG_SHIFT) - 1;
// Put this back in as our original menu choice.
pSolarSysState->MenuState.first_item = pt; pSolarSysState->MenuState.first_item = pt;
pt.x >>= MAG_SHIFT;
pt.y >>= MAG_SHIFT;
#ifdef NEVER #ifdef NEVER
SetContext (ScanContext); SetContext (ScanContext);
@@ -1484,14 +1487,9 @@ InitPlanetSide (void)
SetContext (SpaceContext); SetContext (SpaceContext);
SetContextFont (TinyFont); 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; RECT r;
r.corner.x = SURFACE_X; r.corner.x = SURFACE_X;
r.corner.y = SURFACE_Y; r.corner.y = SURFACE_Y;
r.extent.width = SURFACE_WIDTH; r.extent.width = SURFACE_WIDTH;
@@ -1504,16 +1502,22 @@ InitPlanetSide (void)
{ {
STAMP s; STAMP s;
// Note - This code is the same as in ScrollPlanetSize,
// Display planet area, accounting for horizontal wrapping if
// near the edges.
ClearDrawable (); ClearDrawable ();
s.origin.x = -pt.x + (SURFACE_WIDTH >> 1); s.origin.x = -pt.x + (SURFACE_WIDTH >> 1);
s.origin.y = -pt.y + (SURFACE_HEIGHT >> 1); s.origin.y = -pt.y + (SURFACE_HEIGHT >> 1);
s.frame = pSolarSysState->TopoFrame; s.frame = pSolarSysState->TopoFrame;
SetGraphicScale (1 << (MAG_SHIFT + 8)); SetGraphicScale (1 << (MAG_SHIFT + 8));
DrawStamp (&s); DrawStamp (&s);
s.origin.x += MAP_WIDTH << MAG_SHIFT;
DrawStamp (&s);
s.origin.x -= MAP_WIDTH << (MAG_SHIFT + 1);
DrawStamp (&s);
SetGraphicScale (0); SetGraphicScale (0);
} }
ScreenTransition (3, &r); ScreenTransition (3, &r);
UnbatchGraphics (); UnbatchGraphics ();
+8 -3
View File
@@ -58,6 +58,10 @@ EraseCoarseScan (void)
{ {
RECT r, tr; RECT r, tr;
extern FRAME SpaceJunkFrame; extern FRAME SpaceJunkFrame;
const int leftScanWidth = 60;
const int rightScanWidth = 60;
const int leftScanOffset = 20;
const int rightScanOffset = 45;
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetContext (SpaceContext); SetContext (SpaceContext);
@@ -70,12 +74,13 @@ EraseCoarseScan (void)
GetFrameRect (SetAbsFrameIndex (SpaceJunkFrame, 20), &tr); GetFrameRect (SetAbsFrameIndex (SpaceJunkFrame, 20), &tr);
r = tr; r = tr;
r.extent.width = 70; r.corner.x += leftScanOffset;
r.extent.width = leftScanWidth;
RepairBackRect (&r); RepairBackRect (&r);
r = tr; r = tr;
r.corner.x += (r.extent.width - 70); r.corner.x += (r.extent.width - rightScanOffset);
r.extent.width = 70; r.extent.width = rightScanWidth;
RepairBackRect (&r); RepairBackRect (&r);
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);