Remove some scan map 'repair' hacks. We redraw the entire scan map, instead of repairing, since 3DO
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3332 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+12
-104
@@ -200,49 +200,6 @@ DamageColorCycle (COLOR c, COUNT i)
|
|||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: This function used to erase a moving object by drawing a piece
|
|
||||||
// of surface over its previous location. Now it just moves the object
|
|
||||||
static BOOLEAN
|
|
||||||
RepairTopography (ELEMENT *ElementPtr)
|
|
||||||
{
|
|
||||||
//BOOLEAN CursorIntersect;
|
|
||||||
SIZE delta;
|
|
||||||
RECT r;
|
|
||||||
STAMP s;
|
|
||||||
|
|
||||||
s.origin = ElementPtr->current.location;
|
|
||||||
|
|
||||||
GetFrameRect (ElementPtr->next.image.frame, &r);
|
|
||||||
r.corner.x += ElementPtr->current.location.x;
|
|
||||||
r.corner.y += ElementPtr->current.location.y;
|
|
||||||
|
|
||||||
delta = (ElementPtr->next.location.x >> MAG_SHIFT) - r.corner.x;
|
|
||||||
if (delta >= 0)
|
|
||||||
r.extent.width += delta;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
r.corner.x += delta;
|
|
||||||
r.extent.width -= delta;
|
|
||||||
}
|
|
||||||
ElementPtr->current.location.x += delta;
|
|
||||||
if (ElementPtr->current.location.x < 0)
|
|
||||||
ElementPtr->current.location.x += MAP_WIDTH;
|
|
||||||
else if (ElementPtr->current.location.x >= MAP_WIDTH)
|
|
||||||
ElementPtr->current.location.x -= MAP_WIDTH;
|
|
||||||
|
|
||||||
delta = (ElementPtr->next.location.y >> MAG_SHIFT) - r.corner.y;
|
|
||||||
if (delta >= 0)
|
|
||||||
r.extent.height += delta;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
r.corner.y += delta;
|
|
||||||
r.extent.height -= delta;
|
|
||||||
}
|
|
||||||
ElementPtr->current.location.y += delta;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HELEMENT AddGroundDisaster (COUNT which_disaster);
|
static HELEMENT AddGroundDisaster (COUNT which_disaster);
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1109,20 +1066,8 @@ BuildObjectList (void)
|
|||||||
{
|
{
|
||||||
hNextElement = GetSuccElement (ElementPtr);
|
hNextElement = GetSuccElement (ElementPtr);
|
||||||
UnlockElement (hElement);
|
UnlockElement (hElement);
|
||||||
|
RemoveElement (hElement);
|
||||||
// XXX: Hack: APPEARING flag is set by scan.c for scanned blips
|
FreeElement (hElement);
|
||||||
if (ElementPtr->state_flags & APPEARING)
|
|
||||||
{
|
|
||||||
// XXX: Hack: defer deletion of the element
|
|
||||||
ElementPtr->current.location.x |= 0x8000;
|
|
||||||
ElementPtr->current.location.y |= 0x8000;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RemoveElement (hElement);
|
|
||||||
FreeElement (hElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (ElementPtr->state_flags & FINITE_LIFE)
|
else if (ElementPtr->state_flags & FINITE_LIFE)
|
||||||
@@ -1146,15 +1091,19 @@ BuildObjectList (void)
|
|||||||
else if (ElementPtr->next.location.y >= (MAP_HEIGHT << MAG_SHIFT))
|
else if (ElementPtr->next.location.y >= (MAP_HEIGHT << MAG_SHIFT))
|
||||||
ElementPtr->next.location.y = (MAP_HEIGHT << MAG_SHIFT) - 1;
|
ElementPtr->next.location.y = (MAP_HEIGHT << MAG_SHIFT) - 1;
|
||||||
}
|
}
|
||||||
// XXX: Hack: APPEARING flag is set by scan.c for scanned blips
|
|
||||||
if (ElementPtr->state_flags & APPEARING)
|
|
||||||
{ // XXX: Hack: remove the element from display
|
|
||||||
ElementPtr->current.location.x |= 0x8000;
|
|
||||||
}
|
|
||||||
if (ElementPtr->next.location.x < 0)
|
if (ElementPtr->next.location.x < 0)
|
||||||
ElementPtr->next.location.x += MAP_WIDTH << MAG_SHIFT;
|
ElementPtr->next.location.x += MAP_WIDTH << MAG_SHIFT;
|
||||||
else
|
else
|
||||||
ElementPtr->next.location.x %= MAP_WIDTH << MAG_SHIFT;
|
ElementPtr->next.location.x %= MAP_WIDTH << MAG_SHIFT;
|
||||||
|
|
||||||
|
// XXX: APPEARING flag is set by scan.c for scanned blips
|
||||||
|
if (ElementPtr->state_flags & APPEARING)
|
||||||
|
{ // Update the location of a moving object on the scan map
|
||||||
|
ElementPtr->current.location.x =
|
||||||
|
ElementPtr->next.location.x >> MAG_SHIFT;
|
||||||
|
ElementPtr->current.location.y =
|
||||||
|
ElementPtr->next.location.y >> MAG_SHIFT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -1186,43 +1135,6 @@ BuildObjectList (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
RepairScan (POINT newPlanetLoc)
|
|
||||||
{
|
|
||||||
HELEMENT hElement, hNextElement;
|
|
||||||
|
|
||||||
for (hElement = GetHeadElement ();
|
|
||||||
hElement; hElement = hNextElement)
|
|
||||||
{
|
|
||||||
ELEMENT *ElementPtr;
|
|
||||||
BOOLEAN remove = FALSE;
|
|
||||||
|
|
||||||
LockElement (hElement, &ElementPtr);
|
|
||||||
hNextElement = GetSuccElement (ElementPtr);
|
|
||||||
if (ElementPtr->current.location.x & 0x8000)
|
|
||||||
{ // XXX: element removed from display
|
|
||||||
ElementPtr->current.location.x &= ~0x8000;
|
|
||||||
if (ElementPtr->current.location.y & 0x8000)
|
|
||||||
{ // XXX: deletion of this element was defered
|
|
||||||
remove = TRUE;
|
|
||||||
ElementPtr->current.location.y &= ~0x8000;
|
|
||||||
}
|
|
||||||
|
|
||||||
RepairTopography (ElementPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
UnlockElement (hElement);
|
|
||||||
|
|
||||||
if (remove)
|
|
||||||
{
|
|
||||||
RemoveElement (hElement);
|
|
||||||
FreeElement (hElement);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RedrawSurfaceScan (&newPlanetLoc);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ScrollPlanetSide (SIZE dx, SIZE dy, int landingOffset)
|
ScrollPlanetSide (SIZE dx, SIZE dy, int landingOffset)
|
||||||
{
|
{
|
||||||
@@ -1355,7 +1267,7 @@ ScrollPlanetSide (SIZE dx, SIZE dy, int landingOffset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RepairScan (new_pt);
|
RedrawSurfaceScan (&new_pt);
|
||||||
|
|
||||||
if (lander_flags & KILL_CREW)
|
if (lander_flags & KILL_CREW)
|
||||||
DeltaLanderCrew (-1, LIGHTNING_DISASTER);
|
DeltaLanderCrew (-1, LIGHTNING_DISASTER);
|
||||||
@@ -1581,10 +1493,6 @@ LanderFire (SIZE facing)
|
|||||||
WeaponElementPtr->life_span = 12;
|
WeaponElementPtr->life_span = 12;
|
||||||
WeaponElementPtr->state_flags = FINITE_LIFE;
|
WeaponElementPtr->state_flags = FINITE_LIFE;
|
||||||
WeaponElementPtr->next.location = curLanderLoc;
|
WeaponElementPtr->next.location = curLanderLoc;
|
||||||
WeaponElementPtr->current.location.x =
|
|
||||||
WeaponElementPtr->next.location.x >> MAG_SHIFT;
|
|
||||||
WeaponElementPtr->current.location.y =
|
|
||||||
WeaponElementPtr->next.location.y >> MAG_SHIFT;
|
|
||||||
|
|
||||||
SetPrimType (&DisplayArray[WeaponElementPtr->PrimIndex], STAMP_PRIM);
|
SetPrimType (&DisplayArray[WeaponElementPtr->PrimIndex], STAMP_PRIM);
|
||||||
DisplayArray[WeaponElementPtr->PrimIndex].Object.Stamp.frame =
|
DisplayArray[WeaponElementPtr->PrimIndex].Object.Stamp.frame =
|
||||||
|
|||||||
@@ -562,12 +562,13 @@ setPlanetCursorLoc (POINT new_pt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setPlanetLoc (POINT new_pt)
|
setPlanetLoc (POINT new_pt, BOOLEAN restoreOld)
|
||||||
{
|
{
|
||||||
planetLoc = new_pt;
|
planetLoc = new_pt;
|
||||||
|
|
||||||
SetContext (ScanContext);
|
SetContext (ScanContext);
|
||||||
restorePlanetLocationImage ();
|
if (restoreOld)
|
||||||
|
restorePlanetLocationImage ();
|
||||||
setPlanetCursorLoc (new_pt);
|
setPlanetCursorLoc (new_pt);
|
||||||
savePlanetLocationImage ();
|
savePlanetLocationImage ();
|
||||||
}
|
}
|
||||||
@@ -626,7 +627,7 @@ RedrawSurfaceScan (const POINT *newLoc)
|
|||||||
DrawScannedObjects (TRUE);
|
DrawScannedObjects (TRUE);
|
||||||
if (newLoc)
|
if (newLoc)
|
||||||
{
|
{
|
||||||
setPlanetLoc (*newLoc);
|
setPlanetLoc (*newLoc, FALSE);
|
||||||
drawPlanetCursor (FALSE);
|
drawPlanetCursor (FALSE);
|
||||||
}
|
}
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
@@ -796,7 +797,7 @@ ExitPlanetSide:
|
|||||||
if (new_pt.x != planetLoc.x
|
if (new_pt.x != planetLoc.x
|
||||||
|| new_pt.y != planetLoc.y)
|
|| new_pt.y != planetLoc.y)
|
||||||
{
|
{
|
||||||
setPlanetLoc (new_pt);
|
setPlanetLoc (new_pt, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
flashPlanetLocation ();
|
flashPlanetLocation ();
|
||||||
@@ -837,7 +838,7 @@ DrawScannedStuff (COUNT y, BYTE CurState)
|
|||||||
//DWORD Time;
|
//DWORD Time;
|
||||||
STAMP s;
|
STAMP s;
|
||||||
|
|
||||||
// XXX: Hack: flag this as surface scan element
|
// XXX: Hack: flag this as a scanned object
|
||||||
ElementPtr->state_flags |= APPEARING;
|
ElementPtr->state_flags |= APPEARING;
|
||||||
|
|
||||||
s.origin = ElementPtr->current.location;
|
s.origin = ElementPtr->current.location;
|
||||||
|
|||||||
Reference in New Issue
Block a user