47 if (initializeCockpit != 0) {
56 for (
object = 0;
object < 10;
object++) {
63 for (
object = 0;
object < 10;
object++) {
71 maximumRange = 0x4b000;
79 if (maximumRange < range)
85 }
while (
object >= 0);
86 if (maximumRange <= 0x1f4000)
87 playerRange = maximumRange;
89 playerRange = 0x4b000;
90 maximumRange = playerRange;
94 cameraDistance = (playerRange >> 3) * 9 + 0x2bc00;
101 cameraDistance >> 2, &offset);
108 cameraDistance, &offset);
116 if (maximumRange < 0x271000)
224 &desiredPosition, &positionDelta);
225 vector = positionDelta;
259 if (magnitude > 0x7d000) {
322 if (magnitude > 0xfa00) {
335 &vector, &adjustment,
418 if (magnitude < 0x25800) {
517 -1200 << 8, &vector);
668 short forwardDistance,
int rightOffset,
676 (
int)forwardDistance << 8, &offset);
679 rightOffset, &offset);
705 for (obj = 34; obj < 49; obj++) {
746 unsigned int hazardActive;
751 200 << 8, &cameraMotion);
758 for (obj = 34; obj < 49; obj++) {
761 if (hazardActive == 0) {
770 }
else if (obj < 42) {
811 if (viewMotion.
z >= 0) {
814 0, (
short)(viewMotion.
z >> 8));
824 shift = (
unsigned char)(viewMotion.
z <= 0 ? 9 : 8);
826 viewMotion.
x + ((int)rightRandom << shift);
827 upOffset = viewMotion.
y + ((int)upRandom << shift);
828 start_dust(obj, origin, distance, rightOffset, upOffset);
847int explode(
short attacker,
short victim);
1059 int afterburnerSpeed;
1126 if (magnitude > 0) {
1128 if ((
short)
alert_flag(obj, 1) != 0 && acceleration < 0x500)
1129 acceleration = 0x500;
1142 magnitude) + 0x200);
1144 DivideFixed(acceleration >> 1, magnitude), 0x100);
1168 unsigned char *animation;
1181 switch (command & 0xf000) {
1182 unsigned short scale;
1186 command = *(
unsigned short *)(animation +
1195 switch (command & 0x0c00) {
1202 scale = (
unsigned short)delay;
1204 scale - (command & 0x3f) * ((
unsigned short)delay >> 6);
1302 while (fragments > 0) {
1330 int separationScale;
1336 short projectileDamage;
1341 if (partner != -1) {
1359 if (abs(impact.
pitch) < 45) {
1360 if (abs(impact.
yaw) < 45)
1362 else if (abs(impact.
yaw) > 135)
1370 }
else if (impact.
pitch < 0)
1385 &response, partner);
1433 &response, partner);
1457 (
signed char)partner;
1463 separationScale =
MinInt(separationScale, 0x7d000);
1465 separationScale, &response);
1473 &response, &tangent);
1480 damage = (short)((damage * damage) >> 1);
1488 responseScale =
MinInt(
MaxInt(0x40, responseScale), 0x400);
1509 &partnerComponent, &tangent);
short nCurrentExternalViewDistance
enum ShipTactic aeShipTacticArray[12]
signed char abShipExhaustHeatList[10]
unsigned short nPendingHudMessageColour
int bAfterburnerSfxEnabled
short nRenderedSpaceFrame
int nCapitalShipViewDistance
short asObjScreenAngles[SPACE_OBJECT_COUNT]
enum ShipManeuver aeShipManeuversTable[12]
ObjectTypeData aObjectTypeData[OBJECT_TYPE_COUNT]
signed char abShipNavPtIdx[16]
short anObjectRollRotationList[SPACE_OBJECT_COUNT]
short anObjectYawRotation[SPACE_OBJECT_COUNT]
short anObjPitchRot[SPACE_OBJECT_COUNT]
short asShipAccumulatedDmg[SPACE_OBJECT_COUNT]
short asScannerBackgroundColour[10]
FixedVector aObjectViewPositionsList[SPACE_OBJECT_COUNT]
short nFacingToTargetValue
HazardField * pActiveHazardField
FixedVector aShipRightVector[64]
ShortPoint stCockpitExplosionPosition
enum ObjectClass aeObjectClass[SPACE_OBJECT_COUNT]
short nEyePitchTargetValue
unsigned int anCockpitDamageState[4]
short nPlayerCollisionObject
short asScannerObjectY[11]
FixedVector vStarFieldMotion
short aPaletteFadeEntries[6][3]
FixedVector aShipVelocity[SPACE_OBJECT_COUNT]
short asObjectCollisionRadius[64]
short asShipAfterburnerTimer[16]
short nCarrierMissionShipIndexValue
short nEyeRollTargetValue
Viewport stSpaceBufferViewport
short asScannerObjectPositionX[11]
short asObjectCounterArray[SPACE_OBJECT_COUNT]
FixedVector aShipUpVector[64]
short asObjectScreenXList[SPACE_OBJECT_COUNT]
signed char acObjOwnersTable[64]
short nCurrentSpaceFrameValue
unsigned char bLandingAuthorized
unsigned char abCockpitLightGoalArray[7]
unsigned short awObjectScales[SPACE_OBJECT_COUNT]
signed char acObjCollisionGraceTicks[SPACE_OBJECT_COUNT]
enum ObjectType aeObjectTypeList[SPACE_OBJECT_COUNT]
signed char acLastCollisionObjects[SPACE_OBJECT_COUNT]
short asObjectViewFrames[SPACE_OBJECT_COUNT]
short asObjectFlipArray[SPACE_OBJECT_COUNT]
unsigned short awObjMassArray[SPACE_OBJECT_COUNT]
MissionShipRecord aMissionShips[MISSION_SHIP_STORAGE_COUNT]
signed char acPreviousAttackers[16]
short asObjectAnimationDelay[SPACE_OBJECT_COUNT]
short nShipMissionIndices[10]
FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]
int nCurrentDamageAlarmSfxHandle
FixedVector aShipFwdVec[64]
signed char acShipTargetTable[16]
enum SpecialManeuver aeSpecialManeuvers[12]
FixedVector vCollisionDelta
int bPlayerCollisionsEnabled
short asObjectAnimIndexes[SPACE_OBJECT_COUNT]
signed char acShipAiCooldowns[16]
FixedVector vPreviousStarFieldMotion
int bPlayerCollisionResponse
short nStarFieldIRotValue
static int bAlternateChaseView
short nCurrentStarFieldJRotationValue
unsigned char * animation
Umbrella header for the game core.
short match_roll_orientation(short obj, short reference)
void transform_to_objects_frame(const FixedVector *source, FixedVector *destination, short obj)
unsigned int approach_zero_speed(short ship)
unsigned int initialize_cockpit(int requestedMode)
void apply_force_to_object(FixedVector *point, FixedVector *force, short obj)
short count_down(short obj)
short ShipExplosion(short obj)
unsigned int object_intelligence(short obj)
void make_shard(short asteroid, FixedVector direction)
long MultiplyFixed(int left, int right)
void fix_objects_ijk(short obj)
void FillFixedVectorWithRandomComponents(short limit, FixedVector *vector)
unsigned int generate_stars(void)
void rotate_about_i(short angle, FixedVector *j, FixedVector *k)
int dot_product(const FixedVector *left, const FixedVector *right)
void remove_object(short obj)
int explosion_shock_wave(short obj, short blastDamage)
void alter_pitch(short angle, short obj)
unsigned int force_view(int view, short obj)
long Vector_magnitude(const FixedVector *vector)
unsigned int animate_shape(short obj)
unsigned int hit_asteroid(short asteroid, short destructionChance)
void AddFixedVectors(const FixedVector *left, const FixedVector *right, FixedVector *sum)
unsigned int match_rotation_goal(short *rotation, short *goal, short totalError, short rate)
void set_objects_data(short obj, enum ObjectType type, short owner)
int object_collision(short obj)
short easy2see(short obj)
void alter_roll(short angle, short obj)
void position_relative_ijk(FixedVector *position, short obj, short right, short up, short forward)
int inflict_damage(short attacker, short victim, short damage, const FixedVector *impactDirection)
short check_for_collision(short obj)
unsigned int GetFixedOneMillionThunkAlt(short memoryType)
void FF_missile_intelligence(short obj)
void rotational_acceleration(FixedVector *point, FixedVector *force, short obj)
short FixedToShortSaturating(int value)
unsigned int housekeep_power_plant_and_fuel(short ship)
int rotate_object_to_goal(short obj)
unsigned int house_keep_objects(void)
unsigned int GetScreenUpdateFlag(void)
short get_ship_max_velocity(short obj)
void SetFleetOverviewView(int initializeCockpit)
int onboard_explosion(short obj)
void point_ship(short obj, short turnRate, const FixedVector *direction)
unsigned int replenish_weapon_energy_bank(short ship)
void clear_crash_cache(void)
unsigned int update_objects_in_space(void)
int explode(short attacker, short victim)
void extra_hazard(short obj)
void copy_frame(short source, short destination)
unsigned int initialize_view_buffer(void)
short signed_random(short range)
void alter_yaw(short angle, short obj)
short GetVectorMagnitude(const FixedVector *vector)
unsigned int rotate_object(short obj)
unsigned int set_special(short ship, enum SpecialManeuver special)
void ScaleFixedVector(const FixedVector *vector, int scale, FixedVector *result)
void SetVectorFixedPoint(FixedVector *p, short v)
void send_message(short obj, short message)
unsigned int rotate_eye_to_goal(void)
long DivideFixed(int numerator, int denominator)
unsigned int accelerate_and_move_object(short obj)
void zero_vector(FixedVector *vector)
void SubtractFixedVectors(FixedVector *left, FixedVector *right, FixedVector *difference)
unsigned int update_canned_sequence(short obj)
unsigned int update_scripted_view(void)
void ship_intelligence(short obj)
unsigned int update_star_field(void)
short find_vacant_3d_object(void)
void get_facing_range_from_object(short obj, short other)
void rectangular_to_spherical(const FixedVector *rectangular, SphericalVector *spherical)
void PlaySfxWaveFileByNumber()
unsigned int shrink_vector(FixedVector *vector)
unsigned int Create_explosion_debris(short obj)
void capital_ship_intelligence(short obj)
unsigned int new_view(int view, short obj)
void point_at(short obj, FixedVector point)
void futurion_intelligence(short obj)
void NormalizeAndScaleVector(FixedVector *vector, int scale)
void mine_intelligence(short obj)
unsigned int animate_object(short obj)
void ClampVectorTo30(short *p)
void divide_vector(FixedVector *vector, int divisor, FixedVector *result)
void ComputeVectorDelta(const FixedVector *from, const FixedVector *to, FixedVector *delta)
void heat_seeking_missile_intelligence(short obj)
void __stdcall SetViewportRect(Viewport *viewport, unsigned short left, unsigned short top, unsigned short right, unsigned short bottom)
unsigned int set_eye_direction_and_position(void)
void FlushSoundEffectsAndLog(int soundHandle, short fadeTicks)
short MaxShort(short a, short b,...)
void vector_component_in_dir(const FixedVector *vector, const FixedVector *direction, FixedVector *component)
unsigned int start_dust(short obj, FixedVector origin, short forwardDistance, int rightOffset, int upOffset)
short normal_speed(short obj)
short find_ship_index(short missionShip)
short __stdcall RandomInRange(short lo, short hi)
void update_hazards(void)
int alert_flag(short ship, unsigned int bits)
unsigned int replenish_shields(short ship)
void reset_maneuver(short ship, short maneuver)
short RandomBelowOrEqual(short n)
short NormalizeFixedVector(FixedVector *vector)
void drain_fuel(short ship, short amount)
void negate_vector(FixedVector *vector)
void rotate_about_j(short angle, FixedVector *i, FixedVector *k)
int GetShipAccelerationRate(short ship)
#define SPACE_LAST_MOVING_OBJECT
@ OBJECT_TYPE_TIGERS_CLAW
@ OBJECT_TYPE_HEAT_SEEKING_MISSILE
@ OBJECT_TYPE_DEBRIS_METAL_SHEET
@ OBJECT_TYPE_DEBRIS_WING
@ OBJECT_TYPE_DEBRIS_DUST
@ OBJECT_TYPE_IMAGE_RECOGNITION_MISSILE
@ OBJECT_TYPE_LASER_SPARK
@ OBJECT_TYPE_DUMB_FIRE_MISSILE
@ SPECIAL_MANEUVER_STOP_DRIFT
@ SPECIAL_MANEUVER_SUPER_BRAKE
@ SPECIAL_MANEUVER_UNKNOWN_9
@ SPECIAL_MANEUVER_KILL_ENGINES
@ SPECIAL_MANEUVER_AFTERBURNER
@ OBJECT_CLASS_FIXED_OBJECT
@ OBJECT_CLASS_CAPITAL_SHIP
@ OBJECT_CLASS_PROJECTILE