naev 0.12.6
gui.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
7#include "SDL_events.h"
9
10#include "opengl_tex.h"
11#include "pilot.h"
12#include "space.h"
13
14/*
15 * enums
16 */
17typedef enum RadarShape_ {
18 RADAR_RECT,
19 RADAR_CIRCLE
20} RadarShape;
21
22/*
23 * Loading/cleaning up.
24 */
25int gui_init( void );
26void gui_free( void );
27int gui_exists( const char *name );
28int gui_load( const char *name );
29void gui_cleanup( void );
30void gui_reload( void );
31
32/*
33 * Triggers.
34 */
35void gui_setCargo( void );
36void gui_setNav( void );
37void gui_setTarget( void );
38void gui_setShip( void );
39void gui_setSystem( void );
40void gui_updateFaction( void );
41void gui_updateEffects( void );
42void gui_setGeneric( const Pilot *pilot );
43
44/*
45 * Rendering.
46 */
47void gui_renderReticles( double dt );
48void gui_render( double dt );
49void gui_forceBlink( void );
50
51/*
52 * Messages.
53 */
54void gui_messageInit( int width, int x, int y );
55void gui_clearMessages( void );
56void gui_cooldownEnd( void );
57void gui_messageScrollUp( int lines );
58void gui_messageScrollDown( int lines );
59
60/*
61 * Radar.
62 */
63int gui_radarInit( int circle, int w, int h );
64void gui_radarRender( double x, double y );
65void gui_radarGetRes( double *res );
66int gui_borderClickEvent( SDL_Event *event );
67int gui_radarClickEvent( SDL_Event *event );
68
69/*
70 * Render radar.
71 */
72void gui_renderSpob( int ind, RadarShape shape, double w, double h, double res,
73 double alpha, int overlay );
74void gui_renderJumpPoint( int ind, RadarShape shape, double w, double h,
75 double res, double alpha, int overlay );
76void gui_renderPilot( const Pilot *p, RadarShape shape, double w, double h,
77 double res, int overlay );
78void gui_renderAsteroid( const Asteroid *a, double w, double h, double res,
79 int overlay );
80void gui_renderPlayer( double res, int overlay );
81
82/*
83 * Targeting.
84 */
85void gui_targetSpobGFX( const glTexture *gfx );
86void gui_targetPilotGFX( const glTexture *gfx );
87
88/*
89 * Mouse.
90 */
91int gui_handleEvent( SDL_Event *evt );
92void gui_mouseClickEnable( int enabel );
93void gui_mouseMoveEnable( int enabel );
94
95/*
96 * Misc.
97 */
98void gui_setViewport( double x, double y, double w, double h );
99void gui_clearViewport( void );
100void gui_setDefaults( void );
101void gui_setRadarResolution( double res );
102void gui_setRadarRel( int mod );
103void gui_getOffset( double *x, double *y );
104glTexture *gui_hailIcon( void );
105const char *gui_pick( void );
106int gui_onScreenPilot( double *rx, double *ry, const Pilot *pilot );
107int gui_onScreenSpob( double *rx, double *ry, const JumpPoint *jp,
108 const Spob *pnt );
void gui_renderSpob(int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay)
Draws the spobs in the minimap.
Definition gui.c:1456
int gui_radarClickEvent(SDL_Event *event)
Handles a click at a position in the current system.
Definition gui.c:2205
void gui_clearMessages(void)
Clears the GUI messages.
Definition gui.c:1037
int gui_init(void)
Initializes the GUI system.
Definition gui.c:1714
int gui_radarInit(int circle, int w, int h)
Initializes the radar.
Definition gui.c:910
void gui_setTarget(void)
Player just changed their pilot target.
Definition gui.c:1872
void gui_renderPlayer(double res, int overlay)
Renders the player cross on the radar or whatever.
Definition gui.c:1349
int gui_handleEvent(SDL_Event *evt)
Handles GUI events.
Definition gui.c:2295
void gui_messageScrollDown(int lines)
Scrolls down the message box.
Definition gui.c:254
glTexture * gui_hailIcon(void)
Gets the hail icon texture.
Definition gui.c:2168
void gui_setDefaults(void)
Definition gui.c:198
int gui_borderClickEvent(SDL_Event *event)
Handles clicks on the GUI border icons.
Definition gui.c:2236
void gui_setSystem(void)
Player just changed their system.
Definition gui.c:1888
const char * gui_pick(void)
Determines which GUI should be used.
Definition gui.c:1933
void gui_radarRender(double x, double y)
Renders the GUI radar.
Definition gui.c:925
void gui_setRadarRel(int mod)
Modifies the radar resolution.
Definition gui.c:2146
void gui_renderAsteroid(const Asteroid *a, double w, double h, double res, int overlay)
Renders an asteroid in the GUI radar.
Definition gui.c:1280
int gui_exists(const char *name)
Checks to see if a GUI exists.
Definition gui.c:1952
void gui_mouseMoveEnable(int enable)
Enables the mouse movement callback.
Definition gui.c:2357
void gui_messageScrollUp(int lines)
Scrolls up the message box.
Definition gui.c:223
void gui_mouseClickEnable(int enable)
Enables the mouse click callback.
Definition gui.c:2349
void gui_updateFaction(void)
Player's relationship with a faction was modified.
Definition gui.c:1896
int gui_load(const char *name)
Attempts to load the actual GUI.
Definition gui.c:1965
void gui_getOffset(double *x, double *y)
Gets the GUI offset.
Definition gui.c:2159
void gui_setShip(void)
Player just upgraded their ship or modified it.
Definition gui.c:1880
void gui_free(void)
Frees the gui stuff.
Definition gui.c:2107
void gui_messageInit(int width, int x, int y)
Initializes the message system.
Definition gui.c:211
void gui_clearViewport(void)
Resets the viewport.
Definition gui.c:1675
void gui_radarGetRes(double *res)
Outputs the radar's resolution.
Definition gui.c:1029
void gui_reload(void)
Reloads the GUI.
Definition gui.c:1845
void gui_forceBlink(void)
Force sets the spob and pilot radar blink.
Definition gui.c:1395
int gui_onScreenPilot(double *rx, double *ry, const Pilot *pilot)
Takes a pilot and returns whether it's on screen, plus its relative position.
Definition gui.c:651
void gui_targetPilotGFX(const glTexture *gfx)
Sets the pilot target GFX.
Definition gui.c:2185
void gui_cooldownEnd(void)
Notifies GUI scripts that the player broke out of cooldown.
Definition gui.c:898
void gui_renderJumpPoint(int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay)
Renders a jump point on the minimap.
Definition gui.c:1563
int gui_onScreenSpob(double *rx, double *ry, const JumpPoint *jp, const Spob *pnt)
Takes a spob or jump point and returns whether it's on screen, plus its relative position.
Definition gui.c:690
void gui_cleanup(void)
Cleans up the GUI.
Definition gui.c:2047
void gui_renderPilot(const Pilot *p, RadarShape shape, double w, double h, double res, int overlay)
Renders a pilot in the GUI radar.
Definition gui.c:1180
void gui_targetSpobGFX(const glTexture *gfx)
Sets the spob target GFX.
Definition gui.c:2176
void gui_setNav(void)
Player just changed their nav computer target.
Definition gui.c:1864
void gui_renderReticles(double dt)
Renders the gui targeting reticles.
Definition gui.c:732
void gui_render(double dt)
Renders the player's GUI.
Definition gui.c:755
void gui_setGeneric(const Pilot *pilot)
Calls trigger functions depending on who the pilot is.
Definition gui.c:1913
void gui_setViewport(double x, double y, double w, double h)
Sets the viewport.
Definition gui.c:1656
void gui_setRadarResolution(double res)
Sets the radar resolution.
Definition gui.c:2136
void gui_setCargo(void)
Player just changed their cargo.
Definition gui.c:1856
Represents a single asteroid.
Definition asteroid.h:88
The representation of an in-game pilot.
Definition pilot.h:263
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Definition space.h:102
Abstraction for rendering sprite sheets.
Definition opengl_tex.h:43