Wing Commander II
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
fields.c File Reference

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

Detailed Description

Asteroid and mine hazard fields.

Definition in file fields.c.

Macro Definition Documentation

◆ g_acHazardPitchRange

#define g_acHazardPitchRange   ((const signed char *)&g_nHazardPitchRange)

Definition at line 13 of file fields.c.

Referenced by try_far_spot().

Function Documentation

◆ add_hazard_field()

void add_hazard_field ( short type,
FixedVector center,
short radius,
short density )

◆ align()

void align ( int * value,
short quantum )

Definition at line 134 of file fields.c.

References align().

Referenced by align(), and init_hazard().

◆ approach()

◆ asteroid_velocity()

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().

◆ check_hazards()

◆ difficulty()

short difficulty ( void )

Definition at line 98 of file fields.c.

References difficulty(), and g_nHazardReferenceSpeed.

Referenced by difficulty(), and init_hazard().

◆ easy2see()

◆ extra_hazard()

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().

◆ init_hazard()

◆ make_hazard()

◆ make_shard()

◆ manage_hazard()

◆ match_ship_to_eye()

◆ near_field()

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().

◆ ok_hazard_spot()

short ok_hazard_spot ( short obj)

◆ rear_sphere()

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().

◆ remove_all_hazards()

◆ remove_hazard()

void remove_hazard ( signed char hazard)

◆ skew_randomly()

void skew_randomly ( short obj,
short allowReverse )

◆ start_hazard_field()

void start_hazard_field ( short region)

◆ try_far_spot()

◆ update_hazards()

◆ within_field()

short within_field ( const HazardField * field,
const FixedVector * point )

Variable Documentation

◆ g_nActiveHazards

short g_nActiveHazards = 0

Definition at line 9 of file fields.c.

Referenced by init_hazard(), and remove_hazard().

◆ g_nHazardReferenceSpeed

short g_nHazardReferenceSpeed = 0

Definition at line 8 of file fields.c.

Referenced by difficulty(), match_ship_to_eye(), rear_sphere(), and update_hazards().