24 int savedOriginUnlock;
26 int savedKeyboardFlag;
37 while (frames-- > 0) {
81 lateral = (*formationSlot & 1) ? 650 : -650;
85 forward =
MaxShort(1, (
short)(*formationSlot >> 1));
86 forward = (short)(forward * -1800);
96 if (radii > separation)
100 lateral, vertical, forward);
106 short savedCannedSceneMode;
107 short leaveCurrentNavPoint;
110 signed char travelMode[10];
112 short destinationRange;
115 short initialDistance;
117 short nearestShipRange;
123 leaveCurrentNavPoint = 1;
133 leaveCurrentNavPoint = 0;
139 for (ship = 0; ship < 10; ship++) {
140 travelMode[ship] = 0;
150 travelMode[ship] = -1;
163 }
else if (leaveCurrentNavPoint != 0) {
175 for (ship = 0; ship < 10; ship++) {
176 if (travelMode[ship] == -1 && ship != 0) {
179 travelMode[ship] = 1;
183 travelMode[ship] = 2;
185 travelMode[ship] = 3;
190 travelMode[ship] = 1;
192 travelMode[ship] = 3;
194 if (travelMode[ship] == 1) {
212 &destination, &travelStep);
221 nearestShipRange = 0x7fff;
222 for (other = 0; other < 10; other++) {
224 travelMode[other] == 0)
229 if ((
unsigned short)destinationRange < 1000 ||
231 nearestShipRange < 4000 ||
239 for (ship = 0; ship < 10; ship++) {
240 if (travelMode[ship] != 0) {
241 short shipCruiseSpeed;
245 if (shipCruiseSpeed < cruiseSpeed)
246 cruiseSpeed = shipCruiseSpeed;
251 for (ship = 0; ship < 10; ship++) {
252 if (travelMode[ship] != 0) {
255 switch (travelMode[ship]) {
301 unsigned char *palette;
307 file = fopen(path,
"rb");
309 fseek(file, 0x30, SEEK_SET);
310 fread(palette, 0x300, 1, file);
static short nAutopilotFormationShipCount
ObjectTypeData aObjectTypeData[OBJECT_TYPE_COUNT]
short anObjectRollRotationList[SPACE_OBJECT_COUNT]
short anObjectYawRotation[SPACE_OBJECT_COUNT]
short anObjPitchRot[SPACE_OBJECT_COUNT]
ShortVector aShipFormationDeltaList[10]
FixedVector aShipDestinationsArray[10]
signed char abFlightPathList[MISSION_OBJECTIVE_COUNT]
JOYINFO aJoystickInfos[2]
short asShipMaximumSpeedArray[16]
HazardField * pActiveHazardField
MissionNavPoint aMissionNavPoints[MISSION_NAV_POINT_COUNT]
enum ObjectClass aeObjectClass[SPACE_OBJECT_COUNT]
unsigned int nSystemKeyDown
FixedVector aShipVelocity[SPACE_OBJECT_COUNT]
short asObjectCollisionRadius[64]
Viewport stSpaceBufferViewport
short asShipWingLeaderArray[16]
signed char cCurrentObjective
MissionObjective aMissionObjectivesArray[MISSION_OBJECTIVE_COUNT]
short nCurrentNavigationPoint
enum ObjectType aeObjectTypeList[SPACE_OBJECT_COUNT]
short nShipMissionIndices[10]
FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]
FixedVector aShipFwdVec[64]
short nCurrentViewCenterPosY
signed char cCurrentNavPtIdx
enum SpecialManeuver aeSpecialManeuvers[12]
int bPlayerCollisionResponse
Umbrella header for the game core.
void * AllocateTaggedMemory(int size, unsigned short flags)
short kilrathi_near(short obj, short range)
unsigned int RenderSpaceViewFrame(void)
void SetMousePosition(int x, int y)
short distance_between_points(const FixedVector *from, const FixedVector *to)
short distance_from_point(short obj, const FixedVector *point)
void __stdcall SetWholePaletteFromTriplets(unsigned char *palette)
void remove_object(short obj)
unsigned int force_view(int view, short obj)
void auto_position(short obj, short *formationSlot)
void AddFixedVectors(const FixedVector *left, const FixedVector *right, FixedVector *sum)
unsigned int player_wingman(short obj)
void position_relative_ijk(FixedVector *position, short obj, short right, short up, short forward)
unsigned short __stdcall LoadPaletteTripletsFile(const char *path)
int equ_vector(const FixedVector *left, const FixedVector *right)
void auto_pilot_sequence(void)
short MinShort(short a, short b)
unsigned int GetScreenUpdateFlag(void)
short distance_from_object(short obj, short other)
void copy_frame(short source, short destination)
unsigned int initialize_view_buffer(void)
int report_kilrathi_rout(int mode)
void ResetSoundState(void)
void visit_the_cinema(int view, int obj, short frames)
void ScaleFixedVector(const FixedVector *vector, int scale, FixedVector *result)
short auto_pilot_valid(short showReason)
void zero_vector(FixedVector *vector)
void SubtractFixedVectors(FixedVector *left, FixedVector *right, FixedVector *difference)
unsigned int fix_velocity(short obj)
void point_at(short obj, FixedVector point)
unsigned int Update_3Space(void)
void ReleasePacketHandle(void *handle)
unsigned int is_team_member(short missionShip)
void ComputeVectorDelta(const FixedVector *from, const FixedVector *to, FixedVector *delta)
unsigned int ReleaseStaleNavTarget(void)
void set_speed(short obj, short speed)
void __stdcall SetViewportRect(Viewport *viewport, unsigned short left, unsigned short top, unsigned short right, unsigned short bottom)
short MaxShort(short a, short b,...)
void clean_up_cockpit(void)
short NormalizeFixedVector(FixedVector *vector)
@ SPECIAL_MANEUVER_UNKNOWN_9