|
Wing Commander
Reconstructed Win32 source (1996)
|
Space-object simulation and the fleet overview camera. More...
Go to the source code of this file.
Functions | |
| void | SetFleetOverviewView (int initializeCockpit) |
| unsigned int | rotate_eye_to_goal (void) |
| short | GetVectorMagnitude (const FixedVector *vector) |
| unsigned int | set_eye_direction_and_position (void) |
| unsigned int | force_view (int view, short obj) |
| unsigned int | new_view (int view, short obj) |
| unsigned int | start_dust (short obj, FixedVector origin, short forwardDistance, int rightOffset, int upOffset) |
| unsigned int | generate_stars (void) |
| unsigned int | update_star_field (void) |
| short | count_down (short obj) |
| int | explode (short attacker, short victim) |
| unsigned int | house_keep_objects (void) |
| unsigned int | update_objects_in_space (void) |
| unsigned int | rotate_object (short obj) |
| unsigned int | accelerate_and_move_object (short obj) |
| unsigned int | animate_shape (short obj) |
| unsigned int | animate_object (short obj) |
| void | make_shard (short asteroid, FixedVector direction) |
| short | check_for_collision (short obj) |
| void | rectangular_to_spherical (const FixedVector *rectangular, SphericalVector *spherical) |
| void | apply_force_to_object (FixedVector *point, FixedVector *force, short obj) |
| int | inflict_damage (short attacker, short victim, short damage, const FixedVector *impactDirection) |
| int | MaxInt (int a, int b) |
| void | rotational_acceleration (FixedVector *point, FixedVector *force, short obj) |
| unsigned int | hit_asteroid (short asteroid, short destructionChance) |
| short | easy2see (short obj) |
| unsigned int | update_canned_sequence (short obj) |
| void | mine_intelligence (short obj) |
| short | get_ship_max_velocity (short obj) |
| void | heat_seeking_missile_intelligence (short obj) |
| void | FF_missile_intelligence (short obj) |
| int | object_collision (short obj) |
| unsigned int | object_intelligence (short obj) |
Variables | |
| int | nCapitalShipViewDistance = 0x7d000 |
| unsigned char | bLandingAuthorized = 0 |
| static int | bAlternateChaseView = 0 |
| short | asScannerObjectY [11] |
| ShortPoint | stCockpitExplosionPosition |
| short | asScannerObjectPositionX [11] |
| unsigned char | abCockpitLightGoalArray [7] |
| int | nCurrentDamageAlarmSfxHandle |
| short | asScannerBackgroundColour [10] |
| unsigned int | anCockpitDamageState [4] |
| unsigned short | nPendingHudMessageColour |
| short | nCurrentStarFieldJRotationValue |
| short | nStarFieldIRotValue |
Space-object simulation and the fleet overview camera.
Address range 410740-413a0f. The Mac spc symbol run identifies rotate_eye_to_goal through object_intelligence.
Definition in file spc.c.
| unsigned int accelerate_and_move_object | ( | short | obj | ) |
Definition at line 1053 of file spc.c.
References abShipExhaustHeatList, accelerate_and_move_object(), AddFixedVectors(), aeObjectClass, aeObjectTypeList, aeShipTacticArray, aeSpecialManeuvers, alert_flag(), anShipSpeed, aObjectTypeData, approach_zero_speed(), aShipFwdVec, aShipPositionsArray, aShipVelocity, asShipAfterburnerTimer, bAfterburnerSfxEnabled, ComputeVectorDelta(), DivideFixed(), dot_product(), drain_fuel(), FlushSoundEffectsAndLog(), GetShipAccelerationRate(), ObjectTypeData::maximumVelocity, MinInt(), MultiplyFixed(), NormalizeAndScaleVector(), OBJECT_CLASS_MISSILE, RandomBelowOrEqual(), ScaleFixedVector(), set_special(), SPECIAL_MANEUVER_AFTERBURNER, SPECIAL_MANEUVER_KILL_ENGINES, SPECIAL_MANEUVER_NONE, SPECIAL_MANEUVER_STOP_DRIFT, SPECIAL_MANEUVER_SUPER_BRAKE, TACTIC_SIT_STILL, Vector_magnitude(), vPlayerAccel, and zero_vector().
Referenced by accelerate_and_move_object(), and update_objects_in_space().
| unsigned int animate_object | ( | short | obj | ) |
Definition at line 1224 of file spc.c.
References AddFixedVectors(), aeObjectClass, aeObjectTypeList, animate_object(), animate_shape(), aObjectTypeData, aShipFwdVec, aShipPositionsArray, aShipVelocity, asObjectCollisionRadius, asObjectScreenXList, asShipAccumulatedDmg, awObjectScales, FillFixedVectorWithRandomComponents(), find_vacant_3d_object(), nRenderedSpaceFrame, OBJECT_CLASS_ASTEROID, OBJECT_CLASS_DEBRIS, OBJECT_CLASS_EXPLOSION, OBJECT_CLASS_FIXED_OBJECT, OBJECT_CLASS_MINE, OBJECT_CLASS_SHIP, OBJECT_TYPE_RED_SPARK, PlaySfxWaveFileByNumber(), RandomInRange(), ScaleFixedVector(), set_objects_data(), and zero_vector().
Referenced by animate_object(), and update_objects_in_space().
| unsigned int animate_shape | ( | short | obj | ) |
Definition at line 1165 of file spc.c.
References aeObjectTypeList, animate_shape(), ObjectTypeData::animation, aObjectTypeData, asObjectAnimationDelay, asObjectAnimIndexes, asObjectFlipArray, asObjectScreenXList, asObjectViewFrames, awObjectScales, OBJECT_TYPE_DEBRIS_METAL_SHEET, OBJECT_TYPE_DEBRIS_WING, PlaySfxWaveFileByNumber(), remove_object(), and ObjectTypeData::yawRate.
Referenced by animate_object(), animate_shape(), and set_objects_data().
| void apply_force_to_object | ( | FixedVector * | point, |
| FixedVector * | force, | ||
| short | obj ) |
| short count_down | ( | short | obj | ) |
Definition at line 839 of file spc.c.
References asObjectCounterArray, and count_down().
Referenced by count_down(), and house_keep_objects().
| unsigned int force_view | ( | int | view, |
| short | obj ) |
Definition at line 464 of file spc.c.
References force_view(), nCameraViewMode, and new_view().
Referenced by auto_pilot_sequence(), force_view(), HandleSpaceFlightControls(), InflightComputer(), LaunchPlayerShip(), parse_view_script(), ShowGetReadyScreen(), stranded_sequence(), and visit_the_cinema().
| unsigned int generate_stars | ( | void | ) |
Definition at line 696 of file spc.c.
References aeObjectClass, aShipFwdVec, aShipPositionsArray, aShipRightVector, aShipUpVector, asObjectViewFrames, copy_frame(), EYE_OBJECT, generate_stars(), nCurrentStarFieldJRotationValue, nStarFieldIRotValue, OBJECT_CLASS_STAR, RandomInRange(), rotate_about_i(), rotate_about_j(), ScaleFixedVector(), signed_random(), start_dust(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by generate_stars(), new_view(), set_eye_direction_and_position(), and ShowGameOverScreen().
| short GetVectorMagnitude | ( | const FixedVector * | vector | ) |
Definition at line 146 of file spc.c.
References FixedToShortSaturating(), GetVectorMagnitude(), and Vector_magnitude().
Referenced by GetVectorMagnitude().
| unsigned int hit_asteroid | ( | short | asteroid, |
| short | destructionChance ) |
Definition at line 1296 of file spc.c.
References aShipVelocity, explode(), hit_asteroid(), make_shard(), RandomBelowOrEqual(), and vCollisionDelta.
Referenced by hit_asteroid(), and object_collision().
| unsigned int house_keep_objects | ( | void | ) |
Definition at line 850 of file spc.c.
References abShipExhaustHeatList, abShipNavPtIdx, acObjCollisionGraceTicks, acObjOwnersTable, acPreviousAttackers, aeObjectClass, aeObjectTypeList, aeShipManeuversTable, aeShipSide, aeShipTacticArray, aeSpecialManeuvers, aMissionShips, aObjectTypeData, aShipFwdVec, aShipVelocity, asObjectCounterArray, asObjectScreenXList, awObjectScales, bLandingAuthorized, bPlayerCollisionsEnabled, count_down(), Create_explosion_debris(), explode(), explosion_shock_wave(), get_facing_range_from_object(), house_keep_objects(), ObjectTypeData::lifetime, MANEUVER_WARPING_IN, MANEUVER_WARPING_OUT, nArcadeState, nFacingToTargetValue, normal_speed(), nPlayerCollisionObject, nShipMissionIndices, nTargetFacingValue, nTgtRange, nYourWingman, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_DEBRIS, OBJECT_CLASS_DUST, OBJECT_CLASS_FIXED_OBJECT, OBJECT_CLASS_MINE, OBJECT_CLASS_MISSILE, OBJECT_CLASS_PROJECTILE, OBJECT_CLASS_SHIP, OBJECT_TYPE_DEBRIS_DUST, OBJECT_TYPE_DUMB_FIRE_MISSILE, OBJECT_TYPE_THRUSTERS, OBJECT_TYPE_TIGERS_CLAW, OBJECT_TYPE_TURRET, onboard_explosion(), RandomBelowOrEqual(), RandomInRange(), remove_object(), reset_maneuver(), send_message(), set_objects_data(), ShipExplosion(), SIDE_KILRATHI, SIDE_NEUTRAL, SPACE_LAST_MOVING_OBJECT, SPECIAL_MANEUVER_UNKNOWN_9, MissionShipRecord::state, TACTIC_RAM, TACTIC_SIT_STILL, TACTIC_WARP_IN, and vector_component_in_dir().
Referenced by house_keep_objects(), ShowCarrierLaunchSequence(), and Update_3Space().
| int inflict_damage | ( | short | attacker, |
| short | victim, | ||
| short | damage, | ||
| const FixedVector * | impactDirection ) |
| void make_shard | ( | short | asteroid, |
| FixedVector | direction ) |
| unsigned int new_view | ( | int | view, |
| short | obj ) |
Definition at line 472 of file spc.c.
References AddFixedVectors(), aeObjectClass, aShipFwdVec, aShipPositionsArray, aShipRightVector, aShipUpVector, aShipVelocity, asObjectCollisionRadius, bAlternateChaseView, bScriptedView, ComputeVectorDelta(), copy_frame(), cViewObject, EYE_OBJECT, find_ship_index(), fix_objects_ijk(), generate_stars(), initialize_cockpit(), look_at(), MaxShort(), nCameraViewMode, nCarrierMissionShipIndexValue, nCurrentExternalViewDistance, negate_vector(), new_view(), nExternalViewAngle, nExternalViewShip, nEyePitchRate, nEyePitchTargetValue, nEyeRollRate, nEyeRollTargetValue, nEyeYawGoalValue, nEyeYawRate, NormalizeFixedVector(), nYourWingman, OBJECT_CLASS_CAPITAL_SHIP, position_relative_ijk(), ScaleFixedVector(), set_eye_direction_and_position(), SetFleetOverviewView(), FixedVector::x, FixedVector::y, FixedVector::z, and zero_vector().
Referenced by death_sequence(), ejection_sequence(), force_view(), HandleSpaceFlightControls(), new_view(), RunSpaceFlight(), and set_eye_direction_and_position().
| int object_collision | ( | short | obj | ) |
Definition at line 1322 of file spc.c.
References acLastCollisionObjects, acObjCollisionGraceTicks, acObjOwnersTable, acPreviousAttackers, acShipAiCooldowns, AddFixedVectors(), aeObjectClass, anShipSpeed, aObjectViewPositionsList, aPaletteFadeEntries, apply_force_to_object(), aShipPositionsArray, aShipVelocity, asObjectCollisionRadius, asObjectCounterArray, asObjectScreenXList, asShipAccumulatedDmg, awObjectScales, awObjMassArray, bPlayerCollisionResponse, check_for_collision(), ComputeVectorDelta(), DivideFixed(), easy2see(), explode(), hit_asteroid(), inflict_damage(), MaxInt(), MinInt(), MultiplyFixed(), nCameraViewMode, negate_vector(), NormalizeFixedVector(), OBJECT_CLASS_ASTEROID, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_MINE, OBJECT_CLASS_MISSILE, OBJECT_CLASS_PROJECTILE, OBJECT_CLASS_SHIP, object_collision(), OBJECT_TYPE_LASER_SPARK, SphericalVector::pitch, PlaySfxWaveFileByNumber(), rectangular_to_spherical(), remove_object(), rotational_acceleration(), ScaleFixedVector(), set_objects_data(), SubtractFixedVectors(), vCollisionDelta, vector_component_in_dir(), Vector_magnitude(), SphericalVector::yaw, and zero_vector().
Referenced by object_collision(), and update_objects_in_space().
| unsigned int object_intelligence | ( | short | obj | ) |
Definition at line 1545 of file spc.c.
References acShipTargetTable, aeObjectClass, aeObjectTypeList, anShipSpeed, capital_ship_intelligence(), FF_missile_intelligence(), futurion_intelligence(), get_facing_range_from_object(), get_ship_max_velocity(), heat_seeking_missile_intelligence(), mine_intelligence(), nCannedSceneMode, nCurrentSpaceFrameValue, nExternalViewShip, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_FUTURION, OBJECT_CLASS_MINE, OBJECT_CLASS_MISSILE, OBJECT_CLASS_SHIP, object_intelligence(), OBJECT_TYPE_DUMB_FIRE_MISSILE, OBJECT_TYPE_FF_MISSILE, OBJECT_TYPE_HEAT_SEEKING_MISSILE, OBJECT_TYPE_IMAGE_RECOGNITION_MISSILE, point_ship(), ship_intelligence(), update_canned_sequence(), and vToTgt.
Referenced by object_intelligence(), and update_objects_in_space().
| void rectangular_to_spherical | ( | const FixedVector * | rectangular, |
| SphericalVector * | spherical ) |
| unsigned int rotate_eye_to_goal | ( | void | ) |
Definition at line 123 of file spc.c.
References anObjectRollRotationList, anObjectYawRotation, anObjPitchRot, match_rotation_goal(), nEyePitchRate, nEyePitchTargetValue, nEyeRollRate, nEyeRollTargetValue, nEyeYawGoalValue, nEyeYawRate, and rotate_eye_to_goal().
Referenced by rotate_eye_to_goal(), and set_eye_direction_and_position().
| unsigned int rotate_object | ( | short | obj | ) |
Definition at line 1035 of file spc.c.
References alter_pitch(), alter_roll(), alter_yaw(), anObjectRollRotationList, anObjectYawRotation, anObjPitchRot, ClampVectorTo30(), and rotate_object().
Referenced by rotate_object(), set_eye_direction_and_position(), and update_objects_in_space().
| void rotational_acceleration | ( | FixedVector * | point, |
| FixedVector * | force, | ||
| short | obj ) |
| unsigned int set_eye_direction_and_position | ( | void | ) |
Definition at line 152 of file spc.c.
References acShipTargetTable, AddFixedVectors(), aeObjectClass, aeShipTacticArray, aShipFwdVec, aShipPositionsArray, aShipRightVector, aShipUpVector, aShipVelocity, bAlternateChaseView, bCockpitlessView, bScriptedView, ComputeVectorDelta(), copy_frame(), cViewObject, divide_vector(), EYE_OBJECT, fix_objects_ijk(), generate_stars(), GetScreenUpdateFlag(), initialize_view_buffer(), look_at(), match_roll_orientation(), MaxShort(), nCameraViewMode, nCapitalShipViewDistance, nCurrentExternalViewDistance, negate_vector(), new_view(), nExternalViewAngle, nExternalViewShip, nEyeRollRate, nEyeRollTargetValue, NormalizeFixedVector(), nScreenHeight, nScreenWidth, OBJECT_CLASS_NULL, rotate_eye_to_goal(), rotate_object(), ScaleFixedVector(), set_eye_direction_and_position(), SetFleetOverviewView(), SetVectorFixedPoint(), SetViewportRect(), shrink_vector(), stSpaceBufferViewport, SubtractFixedVectors(), TACTIC_CRUISE, update_scripted_view(), Vector_magnitude(), FixedVector::x, FixedVector::y, FixedVector::z, and zero_vector().
Referenced by new_view(), set_eye_direction_and_position(), ShowCarrierLaunchSequence(), ShowGameOverScreen(), and Update_3Space().
| void SetFleetOverviewView | ( | int | initializeCockpit | ) |
Definition at line 31 of file spc.c.
References AddFixedVectors(), aeObjectClass, aShipFwdVec, aShipPositionsArray, aShipRightVector, aShipUpVector, aShipVelocity, ComputeVectorDelta(), EYE_OBJECT, GetFixedOneMillionThunkAlt(), GetScreenUpdateFlag(), initialize_cockpit(), OBJECT_CLASS_SHIP, point_at(), position_relative_ijk(), ScaleFixedVector(), SetFleetOverviewView(), Vector_magnitude(), FixedVector::x, FixedVector::y, FixedVector::z, and zero_vector().
Referenced by new_view(), set_eye_direction_and_position(), and SetFleetOverviewView().
| unsigned int start_dust | ( | short | obj, |
| FixedVector | origin, | ||
| short | forwardDistance, | ||
| int | rightOffset, | ||
| int | upOffset ) |
Definition at line 667 of file spc.c.
References AddFixedVectors(), aShipFwdVec, aShipPositionsArray, aShipRightVector, aShipUpVector, aShipVelocity, asObjScreenAngles, EYE_OBJECT, FillFixedVectorWithRandomComponents(), MaxShort(), OBJECT_TYPE_SPACE_DUST, RandomInRange(), ScaleFixedVector(), set_objects_data(), and start_dust().
Referenced by generate_stars(), start_dust(), and update_star_field().
| unsigned int update_objects_in_space | ( | void | ) |
Definition at line 985 of file spc.c.
References accelerate_and_move_object(), aeObjectClass, aeSpecialManeuvers, animate_object(), clear_crash_cache(), futurion_intelligence(), housekeep_power_plant_and_fuel(), OBJECT_CLASS_FUTURION, OBJECT_CLASS_MISSILE, OBJECT_CLASS_NULL, OBJECT_CLASS_PLANET, OBJECT_CLASS_PROJECTILE, OBJECT_CLASS_SHIP, object_collision(), object_intelligence(), replenish_shields(), replenish_weapon_energy_bank(), rotate_object(), rotate_object_to_goal(), SPACE_LAST_MOVING_OBJECT, SPECIAL_MANEUVER_UNKNOWN_9, and update_objects_in_space().
Referenced by ShowCarrierLaunchSequence(), Update_3Space(), and update_objects_in_space().
| unsigned int update_star_field | ( | void | ) |
Definition at line 733 of file spc.c.
References AddFixedVectors(), aeObjectClass, anObjectYawRotation, anObjPitchRot, aShipFwdVec, aShipPositionsArray, aShipRightVector, aShipUpVector, aShipVelocity, asObjectCollisionRadius, asObjectScreenXList, asObjectViewFrames, ComputeVectorDelta(), copy_frame(), extra_hazard(), EYE_OBJECT, nCurrentStarFieldJRotationValue, nStarFieldIRotValue, OBJECT_CLASS_ASTEROID, OBJECT_CLASS_DUST, OBJECT_CLASS_NULL, OBJECT_CLASS_STAR, OBJECT_TYPE_SPACE_DUST, pActiveHazardField, RandomInRange(), rotate_about_i(), rotate_about_j(), ScaleFixedVector(), set_objects_data(), signed_random(), start_dust(), transform_to_objects_frame(), update_hazards(), update_star_field(), vPreviousStarFieldMotion, vStarFieldMotion, FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by Draw_3Space_Frame(), ShowCarrierLaunchSequence(), and update_star_field().
| unsigned char abCockpitLightGoalArray[7] |
Definition at line 22 of file spc.c.
Referenced by draw_cockpit_lights(), house_keep(), reset_cockpit(), SetCockpitLightBlink(), update_lights(), and update_missile_warning().
| unsigned int anCockpitDamageState[4] |
Definition at line 25 of file spc.c.
Referenced by clear_cockpit_damage(), explosion_draw(), and place_damage_on_cockpit().
| short asScannerBackgroundColour[10] |
Definition at line 24 of file spc.c.
Referenced by clear_head_up_display(), and draw_3d_scanner().
| short asScannerObjectPositionX[11] |
Definition at line 21 of file spc.c.
Referenced by clear_head_up_display(), draw_3d_scanner(), ResetScannerContacts(), and rotational_pos_to_scanner_pos().
| short asScannerObjectY[11] |
Definition at line 19 of file spc.c.
Referenced by clear_head_up_display(), draw_3d_scanner(), and rotational_pos_to_scanner_pos().
|
static |
Definition at line 16 of file spc.c.
Referenced by new_view(), and set_eye_direction_and_position().
| unsigned char bLandingAuthorized = 0 |
Definition at line 14 of file spc.c.
Referenced by BuildCommunicationCommandMenu(), house_keep_objects(), prepare_mission(), request(), and set_up_action_sphere().
| int nCapitalShipViewDistance = 0x7d000 |
Definition at line 13 of file spc.c.
Referenced by HandleFleetOverviewInput(), and set_eye_direction_and_position().
| int nCurrentDamageAlarmSfxHandle |
Definition at line 23 of file spc.c.
Referenced by house_keep(), ResetSoundState(), and update_lights().
| short nCurrentStarFieldJRotationValue |
Definition at line 27 of file spc.c.
Referenced by generate_stars(), and update_star_field().
| unsigned short nPendingHudMessageColour |
Definition at line 26 of file spc.c.
Referenced by overlay_head_up_display(), and SetHudMessageText().
| short nStarFieldIRotValue |
Definition at line 28 of file spc.c.
Referenced by generate_stars(), and update_star_field().
| ShortPoint stCockpitExplosionPosition |
Definition at line 20 of file spc.c.
Referenced by cockpit_explosion(), DrawPendingCockpitDamage(), place_damage_on_cockpit(), RestoreCockpitExplosionBackground(), and RestoreTransientCockpitGraphics().