![]() |
naev 0.12.6
|
Handles asteroid-related stuff. More...
#include "asteroid.h"#include "array.h"#include "camera.h"#include "conf.h"#include "damagetype.h"#include "explosion.h"#include "font.h"#include "gatherable.h"#include "ndata.h"#include "nlua_asteroid.h"#include "ntracing.h"#include "nxml.h"#include "opengl.h"#include "player.h"#include "rng.h"#include "sound.h"#include "space.h"
Go to the source code of this file.
Data Structures | |
| struct | Debris |
| Represents a small asteroid debris rendered in the player frame. More... | |
Macros | |
| #define | MELEMENT(o, s) |
Functions | |
| static int | asttype_cmp (const void *p1, const void *p2) |
| Compares two asteroid types. | |
| static int | asttype_parse (AsteroidType *at, const char *file) |
| Parses the XML of an asteroid type. | |
| static int | asteroid_loadPLG (AsteroidType *temp, const char *buf) |
| Loads the collision polygon for an asteroid type. | |
| static int | astgroup_cmp (const void *p1, const void *p2) |
| Compares two asteroid type groups. | |
| static int | astgroup_parse (AsteroidTypeGroup *ag, const char *file) |
| Parses an asteroid type group from a file. | |
| static int | asttype_load (void) |
| Loads the asteroids types. | |
| static int | asteroid_updateSingle (Asteroid *a) |
| static void | asteroid_renderSingle (const Asteroid *a) |
| Renders an asteroid. | |
| static void | debris_renderSingle (const Debris *d, double cx, double cy) |
| Renders a debris. | |
| static void | debris_init (Debris *deb) |
| Initializes a debris. | |
| static int | asteroid_init (Asteroid *ast, const AsteroidAnchor *field) |
| Initializes an asteroid. | |
| void | asteroids_update (double dt) |
| Controls fleet spawning. | |
| void | asteroids_init (void) |
| Initializes the system. | |
| void | asteroids_computeInternals (AsteroidAnchor *a) |
| Updates internal alues of an asteroid field. | |
| int | asteroids_load (void) |
| Loads the asteroids. | |
| void | asteroids_renderOverlay (void) |
| Renders the system overlay. | |
| void | asteroids_render (void) |
| Renders the current systems' spobs. | |
| void | asteroid_initAnchor (AsteroidAnchor *ast) |
| Initializes an asteroid anchor. | |
| void | asteroid_freeAnchor (AsteroidAnchor *ast) |
| Frees an asteroid anchor. | |
| void | asteroid_freeExclude (AsteroidExclusion *exc) |
| Frees an asteroid exclusion. | |
| void | asteroids_free (void) |
| Cleans up the system. | |
| int | asteroids_inField (const vec2 *p) |
| See if the position is in an asteroid field. | |
| const AsteroidType * | asttype_getAll (void) |
| Gets all the asteroid types. | |
| AsteroidType * | asttype_getName (const char *name) |
| Gets the ID of an asteroid type by name. | |
| const AsteroidTypeGroup * | astgroup_getAll (void) |
| Gets all the asteroid type groups. | |
| AsteroidTypeGroup * | astgroup_getName (const char *name) |
| Gets an asteroid type group by name. | |
| void | asteroid_hit (Asteroid *a, const Damage *dmg, int max_rarity, double mining_bonus) |
| Hits an asteroid. | |
| void | asteroid_explode (Asteroid *a, int max_rarity, double mining_bonus) |
| Makes an asteroid explode. | |
| void | asteroid_collideQueryIL (AsteroidAnchor *anc, IntList *il, int x1, int y1, int x2, int y2) |
Variables | |
| const double | DEBRIS_BUFFER |
| static const double | SCAN_FADE |
| static Debris * | debris_stack |
| static glTexture ** | debris_gfx = NULL |
| static double | asteroid_dt |
| static AsteroidType * | asteroid_types |
| static AsteroidTypeGroup * | asteroid_groups |
| static glTexture ** | asteroid_gfx |
| static int | asteroid_creating = 0 |
Handles asteroid-related stuff.
Definition in file asteroid.c.
| #define MELEMENT | ( | o, | |
| s ) |
| void asteroid_collideQueryIL | ( | AsteroidAnchor * | anc, |
| IntList * | il, | ||
| int | x1, | ||
| int | y1, | ||
| int | x2, | ||
| int | y2 ) |
Definition at line 1294 of file asteroid.c.
| void asteroid_explode | ( | Asteroid * | a, |
| int | max_rarity, | ||
| double | mining_bonus ) |
Makes an asteroid explode.
| a | asteroid to make explode |
| max_rarity | Maximum rarity of the rewards to give, set to -1 for none. |
| mining_bonus | Bonus to mining. |
Definition at line 1209 of file asteroid.c.
| void asteroid_freeAnchor | ( | AsteroidAnchor * | ast | ) |
Frees an asteroid anchor.
| ast | Asteroid anchor to free. |
Definition at line 1036 of file asteroid.c.
| void asteroid_freeExclude | ( | AsteroidExclusion * | exc | ) |
Frees an asteroid exclusion.
| exc | Asteroid exclusion to free. |
Definition at line 1051 of file asteroid.c.
Hits an asteroid.
| a | hit asteroid |
| dmg | Damage being done |
| max_rarity | Maximum rarity of the rewards to give if destroyed. |
| mining_bonus | Bonus to mining. |
Definition at line 1189 of file asteroid.c.
|
static |
Initializes an asteroid.
Definition at line 398 of file asteroid.c.
| void asteroid_initAnchor | ( | AsteroidAnchor * | ast | ) |
Initializes an asteroid anchor.
Definition at line 1019 of file asteroid.c.
|
static |
Loads the collision polygon for an asteroid type.
| temp | AsteroidType to load into. |
| buf | Name of the file. |
Definition at line 773 of file asteroid.c.
|
static |
Renders an asteroid.
Definition at line 940 of file asteroid.c.
|
static |
Definition at line 83 of file asteroid.c.
| void asteroids_computeInternals | ( | AsteroidAnchor * | a | ) |
Updates internal alues of an asteroid field.
Definition at line 508 of file asteroid.c.
| void asteroids_free | ( | void | ) |
Cleans up the system.
Definition at line 1059 of file asteroid.c.
| int asteroids_inField | ( | const vec2 * | p | ) |
See if the position is in an asteroid field.
| p | pointer to the position. |
Definition at line 1109 of file asteroid.c.
| void asteroids_init | ( | void | ) |
Initializes the system.
Definition at line 298 of file asteroid.c.
| int asteroids_load | ( | void | ) |
| void asteroids_render | ( | void | ) |
Renders the current systems' spobs.
Definition at line 897 of file asteroid.c.
| void asteroids_renderOverlay | ( | void | ) |
Renders the system overlay.
Definition at line 875 of file asteroid.c.
| void asteroids_update | ( | double | dt | ) |
Controls fleet spawning.
| dt | Current delta tick. |
Definition at line 203 of file asteroid.c.
|
static |
Compares two asteroid type groups.
Definition at line 568 of file asteroid.c.
| const AsteroidTypeGroup * astgroup_getAll | ( | void | ) |
Gets all the asteroid type groups.
Definition at line 1159 of file asteroid.c.
| AsteroidTypeGroup * astgroup_getName | ( | const char * | name | ) |
Gets an asteroid type group by name.
| name | Name of the asteroid type group to get. |
Definition at line 1170 of file asteroid.c.
|
static |
Parses an asteroid type group from a file.
| [out] | ag | Asteroid type group to load. |
| file | File to load from. |
Definition at line 821 of file asteroid.c.
|
static |
Compares two asteroid types.
Definition at line 557 of file asteroid.c.
| const AsteroidType * asttype_getAll | ( | void | ) |
Gets all the asteroid types.
Definition at line 1133 of file asteroid.c.
| AsteroidType * asttype_getName | ( | const char * | name | ) |
Gets the ID of an asteroid type by name.
| name | Name of the asteroid type to get. |
Definition at line 1144 of file asteroid.c.
|
static |
|
static |
Parses the XML of an asteroid type.
| [out] | at | Outfit asteroid type. |
| file | File containing the XML information. |
Definition at line 649 of file asteroid.c.
|
static |
Initializes a debris.
| deb | Debris to initialize. |
Definition at line 483 of file asteroid.c.
|
static |
Renders a debris.
Definition at line 1007 of file asteroid.c.
|
static |
Definition at line 67 of file asteroid.c.
|
static |
Used as a global variable when threading.
Definition at line 55 of file asteroid.c.
|
static |
Graphics for the asteroids (array.h).
Definition at line 65 of file asteroid.c.
|
static |
Asteroid type groups stack (array.h).
Definition at line 63 of file asteroid.c.
|
static |
| const double DEBRIS_BUFFER |
Buffer to smooth appearance of debris
Definition at line 46 of file asteroid.c.
|
static |
Graphics to use for debris.
Definition at line 54 of file asteroid.c.
|
static |
All the debris in the current system (array.h).
Definition at line 52 of file asteroid.c.
|
static |
1/time it takes to fade in/out scanning text.
Definition at line 49 of file asteroid.c.