naev 0.12.5
space.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "space_fdecl.h" // IWYU pragma: export
7
8#include "asteroid.h"
9#include "commodity.h"
10#include "mission_markers.h"
11#include "nxml.h"
12#include "opengl_tex.h"
13#include "pilot.h"
14#include "shipstats.h"
15#include "tech.h"
16
17#define SYSTEM_SIMULATE_TIME_PRE \
18 25.
20#define SYSTEM_SIMULATE_TIME_POST \
21 5.
23#define MAX_HYPERSPACE_VEL 25.
24
25/*
26 * Spob services.
27 */
28#define SPOB_SERVICE_LAND ( 1 << 0 )
29#define SPOB_SERVICE_REFUEL ( 1 << 1 )
30#define SPOB_SERVICE_BAR ( 1 << 2 )
31#define SPOB_SERVICE_MISSIONS ( 1 << 3 )
32#define SPOB_SERVICE_OUTFITS ( 1 << 4 )
33#define SPOB_SERVICE_SHIPYARD ( 1 << 5 )
34#define SPOB_SERVICE_COMMODITY ( 1 << 6 )
35#define SPOB_SERVICE_INHABITED ( 1 << 7 )
36#define SPOB_SERVICE_BLACKMARKET \
37 ( 1 << 8 )
38#define SPOB_SERVICES_MAX ( SPOB_SERVICE_BLACKMARKET << 1 )
39#define spob_hasService( p, s ) \
40 ( ( p )->services & s )
41
42/*
43 * Spob flags.
44 */
45#define SPOB_KNOWN ( 1 << 0 )
46#define SPOB_BLACKMARKET ( 1 << 1 )
47#define SPOB_NOMISNSPAWN \
48 ( 1 << 2 )
49#define SPOB_UNINHABITED ( 1 << 3 )
50#define SPOB_MARKED ( 1 << 4 )
51#define SPOB_NOLANES ( 1 << 5 )
52#define SPOB_HOSTILE ( 1 << 6 )
53#define SPOB_RADIUS ( 1 << 10 )
54#define spob_isFlag( p, f ) ( ( p )->flags & ( f ) )
55#define spob_setFlag( p, f ) \
56 ( ( p )->flags |= ( f ) )
58#define spob_rmFlag( p, f ) \
59 ( ( p )->flags &= ~( f ) )
60#define spob_isKnown( p ) \
61 spob_isFlag( p, SPOB_KNOWN )
62
69typedef struct MapOverlayPos_ {
70 float radius;
71 float text_offx;
72 float text_offy;
73 float text_width;
75
78typedef struct SpobPresence_ {
79 int faction;
80 double base;
81 double bonus;
82 int range;
84
91typedef struct VirtualSpob_ {
92 char *name;
95
102typedef struct Spob_ {
103 char *filename;
104 int id;
105 char *name;
106 char *display;
108 char *feature;
110 double radius;
112 const SimpleShader *marker;
114
115 /* Spob details. */
116 char *class;
118 double population;
119
120 /* Spob details. */
122 double hide;
123
124 /* Landing details. */
128 char *land_msg;
129
130 /* Landed details. */
133 unsigned int services;
137 tech_group_t *tech;
138
139 /* Graphics. */
140 double gfx_space3d_size;
141 GltfObject *gfx_space3d;
142 char *gfx_space3dName;
143 char *gfx_space3dPath;
144 GLuint gfx_fbo;
145 GLuint gfx_dtex;
151 char *gfx_comm;
153
154 /* Misc. */
155 char **tags;
156 unsigned int flags;
158 double map_alpha;
160
161 /* Lua stuff. */
163 char *lua_file;
164 nlua_env lua_env;
178} Spob;
179
180/*
181 * Star system flags
182 */
183#define SYSTEM_KNOWN ( 1 << 0 )
184#define SYSTEM_MARKED \
185 ( 1 << 1 )
187#define SYSTEM_CMARKED \
188 ( 1 << 2 )
189#define SYSTEM_CLAIMED ( 1 << 3 )
190#define SYSTEM_DISCOVERED \
191 ( 1 << 4 )
193#define SYSTEM_HIDDEN \
194 ( 1 << 5 )
196#define SYSTEM_HAS_KNOWN_LANDABLE \
197 ( 1 << 6 )
199#define SYSTEM_HAS_LANDABLE \
200 ( 1 << 7 )
201#define SYSTEM_HAS_KNOWN_SPOB ( 1 << 8 )
202#define SYSTEM_HAS_KNOWN_FACTION_SPOB \
203 ( 1 << 9 )
204#define SYSTEM_NOLANES \
205 ( 1 << 10 )
206#define SYSTEM_PMARKED ( 1 << 11 )
207#define SYSTEM_INTEREST \
208 ( 1 << 12 )
210#define SYSTEM_NEBULATRAIL ( 1 << 13 )
211#define SYSTEM_HIDENEBULADAMAGE \
212 ( 1 << 14 )
213#define sys_isFlag( s, f ) \
214 ( ( s )->flags & ( f ) )
216#define sys_setFlag( s, f ) \
217 ( ( s )->flags |= ( f ) )
218#define sys_rmFlag( s, f ) \
219 ( ( s )->flags &= ~( f ) )
220#define sys_isKnown( s ) \
221 ( sys_isFlag( ( s ), SYSTEM_KNOWN ) )
222#define sys_isMarked( s ) \
223 sys_isFlag( ( s ), SYSTEM_MARKED )
224
228typedef struct SystemPresence_ {
230 double base;
231 double bonus;
232 double value;
233 double curUsed;
234 double timer;
236 double local;
238
239/*
240 * Jump point flags.
241 */
242#define JP_AUTOPOS \
243 ( 1 << 0 )
245#define JP_KNOWN ( 1 << 1 )
246#define JP_HIDDEN ( 1 << 2 )
247#define JP_EXITONLY ( 1 << 3 )
248#define JP_NOLANES ( 1 << 4 )
249#define jp_isFlag( j, f ) ( ( j )->flags & ( f ) )
250#define jp_setFlag( j, f ) ( ( j )->flags |= ( f ) )
251#define jp_rmFlag( j, f ) \
252 ( ( j )->flags &= ~( f ) )
253#define jp_isKnown( j ) \
254 jp_isFlag( j, JP_KNOWN )
255#define jp_isUsable( j ) ( jp_isKnown( j ) && !jp_isFlag( j, JP_EXITONLY ) )
256
260typedef struct JumpPoint_ JumpPoint;
262 StarSystem *from;
264 StarSystem *target;
265 JumpPoint *returnJump;
267 double radius;
268 unsigned int flags;
269 double hide;
270 double angle;
271 double map_alpha;
272 /* Cached stuff. */
273 double cosa;
274 double sina;
275 int sx;
276 int sy;
278};
279extern glTexture *jumppoint_gfx;
280
284typedef struct MapShader_ {
285 char *name;
286 GLuint program;
287 GLuint vertex;
288 GLuint projection;
289 GLuint alpha;
290 GLuint time;
291 GLuint globalpos;
292} MapShader;
293
300 char *filename;
301 int id;
302
303 /* General. */
304 char *name;
305 char *display;
308 double
311 double nebu_hue;
314 double radius;
316 char *features;
318
319 /* Spobs. */
321 int *spobsid;
324
325 /* Jumps. */
326 JumpPoint *jumps;
327
328 /* Asteroids. */
335
336 /* Calculated. */
337 double *prices;
338
339 /* Presence. */
345
346 /* Markers. */
351
352 /* Map shader. */
354 const MapShader *ms;
355
356 /* Economy. */
357 CommodityPrice *averagePrice;
358
359 /* Misc. */
360 char **tags;
361 unsigned int flags;
363 char *note;
365};
366
367/* Some useful externs. */
368extern StarSystem *cur_system;
369extern int space_spawn;
370
371/*
372 * loading/exiting
373 */
374void space_init( const char *sysname, int do_simulate );
375int space_load( void );
376int space_loadLua( void );
377void space_exit( void );
378
379/*
380 * spob stuff
381 */
382Spob *spob_new( void );
383const char *spob_name( const Spob *p );
384int spob_luaInit( Spob *spb );
385void spob_gfxLoad( Spob *p );
386int spob_hasSystem( const Spob *spb );
387StarSystem *spob_getSystem( const Spob *spob );
388const char *spob_getSystemName( const char *spobname );
389Spob *spob_getAll( void );
390Spob *spob_get( const char *spobname );
391Spob *spob_getIndex( int ind );
392void spob_setKnown( Spob *p );
393int spob_index( const Spob *p );
394int spob_exists( const char *spobname );
395const char *spob_existsCase( const char *spobname );
396char **spob_searchFuzzyCase( const char *spobname, int *n );
397const char *spob_getServiceName( int service );
398int spob_getService( const char *name );
399const char *spob_getClassName( const char *class );
400credits_t spob_commodityPrice( const Spob *p, const Commodity *c );
401credits_t spob_commodityPriceAtTime( const Spob *p, const Commodity *c,
402 ntime_t t );
403int spob_averageSpobPrice( const Spob *p, const Commodity *c, credits_t *mean,
404 double *std );
405void spob_averageSeenPricesAtTime( const Spob *p, const ntime_t tupdate );
406/* Misc modification. */
407int spob_setFaction( Spob *p, int faction );
409int spob_addService( Spob *p, int service );
410int spob_rmService( Spob *p, int service );
411int spob_rename( Spob *p, char *newname );
412/* Land related stuff. */
413char spob_getColourChar( const Spob *p );
414const char *spob_getSymbol( const Spob *p );
415const glColour *spob_getColour( const Spob *p );
416void spob_updateLand( Spob *p );
417void spob_distress( Spob *spb, const Pilot *p, const Pilot *attacker );
418/* Lua stuff. */
419void spob_luaInitMem( const Spob *spob );
420
421/*
422 * Virtual spob stuff.
423 */
425VirtualSpob *virtualspob_get( const char *name );
426
427/*
428 * jump stuff
429 */
430JumpPoint *jump_get( const char *jumpname, const StarSystem *sys );
431JumpPoint *jump_getTarget( const StarSystem *target, const StarSystem *sys );
432const char *jump_getSymbol( const JumpPoint *jp );
433
434/*
435 * system adding/removing stuff.
436 */
437void system_reconstructJumps( StarSystem *sys );
438void systems_reconstructJumps( void );
439void systems_reconstructSpobs( void );
440StarSystem *system_new( void );
441const char *system_name( const StarSystem *sys );
442const char *system_nameKnown( const StarSystem *sys );
443int system_addSpob( StarSystem *sys, const char *spobname );
444int system_rmSpob( StarSystem *sys, const char *spobname );
445int system_addVirtualSpob( StarSystem *sys, const char *spobname );
446int system_rmVirtualSpob( StarSystem *sys, const char *spobname );
447int system_addJump( StarSystem *sys, StarSystem *target );
448int system_rmJump( StarSystem *sys, StarSystem *target );
449
450/*
451 * render
452 */
453void space_render( const double dt );
454void space_renderOverlay( const double dt );
455void spobs_render( void );
456
457/*
458 * Presence stuff.
459 */
460void system_presenceCleanupAll( void );
461void system_presenceAddSpob( StarSystem *sys, const SpobPresence *ap );
462SystemPresence *system_getFactionPresence( StarSystem *sys, int faction );
463const SystemPresence *system_getFactionPresenceConst( const StarSystem *sys,
464 int faction );
465double system_getReputation( const StarSystem *sys, int faction );
466double system_getReputationOrGlobal( const StarSystem *sys, int faction );
467double system_getPresence( const StarSystem *sys, int faction );
468double system_getPresenceFull( const StarSystem *sys, int faction, double *base,
469 double *bonus );
470void system_addAllSpobsPresence( StarSystem *sys );
471void space_reconstructPresences( void );
472void system_rmCurrentPresence( StarSystem *sys, int faction, double amount );
473
474/*
475 * update.
476 */
477void space_update( double dt, double real_dt );
478int space_isSimulation( void );
479int space_needsEffects( void );
480
481/*
482 * Graphics.
483 */
484void space_gfxLoad( StarSystem *sys );
485void space_gfxUnload( StarSystem *sys );
486
487/*
488 * Getting stuff.
489 */
490StarSystem *system_getAll( void );
491const char *system_existsCase( const char *sysname );
492char **system_searchFuzzyCase( const char *sysname, int *n );
493StarSystem *system_get( const char *sysname );
494StarSystem *system_getIndex( int id );
495int system_index( const StarSystem *sys );
496int space_sysReachable( const StarSystem *sys );
497int space_sysReallyReachable( const char *sysname );
498int space_sysReachableFromSys( const StarSystem *target,
499 const StarSystem *sys );
500char **space_getFactionSpob( const int *factions, int landable );
501const char *space_getRndSpob( int landable, unsigned int services,
502 int ( *filter )( Spob *p ) );
503double system_getClosest( const StarSystem *sys, int *pnt, int *jp, int *ast,
504 int *fie, double x, double y );
505double system_getClosestAng( const StarSystem *sys, int *pnt, int *jp, int *ast,
506 int *fie, double x, double y, double ang );
507
508/*
509 * Markers.
510 */
511int space_addMarker( int sys, MissionMarkerType type );
512int space_rmMarker( int sys, MissionMarkerType type );
513void space_clearKnown( void );
514void space_clearMarkers( void );
515void space_clearComputerMarkers( void );
516int system_hasSpob( const StarSystem *sys );
517
518/*
519 * Hyperspace.
520 */
521int space_jumpDistance( const Pilot *p, const JumpPoint *jp );
522int space_canHyperspace( const Pilot *p );
523int space_hyperspace( Pilot *p );
524int space_calcJumpInPos( const StarSystem *in, const StarSystem *out, vec2 *pos,
525 vec2 *vel, double *dir, const Pilot *p );
526
527/*
528 * Misc.
529 */
530void system_updateAsteroids( StarSystem *sys );
531void system_setFaction( StarSystem *sys );
532void space_checkLand( void );
533void space_factionChange( void );
534void space_queueLand( Spob *pnt );
535const char *space_populationStr( const Spob *spb );
536
537/*
538 * Save/Loading.
539 */
540int space_playerSave( xmlTextWriterPtr writer );
541int space_playerLoad( xmlNodePtr parent, const char *version );
static double real_dt
Definition naev.c:111
static const double c[]
Definition rng.c:256
void space_reconstructPresences(void)
Reset the presence of all systems.
Definition space.c:4620
void space_init(const char *sysname, int do_simulate)
Initializes the system.
Definition space.c:1620
double system_getClosestAng(const StarSystem *sys, int *pnt, int *jp, int *ast, int *fie, double x, double y, double ang)
Gets the feature nearest to directly ahead of a position in the system.
Definition space.c:808
void spob_distress(Spob *spb, const Pilot *p, const Pilot *attacker)
Spob is receiving distress from a pilot about an attacker.
Definition space.c:2081
void spob_averageSeenPricesAtTime(const Spob *p, const ntime_t tupdate)
Adds cost of commodities on spob p to known statistics at time t.
Definition space.c:321
double system_getClosest(const StarSystem *sys, int *pnt, int *jp, int *ast, int *fie, double x, double y)
Gets the closest feature to a position in the system.
Definition space.c:723
int spob_exists(const char *spobname)
Check to see if a spob exists.
Definition space.c:1185
void system_rmCurrentPresence(StarSystem *sys, int faction, double amount)
Removes active presence.
Definition space.c:4678
void space_gfxUnload(StarSystem *sys)
Unloads all the graphics for a star system.
Definition space.c:2281
int space_canHyperspace(const Pilot *p)
Checks to make sure if pilot is far enough away to hyperspace.
Definition space.c:494
void space_render(const double dt)
Renders the system.
Definition space.c:3666
int spob_luaInit(Spob *spob)
Updatse the spob's internal Lua stuff.
Definition space.c:2120
void systems_reconstructJumps(void)
Reconstructs the jumps.
Definition space.c:2990
int space_jumpDistance(const Pilot *p, const JumpPoint *jp)
Distance at which a pilot can jump.
Definition space.c:479
const glColour * spob_getColour(const Spob *p)
Gets the spob colour.
Definition space.c:2009
int space_rmMarker(int objid, MissionMarkerType type)
Removes a marker from a system.
Definition space.c:4141
int system_addJump(StarSystem *sys, StarSystem *target)
Adds a jump point between two star systems.
Definition space.c:2829
int spob_averageSpobPrice(const Spob *p, const Commodity *c, credits_t *mean, double *std)
Gets the average price of a commodity at a spob that has been seen so far.
Definition space.c:336
double system_getPresenceFull(const StarSystem *sys, int faction, double *base, double *bonus)
Get the presence of a faction in a system.
Definition space.c:4566
double system_getReputation(const StarSystem *sys, int faction)
Gets the local reputation of the player in a system or returns 0.
Definition space.c:4502
Spob * spob_getAll(void)
Gets an array (array.h) of all spobs.
Definition space.c:1166
int spob_rename(Spob *p, char *newname)
Renames a spob.
Definition space.c:455
int spob_getService(const char *name)
Converts name to spob service flag.
Definition space.c:197
void system_setFaction(StarSystem *sys)
Sets the system faction based on the spobs it has.
Definition space.c:3377
Spob * spob_get(const char *spobname)
Gets a spob based on its name.
Definition space.c:1107
void space_factionChange(void)
Mark when a faction changes.
Definition space.c:1460
int system_addVirtualSpob(StarSystem *sys, const char *spobname)
Adds a virtual spob to a system.
Definition space.c:2765
const char * space_getRndSpob(int landable, unsigned int services, int(*filter)(Spob *p))
Gets the name of a random spob.
Definition space.c:666
void space_update(double dt, double real_dt)
Controls fleet spawning.
Definition space.c:1482
StarSystem * system_getIndex(int id)
Get the system by its index.
Definition space.c:1038
int spob_index(const Spob *p)
Gets the ID of a spob.
Definition space.c:1158
double system_getReputationOrGlobal(const StarSystem *sys, int faction)
Gets the local reputation of the player in a system or returns the global standing.
Definition space.c:4518
int spob_hasSystem(const Spob *spb)
Get whether or not a spob has a system (i.e. is on the map).
Definition space.c:1060
const char * jump_getSymbol(const JumpPoint *jp)
Gets the jump point symbol.
Definition space.c:1317
const char * spob_getSymbol(const Spob *p)
Gets the spob symbol.
Definition space.c:1986
void space_renderOverlay(const double dt)
Renders the system overlay.
Definition space.c:3686
int spob_setFaction(Spob *p, int faction)
Changes the spobs faction.
Definition space.c:372
char spob_getColourChar(const Spob *p)
Gets the spob colour char.
Definition space.c:1966
StarSystem * system_new(void)
Creates a new star system.
Definition space.c:2908
int space_sysReachable(const StarSystem *sys)
Sees if a system is reachable.
Definition space.c:869
JumpPoint * jump_getTarget(const StarSystem *target, const StarSystem *sys)
Less safe version of jump_get that works with pointers.
Definition space.c:1303
const char * system_existsCase(const char *sysname)
Checks to see if a system exists case insensitively.
Definition space.c:936
StarSystem * system_getAll(void)
Gets an array (array.h) of all star systems.
Definition space.c:925
char ** spob_searchFuzzyCase(const char *spobname, int *n)
Does a fuzzy case matching. Searches spob_name() but returns internal names.
Definition space.c:1211
int space_sysReachableFromSys(const StarSystem *target, const StarSystem *sys)
Sees if a system is reachable from another system.
Definition space.c:911
char ** system_searchFuzzyCase(const char *sysname, int *n)
Does a fuzzy case matching. Searches translated names but returns internal names.
Definition space.c:948
int space_playerLoad(xmlNodePtr parent, const char *version)
Loads player's space properties from an XML node.
Definition space.c:4221
StarSystem * system_get(const char *sysname)
Get the system from its name.
Definition space.c:1007
int space_calcJumpInPos(const StarSystem *in, const StarSystem *out, vec2 *pos, vec2 *vel, double *dir, const Pilot *p)
Calculates the jump in pos for a pilot.
Definition space.c:556
int spob_rmService(Spob *p, int service)
Removes a service from a spob.
Definition space.c:442
void system_updateAsteroids(StarSystem *sys)
Updates some internal calculations about asteroids in a system.
Definition space.c:347
void spob_setKnown(Spob *p)
Sets a spob's known status, if it's real.
Definition space.c:1174
void spobs_render(void)
Renders the current systems' spobs.
Definition space.c:3709
StarSystem * cur_system
Definition space.c:110
const char * spob_existsCase(const char *spobname)
Check to see if a spob exists (case insensitive).
Definition space.c:1199
int system_addSpob(StarSystem *sys, const char *spobname)
Adds a spob to a star system.
Definition space.c:2668
void space_exit(void)
Cleans up the system.
Definition space.c:3824
int space_addMarker(int objid, MissionMarkerType type)
Adds a marker to a system.
Definition space.c:4055
double system_getPresence(const StarSystem *sys, int faction)
Get the presence of a faction in a system.
Definition space.c:4537
void spob_updateLand(Spob *p)
Updates the land possibilities of a spob.
Definition space.c:2031
int space_sysReallyReachable(const char *sysname)
Sees if a system can be reached via jumping.
Definition space.c:889
void spob_gfxLoad(Spob *spob)
Loads a spob's graphics (and radius).
Definition space.c:2206
int system_rmVirtualSpob(StarSystem *sys, const char *spobname)
Removes a virtual spob from a system.
Definition space.c:2789
void space_clearMarkers(void)
Clears all system markers.
Definition space.c:3964
int space_playerSave(xmlTextWriterPtr writer)
Saves what is needed to be saved for space.
Definition space.c:4166
VirtualSpob * virtualspob_getAll(void)
Gets all the virtual spobs.
Definition space.c:1243
Spob * spob_getIndex(int ind)
Gets spob by index.
Definition space.c:1140
void system_presenceAddSpob(StarSystem *sys, const SpobPresence *ap)
Adds (or removes) some presence to a system.
Definition space.c:4339
VirtualSpob * virtualspob_get(const char *name)
Gets a virtual spob by matching name.
Definition space.c:1261
void space_clearKnown(void)
Clears all system knowledge.
Definition space.c:3945
void system_addAllSpobsPresence(StarSystem *sys)
Go through all the spobs and call system_addPresence().
Definition space.c:4597
int spob_addCommodity(Spob *p, Commodity *c)
Adds a commodity to a spob.
Definition space.c:385
const char * spob_getSystemName(const char *spobname)
Get the name of a system from a spobname.
Definition space.c:1082
int system_hasSpob(const StarSystem *sys)
See if the system has a spob.
Definition space.c:4660
int spob_addService(Spob *p, int service)
Removes a service from a spob.
Definition space.c:399
const char * spob_name(const Spob *p)
Gets the translated name of a spob.
Definition space.c:1834
const char * spob_getClassName(const char *class)
Gets the long class name for a spob.
Definition space.c:226
const char * space_populationStr(const Spob *spb)
Gets the population in an approximated string. Note this function changes the string value each call,...
Definition space.c:4743
void space_clearComputerMarkers(void)
Clears all the system computer markers.
Definition space.c:3984
void space_queueLand(Spob *pnt)
Cues a spob to be landed on. This is not done immediately, but when the engine thinks it is ok to do.
Definition space.c:4731
int system_rmJump(StarSystem *sys, StarSystem *target)
Removes a jump point from a star system.
Definition space.c:2868
int space_spawn
Definition space.c:122
credits_t spob_commodityPrice(const Spob *p, const Commodity *c)
Gets the price of a commodity at a spob.
Definition space.c:293
const char * spob_getServiceName(int service)
Gets the (English) name for a service code.
Definition space.c:169
void systems_reconstructSpobs(void)
Updates the system spob pointers.
Definition space.c:3009
Spob * spob_new(void)
Creates a new spob.
Definition space.c:1804
StarSystem * spob_getSystem(const Spob *spob)
Gets the system a spob is in.
Definition space.c:1071
int space_needsEffects(void)
returns whether or not we're simulating with effects.
Definition space.c:1609
char ** space_getFactionSpob(const int *factions, int landable)
Gets the name of all the spobs that belong to factions.
Definition space.c:623
void spob_luaInitMem(const Spob *spob)
Initializes the memory fo a spob.
Definition space.c:2109
JumpPoint * jump_get(const char *jumpname, const StarSystem *sys)
Gets a jump point based on its target and system.
Definition space.c:1279
void space_checkLand(void)
Handles landing if necessary.
Definition space.c:1468
glTexture * jumppoint_gfx
Definition space.c:111
void space_gfxLoad(StarSystem *sys)
Loads all the graphics for a star system.
Definition space.c:2266
int space_hyperspace(Pilot *p)
Tries to get the pilot into hyperspace.
Definition space.c:529
int space_load(void)
Loads the entire universe into ram - pretty big feat eh?
Definition space.c:3532
int space_isSimulation(void)
returns whether we're just simulating.
Definition space.c:1601
credits_t spob_commodityPriceAtTime(const Spob *p, const Commodity *c, ntime_t t)
Gets the price of a commodity at a spob at given time.
Definition space.c:307
int system_index(const StarSystem *sys)
Gets the index of a star system.
Definition space.c:1049
int system_rmSpob(StarSystem *sys, const char *spobname)
Removes a spob from a star system.
Definition space.c:2709
int space_loadLua(void)
initializes the Lua for all the spobs.
Definition space.c:3569
void system_reconstructJumps(StarSystem *sys)
Reconstructs the jumps for a single system.
Definition space.c:2958
Represents an asteroid field anchor.
Definition asteroid.h:111
Represents an asteroid exclusion zone.
Definition asteroid.h:136
Represents a commodity.
Definition commodity.h:57
Defines a complete object.
Definition gltf.h:182
Represents a jump lane.
Definition space.h:261
unsigned int flags
Definition space.h:268
int sx
Definition space.h:275
int targetid
Definition space.h:263
double map_alpha
Definition space.h:271
vec2 pos
Definition space.h:266
JumpPoint * returnJump
Definition space.h:265
int sy
Definition space.h:276
double sina
Definition space.h:274
double angle
Definition space.h:270
MapOverlayPos mo
Definition space.h:277
double cosa
Definition space.h:273
double radius
Definition space.h:267
StarSystem * target
Definition space.h:264
StarSystem * from
Definition space.h:262
double hide
Definition space.h:269
Saves the layout decisions from positioning labeled objects on the overlay.
Definition space.h:69
float text_offx
Definition space.h:71
float text_width
Definition space.h:73
float radius
Definition space.h:70
float text_offy
Definition space.h:72
Map shader.
Definition space.h:284
char * name
Definition space.h:285
GLuint time
Definition space.h:290
GLuint globalpos
Definition space.h:291
GLuint projection
Definition space.h:288
GLuint alpha
Definition space.h:289
GLuint program
Definition space.h:286
GLuint vertex
Definition space.h:287
The representation of an in-game pilot.
Definition pilot.h:263
Represents relative ship statistics as a linked list.
Definition shipstats.h:198
Represents the presence of a spob.
Definition space.h:78
double bonus
Definition space.h:81
int range
Definition space.h:82
double base
Definition space.h:80
int faction
Definition space.h:79
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Definition space.h:102
int can_land
Definition space.h:125
char * gfx_commPath
Definition space.h:152
Commodity ** commodities
Definition space.h:134
glTexture * gfx_space
Definition space.h:146
char * land_msg
Definition space.h:128
unsigned int services
Definition space.h:133
int lua_update
Definition space.h:172
int land_override
Definition space.h:126
char * lua_file_raw
Definition space.h:162
char * gfx_spacePath
Definition space.h:148
char * gfx_spaceName
Definition space.h:147
int lua_land
Definition space.h:170
int lua_distress
Definition space.h:177
double radius
Definition space.h:110
int markers
Definition space.h:159
double marker_scale
Definition space.h:113
char * feature
Definition space.h:108
char * bar_description
Definition space.h:132
int lua_comm
Definition space.h:173
int lua_render
Definition space.h:171
const SimpleShader * marker
Definition space.h:112
char * description
Definition space.h:131
char ** tags
Definition space.h:155
int lua_mem
Definition space.h:165
int lua_barbg
Definition space.h:176
int lua_init
Definition space.h:166
int lua_load
Definition space.h:167
tech_group_t * tech
Definition space.h:137
double map_alpha
Definition space.h:158
char * gfx_exterior
Definition space.h:149
nlua_env lua_env
Definition space.h:164
char * name
Definition space.h:105
char * gfx_exteriorPath
Definition space.h:150
vec2 pos
Definition space.h:109
MapOverlayPos mo
Definition space.h:157
int id
Definition space.h:104
char * gfx_comm
Definition space.h:151
CommodityPrice * commodityPrice
Definition space.h:136
char * filename
Definition space.h:103
double hide
Definition space.h:122
double population
Definition space.h:118
int lua_can_land
Definition space.h:169
int lua_population
Definition space.h:174
int lua_unload
Definition space.h:168
char * lua_file
Definition space.h:163
SpobPresence presence
Definition space.h:121
char * display
Definition space.h:106
unsigned int flags
Definition space.h:156
Represents a star system.
Definition space.h:299
AsteroidAnchor * asteroids
Definition space.h:330
int spilled
Definition space.h:342
double nebu_density
Definition space.h:312
int spacedust
Definition space.h:307
char * name
Definition space.h:304
int markers_low
Definition space.h:348
ShipStatList * stats
Definition space.h:362
Spob ** spobs
Definition space.h:320
char ** tags
Definition space.h:360
double nebu_hue
Definition space.h:311
int markers_high
Definition space.h:349
double * prices
Definition space.h:337
vec2 pos
Definition space.h:306
SystemPresence * presence
Definition space.h:340
JumpPoint * jumps
Definition space.h:326
VirtualSpob ** spobs_virtual
Definition space.h:323
double interference
Definition space.h:309
char * features
Definition space.h:316
int markers_plot
Definition space.h:350
char * display
Definition space.h:305
char * note
Definition space.h:363
int claims_soft
Definition space.h:364
int faction
Definition space.h:322
double asteroid_density
Definition space.h:333
unsigned int flags
Definition space.h:361
int * spobsid
Definition space.h:321
char * map_shader
Definition space.h:353
double nebu_volatility
Definition space.h:313
double radius
Definition space.h:314
double ownerpresence
Definition space.h:343
int markers_computer
Definition space.h:347
const MapShader * ms
Definition space.h:354
char * background
Definition space.h:315
AsteroidExclusion * astexclude
Definition space.h:331
Represents presence in a system.
Definition space.h:228
double curUsed
Definition space.h:233
double value
Definition space.h:232
double timer
Definition space.h:234
double base
Definition space.h:230
double local
Definition space.h:236
double bonus
Definition space.h:231
Basically modifies system parameters without creating any real objects.
Definition space.h:91
SpobPresence * presences
Definition space.h:93
char * name
Definition space.h:92
Abstraction for rendering sprite sheets.
Definition opengl_tex.h:43
Represents a 2d vector.
Definition vec2.h:45