|
Wing Commander II
Reconstructed Win32 source (1996)
|
Asteroid and mine hazard fields. More...
#include "game.h"Go to the source code of this file.
Macros | |
| #define | g_acHazardPitchRange ((const signed char *)&g_nHazardPitchRange) |
Functions | |
| void | make_shard (short asteroid, FixedVector direction) |
| void | init_hazard (short obj, FixedVector position, short moving) |
| short | try_far_spot (FixedVector *spot, short *moving) |
| void | manage_hazard (short obj, short slot) |
| void | extra_hazard (short obj) |
| void | add_hazard_field (short type, FixedVector center, short radius, short density) |
| short | easy2see (short obj) |
| void | remove_hazard (signed char hazard) |
| void | remove_all_hazards (void) |
| short | difficulty (void) |
| short | asteroid_velocity (void) |
| void | skew_randomly (short obj, short allowReverse) |
| void | align (int *value, short quantum) |
| short | near_field (const HazardField *field, const FixedVector *point) |
| short | within_field (const HazardField *field, const FixedVector *point) |
| short | rear_sphere (void) |
| short | ok_hazard_spot (short obj) |
| short | make_hazard (void) |
| void | approach (short obj) |
| void | match_ship_to_eye (void) |
| void | update_hazards (void) |
| void | start_hazard_field (short region) |
| void | check_hazards (void) |
Variables | |
| short | g_nHazardReferenceSpeed = 0 |
| short | g_nActiveHazards = 0 |
Asteroid and mine hazard fields.
Definition in file fields.c.
| #define g_acHazardPitchRange ((const signed char *)&g_nHazardPitchRange) |
Definition at line 13 of file fields.c.
Referenced by try_far_spot().
| void add_hazard_field | ( | short | type, |
| FixedVector | center, | ||
| short | radius, | ||
| short | density ) |
Definition at line 411 of file fields.c.
References add_hazard_field(), HazardField::center, HazardField::density, g_aHazardFields, g_nHazardFieldCount, HazardField::innerRadius, HazardField::outerRadius, and HazardField::type.
Referenced by add_hazard_field(), and init_ship().
| void align | ( | int * | value, |
| short | quantum ) |
Definition at line 134 of file fields.c.
References align().
Referenced by align(), and init_hazard().
| void approach | ( | short | obj | ) |
Definition at line 324 of file fields.c.
References AddFixedVectors(), approach(), g_aShipForwardVector, g_aShipPosition, g_aShipVelocity, g_nCannedSceneMode, point_at(), RecordCannedSceneObjectEvent(), and ScaleFixedVector().
Referenced by ApplyCannedSceneObjectEventRecord(), approach(), and manage_hazard().
| short asteroid_velocity | ( | void | ) |
Definition at line 104 of file fields.c.
References asteroid_velocity(), MinShort(), and RandomBelowOrEqual().
Referenced by asteroid_velocity(), and init_hazard().
Definition at line 428 of file fields.c.
References check_hazards(), g_aHazardFields, g_aShipPosition, g_bUseEyePositionForHazards, g_nHazardFieldCount, g_pActiveHazardField, near_field(), remove_all_hazards(), and start_hazard_field().
Referenced by auto_pilot_sequence(), check_hazards(), and house_keep().
| short difficulty | ( | void | ) |
Definition at line 98 of file fields.c.
References difficulty(), and g_nHazardReferenceSpeed.
Referenced by difficulty(), and init_hazard().
| short easy2see | ( | short | obj | ) |
Definition at line 25 of file fields.c.
References easy2see(), g_15_nStoredScreenViewCentreX, g_27_stViewScratchInfo, g_37_nViewCenterY, g_apObjectShape, g_asObjectFlip, g_asObjectScreenAngle, g_asObjectScreenScale, g_asObjectScreenX, g_asObjectScreenY, g_asObjectViewFrame, and GetTransformedShapeBounds().
Referenced by easy2see(), and object_collision().
| void extra_hazard | ( | short | obj | ) |
Definition at line 317 of file fields.c.
References extra_hazard(), g_aeObjectClass, OBJECT_CLASS_DUST, and OBJECT_CLASS_NULL.
Referenced by extra_hazard(), and update_star_field().
| void init_hazard | ( | short | obj, |
| FixedVector | position, | ||
| short | moving ) |
Definition at line 140 of file fields.c.
References AddFixedVectors(), align(), asteroid_velocity(), HazardField::center, difficulty(), distance_between_points(), g_acObjectCollisionGraceTicks, g_aShipForwardVector, g_aShipPosition, g_aShipVelocity, g_asObjectCounter, g_bUseEyePositionForHazards, g_cHazardBaseTravelTime, g_nActiveHazards, g_pActiveHazardField, init_hazard(), kilrathi_near(), MaxShort(), OBJECT_DATA_ASTEROID1, OBJECT_DATA_ASTEROID_FIELD, OBJECT_DATA_SPACE_MINE, point_at(), RandomBelow(), RandomBelowOrEqual(), ScaleFixedVector(), set_objects_data(), skew_randomly(), SubtractFixedVectors(), and HazardField::type.
Referenced by init_hazard(), and make_hazard().
| short make_hazard | ( | void | ) |
Definition at line 302 of file fields.c.
References find_vacant_3d_object(), init_hazard(), make_hazard(), RecordCannedSceneObjectEvent(), and try_far_spot().
Referenced by make_hazard(), start_hazard_field(), and update_hazards().
| void make_shard | ( | short | asteroid, |
| FixedVector | direction ) |
Definition at line 46 of file fields.c.
References AddFixedVectors(), alter_pitch(), alter_yaw(), find_vacant_3d_object(), fix_objects_ijk(), g_acObjectOwner, g_aShipForwardVector, g_aShipPosition, g_aShipVelocity, g_asObjectCollisionRadius, g_asObjectCounter, make_shard(), OBJECT_DATA_ROCK_CHUNK, RandomInRange(), real_velocity(), RecordCannedSceneObjectEvent(), set_objects_data(), SetVectorFixedPoint(), and signed_random().
Referenced by hit_asteroid(), and make_shard().
| void manage_hazard | ( | short | obj, |
| short | slot ) |
Definition at line 340 of file fields.c.
References approach(), g_asObjectDistance, g_asObjectScreenX, g_asObjectType, g_nRenderedSpaceFrame, manage_hazard(), OBJECT_DATA_PORCUPINE_MINE, ok_hazard_spot(), real_velocity(), and remove_hazard().
Referenced by manage_hazard(), and update_hazards().
Definition at line 356 of file fields.c.
References HazardField::center, EYE_OBJECT, g_aShipForwardVector, g_aShipPosition, g_aShipRightVector, g_aShipUpVector, g_aShipVelocity, g_nHazardReferenceSpeed, g_pActiveHazardField, match_ship_to_eye(), and ScaleFixedVector().
Referenced by match_ship_to_eye(), and update_hazards().
| short near_field | ( | const HazardField * | field, |
| const FixedVector * | point ) |
Definition at line 220 of file fields.c.
References HazardField::center, HazardField::innerRadius, IsPointWithinRange(), and near_field().
Referenced by check_hazards(), and near_field().
| short ok_hazard_spot | ( | short | obj | ) |
Definition at line 286 of file fields.c.
References g_aShipPosition, g_asObjectScreenX, IsPointWithinRange(), ok_hazard_spot(), and rear_sphere().
Referenced by manage_hazard(), and ok_hazard_spot().
| short rear_sphere | ( | void | ) |
Definition at line 279 of file fields.c.
References find_ratio(), g_nHazardReferenceSpeed, and rear_sphere().
Referenced by ok_hazard_spot(), and rear_sphere().
Definition at line 83 of file fields.c.
References g_abHazardObjects, g_pActiveHazardField, remove_all_hazards(), and remove_hazard().
Referenced by check_hazards(), free_3Space(), remove_all_hazards(), set_up_action_sphere(), and start_hazard_field().
| void remove_hazard | ( | signed char | hazard | ) |
Definition at line 74 of file fields.c.
References g_nActiveHazards, MaxShort(), RecordCannedSceneObjectEvent(), remove_hazard(), and remove_object().
Referenced by manage_hazard(), remove_all_hazards(), and remove_hazard().
| void skew_randomly | ( | short | obj, |
| short | allowReverse ) |
Definition at line 110 of file fields.c.
References g_aShipForwardVector, g_aShipRightVector, g_aShipUpVector, negate_vector(), RandomBelow(), and skew_randomly().
Referenced by init_hazard(), and skew_randomly().
| void start_hazard_field | ( | short | region | ) |
Definition at line 399 of file fields.c.
References g_abHazardObjects, g_aHazardFields, g_pActiveHazardField, make_hazard(), remove_all_hazards(), and start_hazard_field().
Referenced by check_hazards(), and start_hazard_field().
| short try_far_spot | ( | FixedVector * | spot, |
| short * | moving ) |
Definition at line 235 of file fields.c.
References copy_frame(), find_ratio(), g_acHazardPitchRange, g_anObjectPitchRotation, g_anObjectYawRotation, g_aShipForwardVector, g_aShipPosition, g_aShipRightVector, g_aShipUpVector, g_nCurrentView, g_pActiveHazardField, IsPointWithinRange(), position_relative_ijk(), RandomBelow(), rotate_about_i(), rotate_about_j(), SCRATCH_VIEW_OBJECT, signed_random(), try_far_spot(), and within_field().
Referenced by make_hazard(), and try_far_spot().
Definition at line 375 of file fields.c.
References g_abHazardObjects, g_bUseEyePositionForHazards, g_nHazardReferenceSpeed, make_hazard(), manage_hazard(), match_ship_to_eye(), RandomBelowOrEqual(), real_velocity(), and update_hazards().
Referenced by update_hazards(), and update_star_field().
| short within_field | ( | const HazardField * | field, |
| const FixedVector * | point ) |
Definition at line 228 of file fields.c.
References HazardField::center, HazardField::innerRadius, IsPointWithinRange(), and within_field().
Referenced by try_far_spot(), and within_field().
| short g_nActiveHazards = 0 |
Definition at line 9 of file fields.c.
Referenced by init_hazard(), and remove_hazard().
| short g_nHazardReferenceSpeed = 0 |
Definition at line 8 of file fields.c.
Referenced by difficulty(), match_ship_to_eye(), rear_sphere(), and update_hazards().