Cleanup of ENCOUNTER member fields abuse
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3670 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+6
-9
@@ -1536,7 +1536,6 @@ RaceCommunication (void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Encounter with a black globe in HS, prepare enemy ship list */
|
/* Encounter with a black globe in HS, prepare enemy ship list */
|
||||||
COUNT NumShips;
|
|
||||||
ENCOUNTER *EncounterPtr;
|
ENCOUNTER *EncounterPtr;
|
||||||
|
|
||||||
// The encounter globe that the flagship collided with is moved
|
// The encounter globe that the flagship collided with is moved
|
||||||
@@ -1544,10 +1543,9 @@ RaceCommunication (void)
|
|||||||
hEncounter = GetHeadEncounter ();
|
hEncounter = GetHeadEncounter ();
|
||||||
LockEncounter (hEncounter, &EncounterPtr);
|
LockEncounter (hEncounter, &EncounterPtr);
|
||||||
|
|
||||||
NumShips = LONIBBLE (EncounterPtr->SD.Index);
|
for (i = 0; i < EncounterPtr->num_ships; ++i)
|
||||||
for (i = 0; i < NumShips; ++i)
|
|
||||||
{
|
{
|
||||||
CloneShipFragment (EncounterPtr->SD.Type,
|
CloneShipFragment (EncounterPtr->race_id,
|
||||||
&GLOBAL (npc_built_ship_q),
|
&GLOBAL (npc_built_ship_q),
|
||||||
EncounterPtr->ShipList[i].crew_level);
|
EncounterPtr->ShipList[i].crew_level);
|
||||||
}
|
}
|
||||||
@@ -1588,12 +1586,11 @@ RaceCommunication (void)
|
|||||||
|
|
||||||
LockEncounter (hEncounter, &EncounterPtr);
|
LockEncounter (hEncounter, &EncounterPtr);
|
||||||
|
|
||||||
NumShips = (BYTE)CountLinks (&GLOBAL (npc_built_ship_q));
|
NumShips = CountLinks (&GLOBAL (npc_built_ship_q));
|
||||||
EncounterPtr->SD.Index = MAKE_BYTE (NumShips,
|
EncounterPtr->num_ships = NumShips;
|
||||||
HINIBBLE (EncounterPtr->SD.Index));
|
EncounterPtr->flags |= ENCOUNTER_REFORMING;
|
||||||
EncounterPtr->SD.Index |= ENCOUNTER_REFORMING;
|
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
EncounterPtr->SD.Index |= ONE_SHOT_ENCOUNTER;
|
EncounterPtr->flags |= ONE_SHOT_ENCOUNTER;
|
||||||
|
|
||||||
for (i = 0; i < NumShips; ++i)
|
for (i = 0; i < NumShips; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
+14
-1
@@ -38,8 +38,16 @@ extern "C" {
|
|||||||
typedef HLINK HENCOUNTER;
|
typedef HLINK HENCOUNTER;
|
||||||
|
|
||||||
#define MAX_HYPER_SHIPS 7
|
#define MAX_HYPER_SHIPS 7
|
||||||
|
|
||||||
|
// ENCOUNTER.flags
|
||||||
|
// XXX: Currently, the flags are combined with num_ships into a single BYTE
|
||||||
|
// in the savegames: num_ships occupy the low nibble and flags the high one.
|
||||||
|
// Bits 4 and 5 are available for more flags in the savegames,
|
||||||
|
// and bits 0-3 available in the game but will not be saved.
|
||||||
#define ONE_SHOT_ENCOUNTER (1 << 7)
|
#define ONE_SHOT_ENCOUNTER (1 << 7)
|
||||||
#define ENCOUNTER_REFORMING (1 << 6)
|
#define ENCOUNTER_REFORMING (1 << 6)
|
||||||
|
#define ENCOUNTER_SHIPS_MASK 0x0f
|
||||||
|
#define ENCOUNTER_FLAGS_MASK 0xf0
|
||||||
|
|
||||||
struct brief_ship_info
|
struct brief_ship_info
|
||||||
{
|
{
|
||||||
@@ -61,9 +69,14 @@ struct encounter
|
|||||||
SIZE transition_state;
|
SIZE transition_state;
|
||||||
POINT origin;
|
POINT origin;
|
||||||
COUNT radius;
|
COUNT radius;
|
||||||
|
BYTE race_id;
|
||||||
|
BYTE num_ships;
|
||||||
|
BYTE flags;
|
||||||
|
// See ENCOUNTER.flags above
|
||||||
|
POINT loc_pt;
|
||||||
|
|
||||||
STAR_DESC SD;
|
|
||||||
BRIEF_SHIP_INFO ShipList[MAX_HYPER_SHIPS];
|
BRIEF_SHIP_INFO ShipList[MAX_HYPER_SHIPS];
|
||||||
|
// Only the crew_level member is currently used
|
||||||
|
|
||||||
SDWORD log_x, log_y;
|
SDWORD log_x, log_y;
|
||||||
};
|
};
|
||||||
|
|||||||
+23
-24
@@ -225,13 +225,13 @@ check_hyperspace_encounter (void)
|
|||||||
encounter_flags = ONE_SHOT_ENCOUNTER;
|
encounter_flags = ONE_SHOT_ENCOUNTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There can be only one! (of either Slylandro or Melnorme)
|
||||||
for (hEncounter = GetHeadEncounter ();
|
for (hEncounter = GetHeadEncounter ();
|
||||||
hEncounter; hEncounter = hNextEncounter)
|
hEncounter; hEncounter = hNextEncounter)
|
||||||
{
|
{
|
||||||
LockEncounter (hEncounter, &EncounterPtr);
|
LockEncounter (hEncounter, &EncounterPtr);
|
||||||
hNextEncounter = GetSuccEncounter (EncounterPtr);
|
hNextEncounter = GetSuccEncounter (EncounterPtr);
|
||||||
if (EncounterPtr->SD.Type == Type)
|
if (EncounterPtr->race_id == Type)
|
||||||
{
|
{
|
||||||
percent = 0;
|
percent = 0;
|
||||||
hNextEncounter = 0;
|
hNextEncounter = 0;
|
||||||
@@ -266,8 +266,8 @@ check_hyperspace_encounter (void)
|
|||||||
memset (EncounterPtr, 0, sizeof (*EncounterPtr));
|
memset (EncounterPtr, 0, sizeof (*EncounterPtr));
|
||||||
EncounterPtr->origin = FleetPtr->loc;
|
EncounterPtr->origin = FleetPtr->loc;
|
||||||
EncounterPtr->radius = encounter_radius;
|
EncounterPtr->radius = encounter_radius;
|
||||||
EncounterPtr->SD.Index = encounter_flags;
|
EncounterPtr->flags = encounter_flags;
|
||||||
EncounterPtr->SD.Type = Type;
|
EncounterPtr->race_id = Type;
|
||||||
UnlockEncounter (hEncounter);
|
UnlockEncounter (hEncounter);
|
||||||
|
|
||||||
PutEncounter (hEncounter);
|
PutEncounter (hEncounter);
|
||||||
@@ -956,20 +956,20 @@ AddEncounterElement (ENCOUNTER *EncounterPtr, POINT *puniverse)
|
|||||||
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) >= 2)
|
if (GET_GAME_STATE (ARILOU_SPACE_SIDE) >= 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (EncounterPtr->SD.Index & ENCOUNTER_REFORMING)
|
if (EncounterPtr->flags & ENCOUNTER_REFORMING)
|
||||||
{
|
{
|
||||||
EncounterPtr->SD.Index &= ~ENCOUNTER_REFORMING;
|
EncounterPtr->flags &= ~ENCOUNTER_REFORMING;
|
||||||
|
|
||||||
EncounterPtr->transition_state = 100;
|
EncounterPtr->transition_state = 100;
|
||||||
if ((EncounterPtr->SD.Index & ONE_SHOT_ENCOUNTER)
|
if ((EncounterPtr->flags & ONE_SHOT_ENCOUNTER)
|
||||||
|| LONIBBLE (EncounterPtr->SD.Index) == 0)
|
|| EncounterPtr->num_ships == 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LONIBBLE (EncounterPtr->SD.Index))
|
if (EncounterPtr->num_ships)
|
||||||
{
|
{
|
||||||
NewEncounter = FALSE;
|
NewEncounter = FALSE;
|
||||||
enc_pt = EncounterPtr->SD.star_pt;
|
enc_pt = EncounterPtr->loc_pt;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -987,7 +987,7 @@ AddEncounterElement (ENCOUNTER *EncounterPtr, POINT *puniverse)
|
|||||||
|
|
||||||
radius_squared = (DWORD)EncounterPtr->radius * EncounterPtr->radius;
|
radius_squared = (DWORD)EncounterPtr->radius * EncounterPtr->radius;
|
||||||
|
|
||||||
Type = EncounterPtr->SD.Type;
|
Type = EncounterPtr->race_id;
|
||||||
NumShips = LONIBBLE (EncounterMakeup[Type]);
|
NumShips = LONIBBLE (EncounterMakeup[Type]);
|
||||||
for (i = HINIBBLE (EncounterMakeup[Type]) - NumShips; i; --i)
|
for (i = HINIBBLE (EncounterMakeup[Type]) - NumShips; i; --i)
|
||||||
{
|
{
|
||||||
@@ -998,9 +998,7 @@ AddEncounterElement (ENCOUNTER *EncounterPtr, POINT *puniverse)
|
|||||||
if (NumShips > MAX_HYPER_SHIPS)
|
if (NumShips > MAX_HYPER_SHIPS)
|
||||||
NumShips = MAX_HYPER_SHIPS;
|
NumShips = MAX_HYPER_SHIPS;
|
||||||
|
|
||||||
|
EncounterPtr->num_ships = NumShips;
|
||||||
EncounterPtr->SD.Index =
|
|
||||||
MAKE_BYTE (NumShips, HINIBBLE (EncounterPtr->SD.Index));
|
|
||||||
for (i = 0; i < NumShips; ++i)
|
for (i = 0; i < NumShips; ++i)
|
||||||
{
|
{
|
||||||
BRIEF_SHIP_INFO *BSIPtr = &EncounterPtr->ShipList[i];
|
BRIEF_SHIP_INFO *BSIPtr = &EncounterPtr->ShipList[i];
|
||||||
@@ -1038,7 +1036,7 @@ AddEncounterElement (ENCOUNTER *EncounterPtr, POINT *puniverse)
|
|||||||
dy = enc_pt.y - EncounterPtr->origin.y;
|
dy = enc_pt.y - EncounterPtr->origin.y;
|
||||||
} while ((DWORD)((long)dx * dx + (long)dy * dy) > radius_squared);
|
} while ((DWORD)((long)dx * dx + (long)dy * dy) > radius_squared);
|
||||||
|
|
||||||
EncounterPtr->SD.star_pt = enc_pt;
|
EncounterPtr->loc_pt = enc_pt;
|
||||||
EncounterPtr->log_x = UNIVERSE_TO_LOGX (enc_pt.x);
|
EncounterPtr->log_x = UNIVERSE_TO_LOGX (enc_pt.x);
|
||||||
EncounterPtr->log_y = UNIVERSE_TO_LOGY (enc_pt.y);
|
EncounterPtr->log_y = UNIVERSE_TO_LOGY (enc_pt.y);
|
||||||
}
|
}
|
||||||
@@ -1197,8 +1195,8 @@ ProcessEncounter (ENCOUNTER *EncounterPtr, POINT *puniverse,
|
|||||||
cur_facing = ANGLE_TO_FACING (
|
cur_facing = ANGLE_TO_FACING (
|
||||||
GetVelocityTravelAngle (&ElementPtr->velocity));
|
GetVelocityTravelAngle (&ElementPtr->velocity));
|
||||||
delta_facing = NORMALIZE_FACING (cur_facing - ANGLE_TO_FACING (
|
delta_facing = NORMALIZE_FACING (cur_facing - ANGLE_TO_FACING (
|
||||||
ARCTAN (puniverse->x - EncounterPtr->SD.star_pt.x,
|
ARCTAN (puniverse->x - EncounterPtr->loc_pt.x,
|
||||||
puniverse->y - EncounterPtr->SD.star_pt.y)));
|
puniverse->y - EncounterPtr->loc_pt.y)));
|
||||||
if (delta_facing || (delta_x == 0 && delta_y == 0))
|
if (delta_facing || (delta_x == 0 && delta_y == 0))
|
||||||
{
|
{
|
||||||
SIZE speed;
|
SIZE speed;
|
||||||
@@ -1208,7 +1206,7 @@ ProcessEncounter (ENCOUNTER *EncounterPtr, POINT *puniverse,
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define ENCOUNTER_TRACK_WAIT 3
|
#define ENCOUNTER_TRACK_WAIT 3
|
||||||
speed = RaceHyperSpeed[EncounterPtr->SD.Type];
|
speed = RaceHyperSpeed[EncounterPtr->race_id];
|
||||||
if (delta_facing < ANGLE_TO_FACING (HALF_CIRCLE))
|
if (delta_facing < ANGLE_TO_FACING (HALF_CIRCLE))
|
||||||
--cur_facing;
|
--cur_facing;
|
||||||
else
|
else
|
||||||
@@ -1233,14 +1231,14 @@ ProcessEncounter (ENCOUNTER *EncounterPtr, POINT *puniverse,
|
|||||||
}
|
}
|
||||||
EncounterPtr->log_x += delta_x;
|
EncounterPtr->log_x += delta_x;
|
||||||
EncounterPtr->log_y -= delta_y;
|
EncounterPtr->log_y -= delta_y;
|
||||||
EncounterPtr->SD.star_pt.x = LOGX_TO_UNIVERSE (EncounterPtr->log_x);
|
EncounterPtr->loc_pt.x = LOGX_TO_UNIVERSE (EncounterPtr->log_x);
|
||||||
EncounterPtr->SD.star_pt.y = LOGY_TO_UNIVERSE (EncounterPtr->log_y);
|
EncounterPtr->loc_pt.y = LOGY_TO_UNIVERSE (EncounterPtr->log_y);
|
||||||
|
|
||||||
encounter_radius = EncounterPtr->radius + (GRID_OFFSET >> 1);
|
encounter_radius = EncounterPtr->radius + (GRID_OFFSET >> 1);
|
||||||
delta_x = EncounterPtr->SD.star_pt.x - EncounterPtr->origin.x;
|
delta_x = EncounterPtr->loc_pt.x - EncounterPtr->origin.x;
|
||||||
if (delta_x < 0)
|
if (delta_x < 0)
|
||||||
delta_x = -delta_x;
|
delta_x = -delta_x;
|
||||||
delta_y = EncounterPtr->SD.star_pt.y - EncounterPtr->origin.y;
|
delta_y = EncounterPtr->loc_pt.y - EncounterPtr->origin.y;
|
||||||
if (delta_y < 0)
|
if (delta_y < 0)
|
||||||
delta_y = -delta_y;
|
delta_y = -delta_y;
|
||||||
if ((COUNT)delta_x >= encounter_radius
|
if ((COUNT)delta_x >= encounter_radius
|
||||||
@@ -1248,6 +1246,7 @@ ProcessEncounter (ENCOUNTER *EncounterPtr, POINT *puniverse,
|
|||||||
|| (DWORD)delta_x * delta_x + (DWORD)delta_y * delta_y >=
|
|| (DWORD)delta_x * delta_x + (DWORD)delta_y * delta_y >=
|
||||||
(DWORD)encounter_radius * encounter_radius)
|
(DWORD)encounter_radius * encounter_radius)
|
||||||
{
|
{
|
||||||
|
// Encounter globe traveled outside the SoI and now disappears
|
||||||
ElementPtr->state_flags |= NONSOLID;
|
ElementPtr->state_flags |= NONSOLID;
|
||||||
ElementPtr->life_span = 0;
|
ElementPtr->life_span = 0;
|
||||||
|
|
||||||
@@ -1266,8 +1265,8 @@ ProcessEncounter (ENCOUNTER *EncounterPtr, POINT *puniverse,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ex = EncounterPtr->SD.star_pt.x;
|
ex = EncounterPtr->loc_pt.x;
|
||||||
ey = EncounterPtr->SD.star_pt.y;
|
ey = EncounterPtr->loc_pt.y;
|
||||||
if (ex - puniverse->x >= -UNIT_SCREEN_WIDTH
|
if (ex - puniverse->x >= -UNIT_SCREEN_WIDTH
|
||||||
&& ex - puniverse->x <= UNIT_SCREEN_WIDTH
|
&& ex - puniverse->x <= UNIT_SCREEN_WIDTH
|
||||||
&& ey - puniverse->y >= -UNIT_SCREEN_HEIGHT
|
&& ey - puniverse->y >= -UNIT_SCREEN_HEIGHT
|
||||||
|
|||||||
+8
-6
@@ -325,6 +325,7 @@ static void
|
|||||||
LoadEncounter (ENCOUNTER *EncounterPtr, DECODE_REF fh)
|
LoadEncounter (ENCOUNTER *EncounterPtr, DECODE_REF fh)
|
||||||
{
|
{
|
||||||
COUNT i;
|
COUNT i;
|
||||||
|
BYTE tmpb;
|
||||||
|
|
||||||
cread_ptr (fh); /* useless ptr; HENCOUNTER pred */
|
cread_ptr (fh); /* useless ptr; HENCOUNTER pred */
|
||||||
EncounterPtr->pred = 0;
|
EncounterPtr->pred = 0;
|
||||||
@@ -336,18 +337,19 @@ LoadEncounter (ENCOUNTER *EncounterPtr, DECODE_REF fh)
|
|||||||
cread_16s (fh, &EncounterPtr->origin.x);
|
cread_16s (fh, &EncounterPtr->origin.x);
|
||||||
cread_16s (fh, &EncounterPtr->origin.y);
|
cread_16s (fh, &EncounterPtr->origin.y);
|
||||||
cread_16 (fh, &EncounterPtr->radius);
|
cread_16 (fh, &EncounterPtr->radius);
|
||||||
// STAR_DESC fields
|
// former STAR_DESC fields
|
||||||
cread_16s (fh, &EncounterPtr->SD.star_pt.x);
|
cread_16s (fh, &EncounterPtr->loc_pt.x);
|
||||||
cread_16s (fh, &EncounterPtr->SD.star_pt.y);
|
cread_16s (fh, &EncounterPtr->loc_pt.y);
|
||||||
cread_8 (fh, &EncounterPtr->SD.Type);
|
cread_8 (fh, &EncounterPtr->race_id);
|
||||||
cread_8 (fh, &EncounterPtr->SD.Index);
|
cread_8 (fh, &tmpb);
|
||||||
|
EncounterPtr->num_ships = tmpb & ENCOUNTER_SHIPS_MASK;
|
||||||
|
EncounterPtr->flags = tmpb & ENCOUNTER_FLAGS_MASK;
|
||||||
cread_16 (fh, NULL); /* alignment padding */
|
cread_16 (fh, NULL); /* alignment padding */
|
||||||
|
|
||||||
// Load each entry in the BRIEF_SHIP_INFO array
|
// Load each entry in the BRIEF_SHIP_INFO array
|
||||||
for (i = 0; i < MAX_HYPER_SHIPS; i++)
|
for (i = 0; i < MAX_HYPER_SHIPS; i++)
|
||||||
{
|
{
|
||||||
BRIEF_SHIP_INFO *ShipInfo = &EncounterPtr->ShipList[i];
|
BRIEF_SHIP_INFO *ShipInfo = &EncounterPtr->ShipList[i];
|
||||||
BYTE tmpb;
|
|
||||||
|
|
||||||
cread_16 (fh, NULL); /* useless; was SHIP_INFO.ship_flags */
|
cread_16 (fh, NULL); /* useless; was SHIP_INFO.ship_flags */
|
||||||
cread_8 (fh, &ShipInfo->race_id);
|
cread_8 (fh, &ShipInfo->race_id);
|
||||||
|
|||||||
@@ -211,17 +211,18 @@ ZapToUrquanEncounter (void)
|
|||||||
TemplatePtr = LockFleetInfo (&GLOBAL (avail_race_q), hStarShip);
|
TemplatePtr = LockFleetInfo (&GLOBAL (avail_race_q), hStarShip);
|
||||||
EncounterPtr->origin = TemplatePtr->loc;
|
EncounterPtr->origin = TemplatePtr->loc;
|
||||||
EncounterPtr->radius = TemplatePtr->actual_strength;
|
EncounterPtr->radius = TemplatePtr->actual_strength;
|
||||||
EncounterPtr->SD.Type = URQUAN_SHIP;
|
EncounterPtr->race_id = URQUAN_SHIP;
|
||||||
EncounterPtr->SD.Index = MAKE_BYTE (1, 0) | ONE_SHOT_ENCOUNTER;
|
EncounterPtr->num_ships = 1;
|
||||||
|
EncounterPtr->flags = ONE_SHOT_ENCOUNTER;
|
||||||
BSIPtr = &EncounterPtr->ShipList[0];
|
BSIPtr = &EncounterPtr->ShipList[0];
|
||||||
BSIPtr->race_id = URQUAN_SHIP;
|
BSIPtr->race_id = URQUAN_SHIP;
|
||||||
BSIPtr->crew_level = TemplatePtr->crew_level;
|
BSIPtr->crew_level = TemplatePtr->crew_level;
|
||||||
BSIPtr->max_crew = TemplatePtr->max_crew;
|
BSIPtr->max_crew = TemplatePtr->max_crew;
|
||||||
BSIPtr->max_energy = TemplatePtr->max_energy;
|
BSIPtr->max_energy = TemplatePtr->max_energy;
|
||||||
EncounterPtr->SD.star_pt.x = 5288;
|
EncounterPtr->loc_pt.x = 5288;
|
||||||
EncounterPtr->SD.star_pt.y = 4892;
|
EncounterPtr->loc_pt.y = 4892;
|
||||||
EncounterPtr->log_x = UNIVERSE_TO_LOGX (EncounterPtr->SD.star_pt.x);
|
EncounterPtr->log_x = UNIVERSE_TO_LOGX (EncounterPtr->loc_pt.x);
|
||||||
EncounterPtr->log_y = UNIVERSE_TO_LOGY (EncounterPtr->SD.star_pt.y);
|
EncounterPtr->log_y = UNIVERSE_TO_LOGY (EncounterPtr->loc_pt.y);
|
||||||
GLOBAL_SIS (log_x) = EncounterPtr->log_x;
|
GLOBAL_SIS (log_x) = EncounterPtr->log_x;
|
||||||
GLOBAL_SIS (log_y) = EncounterPtr->log_y;
|
GLOBAL_SIS (log_y) = EncounterPtr->log_y;
|
||||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hStarShip);
|
UnlockFleetInfo (&GLOBAL (avail_race_q), hStarShip);
|
||||||
@@ -236,8 +237,8 @@ ZapToUrquanEncounter (void)
|
|||||||
|
|
||||||
GLOBAL (CurrentActivity) = MAKE_WORD (IN_HYPERSPACE, 0) | START_ENCOUNTER;
|
GLOBAL (CurrentActivity) = MAKE_WORD (IN_HYPERSPACE, 0) | START_ENCOUNTER;
|
||||||
|
|
||||||
dx = CurStarDescPtr->star_pt.x - EncounterPtr->SD.star_pt.x;
|
dx = CurStarDescPtr->star_pt.x - EncounterPtr->loc_pt.x;
|
||||||
dy = CurStarDescPtr->star_pt.y - EncounterPtr->SD.star_pt.y;
|
dy = CurStarDescPtr->star_pt.y - EncounterPtr->loc_pt.y;
|
||||||
dx = (SIZE)square_root ((long)dx * dx + (long)dy * dy)
|
dx = (SIZE)square_root ((long)dx * dx + (long)dy * dy)
|
||||||
+ (FUEL_TANK_SCALE >> 1);
|
+ (FUEL_TANK_SCALE >> 1);
|
||||||
|
|
||||||
@@ -250,7 +251,7 @@ ZapToUrquanEncounter (void)
|
|||||||
DeltaSISGauges (0, dx, 0);
|
DeltaSISGauges (0, dx, 0);
|
||||||
}
|
}
|
||||||
DrawSISMessage (NULL);
|
DrawSISMessage (NULL);
|
||||||
DrawHyperCoords (EncounterPtr->SD.star_pt);
|
DrawHyperCoords (EncounterPtr->loc_pt);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
UnlockEncounter (hEncounter);
|
UnlockEncounter (hEncounter);
|
||||||
|
|||||||
+7
-5
@@ -276,11 +276,13 @@ SaveEncounter (const ENCOUNTER *EncounterPtr, DECODE_REF fh)
|
|||||||
cwrite_16 (fh, EncounterPtr->origin.x);
|
cwrite_16 (fh, EncounterPtr->origin.x);
|
||||||
cwrite_16 (fh, EncounterPtr->origin.y);
|
cwrite_16 (fh, EncounterPtr->origin.y);
|
||||||
cwrite_16 (fh, EncounterPtr->radius);
|
cwrite_16 (fh, EncounterPtr->radius);
|
||||||
// STAR_DESC fields
|
// former STAR_DESC fields
|
||||||
cwrite_16 (fh, EncounterPtr->SD.star_pt.x);
|
cwrite_16 (fh, EncounterPtr->loc_pt.x);
|
||||||
cwrite_16 (fh, EncounterPtr->SD.star_pt.y);
|
cwrite_16 (fh, EncounterPtr->loc_pt.y);
|
||||||
cwrite_8 (fh, EncounterPtr->SD.Type);
|
cwrite_8 (fh, EncounterPtr->race_id);
|
||||||
cwrite_8 (fh, EncounterPtr->SD.Index);
|
// XXX: writing combined fields to maintain savegame compatibility
|
||||||
|
cwrite_8 (fh, (EncounterPtr->num_ships & ENCOUNTER_SHIPS_MASK)
|
||||||
|
| (EncounterPtr->flags & ENCOUNTER_FLAGS_MASK));
|
||||||
cwrite_16 (fh, 0); /* alignment padding */
|
cwrite_16 (fh, 0); /* alignment padding */
|
||||||
|
|
||||||
// Save each entry in the BRIEF_SHIP_INFO array
|
// Save each entry in the BRIEF_SHIP_INFO array
|
||||||
|
|||||||
Reference in New Issue
Block a user