8#include "map_overlay.h"
24static const double OVERLAY_FADEIN =
32typedef struct MapOverlayRadiusConstraint_ {
38typedef enum ovr_marker_type_e {
46typedef struct ovr_marker_s {
60static unsigned int mrk_idgen = 0;
63static SafeLane *ovr_render_safelanes = NULL;
65static Uint32 ovr_opened = 0;
66static int ovr_open = 0;
67static double ovr_res = 10.;
68static double ovr_dt = 0.;
69static const double ovr_text_pixbuf =
72typedef struct OverlayBounds_s {
85static int autonav_pos = 0;
86static vec2 autonav_pos_v;
91static const vec2 **ovr_refresh_pos = NULL;
96static void force_collision(
float *ox,
float *oy,
float x,
float y,
float w,
97 float h,
float mx,
float my,
float mw,
float mh );
98static void ovr_optimizeLayout(
int items,
const vec2 **pos,
100static void ovr_refresh_uzawa_overlap(
float *forces_x,
float *forces_y,
101 float x,
float y,
float w,
float h,
103 int items,
int self,
float *offx,
104 float *offy,
float *offdx,
107static int ovr_safelaneKnown(
SafeLane *sf,
vec2 *posns[2] );
108static void map_overlayToScreenPos(
double *ox,
double *oy,
double x,
111static void ovr_mrkRenderAll(
double res,
int fg );
118int ovr_isOpen(
void )
126static void ovr_boundsUpdate(
void )
128 ovr_bounds.w = SCREEN_W - ovr_bounds.l - ovr_bounds.r;
129 ovr_bounds.h = SCREEN_H - ovr_bounds.t - ovr_bounds.b;
130 ovr_bounds.x = ovr_bounds.w / 2. + ovr_bounds.l;
131 ovr_bounds.y = ovr_bounds.h / 2. + ovr_bounds.b;
142void ovr_boundsSet(
double top,
double right,
double bottom,
double left )
145 ovr_bounds.r = right;
146 ovr_bounds.b = bottom;
157void ovr_center(
double *x,
double *y )
166static void map_overlayToScreenPos(
double *ox,
double *oy,
double x,
double y )
168 *ox = ovr_bounds.x + x / ovr_res;
169 *oy = ovr_bounds.y + y / ovr_res;
175int ovr_input( SDL_Event *event )
181 if ( event->type != SDL_MOUSEBUTTONDOWN )
185 if ( player_isFlag( PLAYER_DESTROYED ) || (
player.p == NULL ) )
189 if ( pilot_isFlag(
player.p, PILOT_DEAD ) )
193 if ( event->button.button != SDL_BUTTON_LEFT &&
194 event->button.button != SDL_BUTTON_RIGHT )
198 mx =
event->button.x;
199 my =
event->button.y;
203 x = ( (double)mx - ovr_bounds.x ) * ovr_res;
204 y = ( (double)my - ovr_bounds.y ) * ovr_res;
206 return input_clickPos( event, x, y, 1., 10. * ovr_res, 15. * ovr_res );
214void ovr_refresh(
void )
217 int n, items, jumpitems, spobitems;
220 char buf[STRMAX_SHORT];
226 NTracingZone( _ctx, 1 );
229 if ( ovr_refresh_mo )
230 free( ovr_refresh_mo );
231 if ( ovr_refresh_pos )
232 free( ovr_refresh_pos );
241 pos = calloc( n,
sizeof(
vec2 * ) );
243 if ( (
player.p != NULL ) && !pilot_isFlag(
player.p, PILOT_HYP_END ) ) {
249 max_x =
MAX( max_x,
ABS( autonav_pos_v.x ) );
250 max_y =
MAX( max_y,
ABS( autonav_pos_v.y ) );
251 pos[items] = &autonav_pos_v;
252 mo[items] = &autonav_pos_mo;
259 max_x =
MAX( max_x,
ABS( jp->pos.x ) );
260 max_y =
MAX( max_y,
ABS( jp->pos.y ) );
261 if ( !jp_isUsable( jp ) )
265 sys_isKnown( jp->target ) ? system_name( jp->target )
267 pos[items] = &jp->pos;
278 if ( !spob_isKnown( pnt ) )
283 pos[items] = &pnt->
pos;
284 mo[items] = &pnt->
mo;
293 for (
int i = 0; i <
array_size( ovr_markers ); i++ ) {
298 if ( mrk->
text == NULL )
301 mo[items] = &mrk->
mo;
302 switch ( mrk->
type ) {
303 case OVR_MARKER_POINT:
304 pos[items] = &mrk->
pos;
307 case OVR_MARKER_CIRCLE:
308 pos[items] = &mrk->
u.circle.textpos;
319 ovr_res = 2. * 1.2 *
MAX( max_x / ovr_bounds.w, max_y / ovr_bounds.h );
320 ovr_res =
MAX( ovr_res, 25. );
321 for (
int i = 0; i < items; i++ ) {
323 if ( autonav_pos && ( i == 0 ) )
325 else if ( i < jumpitems )
327 else if ( i < spobitems )
331 mo[i]->
radius =
MAX( 2. + mo[i]->radius / ovr_res, rm );
335 ovr_optimizeLayout( items, pos, mo );
338 ovr_refresh_pos = pos;
341 NTracingZoneEnd( _ctx );
348static void ovr_optimizeLayout(
int items,
const vec2 **pos,
351 float cx, cy, r, sx, sy;
352 float x, y, w, h, mx, my, mw, mh;
353 float fx, fy, best, bx, by;
354 float *forces_xa, *forces_ya, *off_buffx, *off_buffy, *off_0x, *off_0y,
355 old_bx, old_by, *off_dx, *off_dy;
358 const int max_iters = 15;
359 const float kx = 0.015;
360 const float ky = 0.045;
362 const float eps_con = 1.3;
371 uint8_t *must_shrink = malloc( items );
372 for ( cur.
i = 0; cur.
i < items; cur.
i++ )
373 for ( cur.
j = cur.
i + 1; cur.
j < items; cur.
j++ ) {
374 cur.
dist = hypot( pos[cur.
i]->x - pos[cur.
j]->x,
375 pos[cur.
i]->y - pos[cur.
j]->y ) /
377 if ( cur.
dist < mo[cur.
i]->radius + mo[cur.
j]->radius )
380 for (
int iter = 0; ( iter < max_iters ) && (
array_size( fits ) > 0 );
382 float shrink_factor = 0.;
383 memset( must_shrink, 0, items );
384 for (
int i = 0; i <
array_size( fits ); i++ ) {
389 shrink_factor =
MAX( shrink_factor, r - FLT_EPSILON );
390 must_shrink[fits[i].
i] = must_shrink[fits[i].j] = 1;
393 for (
int i = 0; i < items; i++ )
394 if ( must_shrink[i] )
395 mo[i]->
radius *= shrink_factor;
401 for (
int i = 0; i < items; i++ )
402 mo[i]->radius =
MAX( mo[i]->radius, 4. );
405 off_0x = calloc( items,
sizeof(
float ) );
406 off_0y = calloc( items,
sizeof(
float ) );
409 for (
int i = 0; i < items; i++ ) {
413 x = pos[i]->
x / ovr_res - ovr_text_pixbuf;
414 y = pos[i]->
y / ovr_res - ovr_text_pixbuf;
418 const float tx[4] = { mo[i]->
radius + ovr_text_pixbuf + 0.1,
422 mo[i]->
radius + ovr_text_pixbuf + 0.1,
423 -mo[i]->
radius - 0.1 - h };
429 for (
int k = 0; k < 4; k++ ) {
433 for (
int j = 0; j < items; j++ ) {
437 mx = pos[j]->
x / ovr_res - mw / 2.;
438 my = pos[j]->
y / ovr_res - mh / 2.;
440 force_collision( &fx, &fy, x + tx[k], y + ty[k], w, h, mx, my, mw,
443 val +=
ABS( fx ) +
ABS( fy );
446 if ( k == 0 || val < best ) {
472 forces_xa = calloc( 2 * items * items,
sizeof(
float ) );
473 forces_ya = calloc( 2 * items * items,
sizeof(
float ) );
476 off_buffx = calloc( items,
sizeof(
float ) );
477 off_buffy = calloc( items,
sizeof(
float ) );
478 off_dx = calloc( items,
sizeof(
float ) );
479 off_dy = calloc( items,
sizeof(
float ) );
482 for (
int iter = 0; iter < max_iters; iter++ ) {
484 for (
int i = 0; i < items; i++ ) {
485 cx = pos[i]->
x / ovr_res;
486 cy = pos[i]->
y / ovr_res;
488 ovr_refresh_uzawa_overlap(
489 forces_xa, forces_ya, cx + off_dx[i] + off_0x[i] - ovr_text_pixbuf,
490 cy + off_dy[i] + off_0y[i] - ovr_text_pixbuf,
491 mo[i]->text_width + 2 * ovr_text_pixbuf,
492 gl_smallFont.h + 2 * ovr_text_pixbuf, pos, mo, items, i, off_0x,
493 off_0y, off_dx, off_dy );
497 for (
int j = 0; j < 2 * items; j++ ) {
498 sx += forces_xa[2 * items * i + j];
499 sy += forces_ya[2 * items * i + j];
503 old_bx = off_buffx[i];
504 old_by = off_buffy[i];
507 off_buffx[i] = kx * sx;
508 off_buffy[i] = ky * sy;
510 val =
MAX( val,
ABS( old_bx - off_buffx[i] ) +
511 ABS( old_by - off_buffy[i] ) );
515 for (
int i = 0; i < items; i++ ) {
516 off_dx[i] = off_buffx[i];
517 off_dy[i] = off_buffy[i];
521 if ( val <= eps_con )
526 for (
int i = 0; i < items; i++ ) {
527 mo[i]->
text_offx = off_dx[i] + off_0x[i];
528 mo[i]->
text_offy = off_dy[i] + off_0y[i];
546static void force_collision(
float *ox,
float *oy,
float x,
float y,
float w,
547 float h,
float mx,
float my,
float mw,
float mh )
550 if ( ( y + h < my + ovr_text_pixbuf ) || ( y + ovr_text_pixbuf > my + mh ) )
554 if ( x + 0.5 * w < mx + 0.5 * mw ) {
555 *ox += mx - ( x + w );
556 *ox =
MIN( 0., *ox );
560 *ox += ( mx + mw ) - x;
561 *ox =
MAX( 0., *ox );
566 if ( ( x + w < mx + ovr_text_pixbuf ) || ( x + ovr_text_pixbuf > mx + mw ) )
570 if ( y + 0.5 * h < my + 0.5 * mh ) {
571 *oy += my - ( y + h );
572 *oy =
MIN( 0., *oy );
576 *oy += ( my + mh ) - y;
577 *oy =
MAX( 0., *oy );
585static void ovr_refresh_uzawa_overlap(
float *forces_x,
float *forces_y,
586 float x,
float y,
float w,
float h,
588 int items,
int self,
float *offx,
589 float *offy,
float *offdx,
float *offdy )
591 for (
int i = 0; i < items; i++ ) {
592 float mx, my, mw, mh;
593 const float pb2 = ovr_text_pixbuf * 2.;
598 mx = pos[i]->
x / ovr_res - mw / 2.;
599 my = pos[i]->
y / ovr_res - mh / 2.;
600 force_collision( &forces_x[2 * items * self + 2 * i + 1],
601 &forces_y[2 * items * self + 2 * i + 1], x, y, w, h, mx,
610 mx = pos[i]->
x / ovr_res + offdx[i] + offx[i] - ovr_text_pixbuf;
611 my = pos[i]->
y / ovr_res + offdy[i] + offy[i] - ovr_text_pixbuf;
612 force_collision( &forces_x[2 * items * self + 2 * i],
613 &forces_y[2 * items * self + 2 * i], x, y, w, h, mx, my,
618void ovr_initAlpha(
void )
623 if ( !jp_isUsable( jp ) )
630 if ( !spob_isKnown( pnt ) )
637 for (
int i = 0; i <
array_size( safelanes ); i++ ) {
639 if ( !ovr_safelaneKnown( &safelanes[i], posns ) )
645 ovr_render_safelanes = safelanes;
652 il_create( &ovr_qtquery, 1 );
658 il_destroy( &ovr_qtquery );
666void ovr_setOpen(
int open )
668 if ( open && !ovr_open ) {
672 }
else if ( ovr_open ) {
676 ovr_render_safelanes = NULL;
677 free( ovr_refresh_pos );
678 ovr_refresh_pos = NULL;
679 free( ovr_refresh_mo );
680 ovr_refresh_mo = NULL;
689void ovr_key(
int type )
699 ovr_opened = SDL_GetTicks();
701 }
else if ( type < 0 ) {
702 if ( SDL_GetTicks() - ovr_opened > 300 )
707static int ovr_safelaneKnown(
SafeLane *sf,
vec2 *posns[2] )
713 for (
int j = 0; j < 2; j++ ) {
717 case SAFELANE_LOC_SPOB:
719 posns[j] = &pnt->
pos;
720 if ( !spob_isKnown( pnt ) )
723 case SAFELANE_LOC_DEST_SYS:
726 if ( !jp_isKnown( jp ) )
730 WARN( _(
"Invalid vertex type." ) );
742void ovr_render(
double dt )
747 double rx, ry, x2, y2, rw, rh;
754 if ( player_isFlag( PLAYER_DESTROYED ) || (
player.p == NULL ) )
757 NTracingZone( _ctx, 1 );
760 glClear( GL_DEPTH_BUFFER_BIT );
769 glColour
c = { .r = 0., .g = 0., .b = 0., .a = conf.map_overlay_opacity };
774 for (
int i = 0; i <
array_size( safelanes ); i++ ) {
778 if ( !ovr_safelaneKnown( &safelanes[i], posns ) )
785 safelanes[i].
map_alpha = ovr_render_safelanes[i].map_alpha;
787 if ( safelanes[i].map_alpha < 1.0 )
789 MIN( safelanes[i].map_alpha + OVERLAY_FADEIN * dt, 1.0 );
791 if ( faction_isPlayerFriendSystem( safelanes[i].faction,
cur_system ) )
793 else if ( faction_isPlayerEnemySystem( safelanes[i].faction,
798 col.a = 0.15 *
MIN( safelanes[i].map_alpha, 1.0 );
801 map_overlayToScreenPos( &x, &y, posns[0]->x, posns[0]->y );
802 map_overlayToScreenPos( &x2, &y2, posns[1]->x, posns[1]->y );
806 rw = MOD( rx, ry ) / 2.;
810 glUseProgram( shaders.safelane.program );
811 gl_renderShader( x + rx / 2., y + ry / 2., rw, rh, r, &shaders.safelane,
815 ovr_render_safelanes = safelanes;
818 ovr_mrkRenderAll( res, 0 );
822 glColour col = cRadar_hilight;
824 map_overlayToScreenPos( &x, &y, autonav_pos_v.x, autonav_pos_v.y );
825 glUseProgram( shaders.selectposition.program );
828 y + autonav_pos_mo.text_offy, &cRadar_hilight,
837 if ( i !=
player.p->nav_spob )
840 if (
player.p->nav_spob > -1 )
847 if ( jp->map_alpha < 1.0 )
848 jp->map_alpha =
MIN( jp->map_alpha + OVERLAY_FADEIN * dt, 1.0 );
849 if ( ( i !=
player.p->nav_hyperspace ) && !jp_isFlag( jp, JP_EXITONLY ) )
852 if (
player.p->nav_hyperspace > -1 )
854 player.p->nav_hyperspace, RADAR_RECT, w, h, res,
860 double range = EW_ASTEROID_DIST *
861 player.p->stats.ew_detect;
863 ax = round(
player.p->solid.pos.x );
864 ay = round(
player.p->solid.pos.y );
866 asteroid_collideQueryIL( ast, &ovr_qtquery, ax - r, ay - r, ax + r,
868 for (
int j = 0; j < il_size( &ovr_qtquery ); j++ ) {
877 for (
int i = 0; i <
array_size( pstk ); i++ ) {
878 if ( pstk[i]->
id == PLAYER_ID )
880 if ( pstk[i]->
id ==
player.p->target )
887 if ( pilot_isFlag(
player.p, PILOT_STEALTH ) ) {
889 glColour col = { 0., 0., 1., 1. };
891 glBindFramebuffer( GL_FRAMEBUFFER,
gl_screen.fbo[2] );
892 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
893 glBlendEquation( GL_FUNC_ADD );
894 glBlendFuncSeparate( GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE );
897 detect = vec2_dist2( &
player.p->solid.pos, &ast->
pos );
901 map_overlayToScreenPos( &x, &y, ast->
pos.
x, ast->
pos.
y );
903 glUseProgram( shaders.astaura.program );
908 glBlendEquation( GL_FUNC_REVERSE_SUBTRACT );
909 glBlendFuncSeparate( GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE );
913 map_overlayToScreenPos( &x, &y, aexcl->
pos.
x, aexcl->
pos.
y );
915 glUseProgram( shaders.astaura.program );
919 glBlendEquation( GL_MAX );
923 if ( !jp_isUsable( jp ) || jp_isFlag( jp, JP_HIDDEN ) )
925 map_overlayToScreenPos( &x, &y, jp->pos.x, jp->pos.y );
926 r = EW_JUMP_BONUS_RANGE / res;
927 glUseProgram( shaders.astaura.program );
931 detect =
player.p->ew_stealth / res;
935 for (
int i = 0; i <
array_size( pstk ); i++ ) {
937 if ( pilot_isDisabled( pstk[i] ) )
939 if ( areAlliesSystem(
player.p->faction, pstk[i]->faction,
946 map_overlayToScreenPos( &x, &y, pstk[i]->solid.pos.x,
947 pstk[i]->solid.pos.y );
950 glUseProgram( shaders.stealthaura.program );
955 glBlendEquation( GL_FUNC_ADD );
956 glBlendFuncSeparate( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE,
957 GL_ONE_MINUS_SRC_ALPHA );
958 glBindFramebuffer( GL_FRAMEBUFFER,
gl_screen.current_fbo );
960 glUseProgram( shaders.stealthoverlay.program );
961 glBindTexture( GL_TEXTURE_2D,
gl_screen.fbo_tex[2] );
963 glEnableVertexAttribArray( shaders.stealthoverlay.vertex );
968 gl_uniformColour( shaders.stealthoverlay.colour, &cWhite );
971 gl_uniformMat4( shaders.stealthoverlay.projection, &ortho );
972 gl_uniformMat4( shaders.stealthoverlay.tex_mat, &I );
975 glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
978 glDisableVertexAttribArray( shaders.stealthoverlay.vertex );
982 ovr_mrkRenderAll( res, 1 );
991 NTracingZoneEnd( _ctx );
999static void ovr_mrkRenderAll(
double res,
int fg )
1001 NTracingZone( _ctx, 1 );
1003 for (
int i = 0; i <
array_size( ovr_markers ); i++ ) {
1006 map_overlayToScreenPos( &x, &y, mrk->
pos.
x, mrk->
pos.
y );
1010 const glColour highlighted = COL_ALPHA( cRadar_hilight, 0.3 );
1012 switch ( mrk->
type ) {
1013 case OVR_MARKER_POINT:
1014 glUseProgram( shaders.hilight.program );
1015 glUniform1f( shaders.hilight.dt, ovr_dt );
1020 case OVR_MARKER_CIRCLE:
1021 r =
MAX( mrk->
u.circle.r / res,
1023 glUseProgram( shaders.hilight_circle.program );
1024 glUniform1f( shaders.hilight_circle.dt, ovr_dt );
1031 if ( fg && mrk->
text != NULL ) {
1032 switch ( mrk->
type ) {
1033 case OVR_MARKER_POINT:
1039 case OVR_MARKER_CIRCLE:
1040 map_overlayToScreenPos( &x, &y, mrk->
u.circle.textpos.
x,
1041 mrk->
u.circle.textpos.
y );
1050 NTracingZoneEnd( _ctx );
1056void ovr_mrkFree(
void )
1065 ovr_render_safelanes = NULL;
1071void ovr_mrkClear(
void )
1073 for (
int i = 0; i <
array_size( ovr_markers ); i++ )
1074 ovr_mrkCleanup( &ovr_markers[i] );
1103 if ( ovr_markers == NULL )
1108 mrk->
id = ++mrk_idgen;
1121unsigned int ovr_mrkAddPoint(
const char *text,
double x,
double y )
1126 for (
int i = 0; i <
array_size( ovr_markers ); i++ ) {
1127 mrk = &ovr_markers[i];
1129 if ( mrk->
type != OVR_MARKER_POINT )
1132 if ( ( ( text == NULL ) && ( mrk->
text != NULL ) ) ||
1133 ( ( text != NULL ) &&
1134 ( ( mrk->
text == NULL ) || strcmp( text, mrk->
text ) != 0 ) ) )
1137 if ( hypotf( x - mrk->
pos.
x, y - mrk->
pos.
y ) > 1e-3 )
1147 mrk->
type = OVR_MARKER_POINT;
1149 mrk->
text = strdup( text );
1150 vec2_cset( &mrk->
pos, x, y );
1168unsigned int ovr_mrkAddCircle(
const char *text,
double x,
double y,
double r )
1173 for (
int i = 0; i <
array_size( ovr_markers ); i++ ) {
1174 mrk = &ovr_markers[i];
1176 if ( mrk->
type != OVR_MARKER_CIRCLE )
1179 if ( ( ( text == NULL ) && ( mrk->
text != NULL ) ) ||
1180 ( ( text != NULL ) &&
1181 ( ( mrk->
text == NULL ) || strcmp( text, mrk->
text ) != 0 ) ) )
1184 if ( ( mrk->
u.circle.r - r ) > 1e-3 ||
1185 hypotf( x - mrk->
pos.
x, y - mrk->
pos.
y ) > 1e-3 )
1195 mrk->
type = OVR_MARKER_CIRCLE;
1197 mrk->
text = strdup( text );
1198 vec2_cset( &mrk->
pos, x, y );
1199 mrk->
u.circle.r = r;
1200 vec2_cset( &mrk->
u.circle.textpos, x + r * M_SQRT1_2, y - r * M_SQRT1_2 );
1214void ovr_mrkRm(
unsigned int id )
1216 for (
int i = 0; i <
array_size( ovr_markers ); i++ ) {
1225 ovr_mrkCleanup( m );
1235void ovr_autonavPos(
double x,
double y )
1238 vec2_cset( &autonav_pos_v, x, y );
1245void ovr_autonavClear(
void )
Provides macros to work with dynamic arrays.
#define array_free(ptr_array)
Frees memory allocated and sets array to NULL.
#define array_end(array)
Returns a pointer to the end of the reserved memory space.
#define array_erase(ptr_array, first, last)
Erases elements in interval [first, last).
static ALWAYS_INLINE int array_size(const void *array)
Returns number of elements in the array.
#define array_grow(ptr_array)
Increases the number of elements by one and returns the last element.
#define array_push_back(ptr_array, element)
Adds a new element at the end of the array.
#define array_begin(array)
Returns a pointer to the beginning of the reserved memory space.
#define array_create(basic_type)
Creates a new dynamic array of ‘basic_type’.
int gl_printWidthRaw(const glFont *ft_font, const char *text)
Gets the width that it would take to print some text.
void gl_printMarkerRaw(const glFont *ft_font, double x, double y, const glColour *c, const char *text)
Wrapper for gl_printRaw for map overlay markers.
void gui_renderSpob(int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay)
Draws the spobs in the minimap.
void gui_renderPlayer(double res, int overlay)
Renders the player cross on the radar or whatever.
void gui_renderAsteroid(const Asteroid *a, double w, double h, double res, int overlay)
Renders an asteroid in the GUI radar.
void gui_renderJumpPoint(int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay)
Renders a jump point on the minimap.
void gui_renderPilot(const Pilot *p, RadarShape shape, double w, double h, double res, int overlay)
Renders a pilot in the GUI radar.
mat4 mat4_identity(void)
Creates an identity matrix.
mat4 mat4_ortho(double left, double right, double bottom, double top, double nearVal, double farVal)
Creates an orthographic projection matrix.
Header file with generic functions and naev-specifics.
void gl_windowToScreenPos(int *sx, int *sy, int wx, int wy)
Translates the window position to screen position.
void gl_renderShader(double x, double y, double w, double h, double r, const SimpleShader *shd, const glColour *c, int center)
Renders a simple shader.
void gl_renderRect(double x, double y, double w, double h, const glColour *c)
Renders a rectangle.
void gl_vboActivateAttribOffset(gl_vbo *vbo, GLuint index, GLuint offset, GLint size, GLenum type, GLsizei stride)
Activates a VBO's offset.
int pilot_validTarget(const Pilot *p, const Pilot *target)
Checks to see if a pilot is a valid target for another pilot.
int pilot_isFriendly(const Pilot *p)
Checks to see if pilot is friendly to the player.
Pilot *const * pilot_getAll(void)
Gets the pilot stack.
double pilot_sensorRange(void)
Returns the default sensor range for the current system.
SafeLane * safelanes_get(int faction, int standing, const StarSystem *system)
Gets a set of safelanes for a faction and system.
StarSystem * system_getIndex(int id)
Get the system by its index.
const char * jump_getSymbol(const JumpPoint *jp)
Gets the jump point symbol.
const char * spob_getSymbol(const Spob *p)
Gets the spob symbol.
JumpPoint * jump_getTarget(const StarSystem *target, const StarSystem *sys)
Less safe version of jump_get that works with pointers.
Spob * spob_getIndex(int ind)
Gets spob by index.
const char * spob_name(const Spob *p)
Gets the translated name of a spob.
glTexture * jumppoint_gfx
Represents an asteroid field anchor.
Represents an asteroid exclusion zone.
Represents a single asteroid.
Saves the layout decisions from positioning labeled objects on the overlay.
The representation of an in-game pilot.
Describes a safe lane, patrolled by a faction, within a system.
SafeLaneLocType point_type[2]
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
union ovr_marker_t::@262136050011044364077016166005172071115077263103 u