naev 0.11.5
gui.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "opengl.h"
7#include "pilot.h"
8#include "space.h"
9
10/*
11 * enums
12 */
13typedef enum RadarShape_ {
14 RADAR_RECT,
15 RADAR_CIRCLE
16} RadarShape;
18/*
19 * Loading/cleaning up.
20 */
21int gui_init (void);
22void gui_free (void);
23int gui_exists( const char *name );
24int gui_load( const char *name );
25void gui_cleanup (void);
26void gui_reload (void);
27
28/*
29 * Triggers.
30 */
31void gui_setCargo (void);
32void gui_setNav (void);
33void gui_setTarget (void);
34void gui_setShip (void);
35void gui_setSystem (void);
36void gui_updateFaction (void);
37void gui_updateEffects (void);
38void gui_setGeneric( const Pilot* pilot );
39
40/*
41 * Rendering.
42 */
43void gui_renderReticles( double dt );
44void gui_render( double dt );
45void gui_forceBlink (void);
46
47/*
48 * Messages.
49 */
50void gui_messageInit( int width, int x, int y );
51void gui_clearMessages (void);
52void gui_cooldownEnd (void);
53void gui_messageScrollUp( int lines );
54void gui_messageScrollDown( int lines );
55
56/*
57 * Radar.
58 */
59int gui_radarInit( int circle, int w, int h );
60void gui_radarRender( double x, double y );
61void gui_radarGetRes( double* res );
62int gui_borderClickEvent( SDL_Event *event );
63int gui_radarClickEvent( SDL_Event* event );
64
65/*
66 * Render radar.
67 */
68void gui_renderSpob( int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay );
69void gui_renderJumpPoint( int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay );
70void gui_renderPilot( const Pilot* p, RadarShape shape, double w, double h, double res, int overlay );
71void gui_renderAsteroid( const Asteroid* a, double w, double h, double res, int overlay );
72void gui_renderPlayer( double res, int overlay );
73
74/*
75 * Targeting.
76 */
77void gui_targetSpobGFX( glTexture *gfx );
78void gui_targetPilotGFX( glTexture *gfx );
79
80/*
81 * Mouse.
82 */
83int gui_handleEvent( SDL_Event *evt );
84void gui_mouseClickEnable( int enabel );
85void gui_mouseMoveEnable( int enabel );
86
87/*
88 * Misc.
89 */
90void gui_setViewport( double x, double y, double w, double h );
91void gui_clearViewport (void);
92void gui_setDefaults (void);
93void gui_setRadarResolution( double res );
94void gui_setRadarRel( int mod );
95void gui_getOffset( double *x, double *y );
97const char* gui_pick (void);
98int gui_onScreenPilot( double *rx, double *ry, const Pilot *pilot );
99int gui_onScreenSpob( double *rx, double *ry, const JumpPoint *jp, 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:1372
int gui_radarClickEvent(SDL_Event *event)
Handles a click at a position in the current system.
Definition gui.c:2108
void gui_clearMessages(void)
Clears the GUI messages.
Definition gui.c:986
int gui_init(void)
Initializes the GUI system.
Definition gui.c:1623
int gui_radarInit(int circle, int w, int h)
Initializes the radar.
Definition gui.c:868
void gui_setTarget(void)
Player just changed their pilot target.
Definition gui.c:1783
void gui_renderPlayer(double res, int overlay)
Renders the player cross on the radar or whatever.
Definition gui.c:1267
int gui_handleEvent(SDL_Event *evt)
Handles GUI events.
Definition gui.c:2192
void gui_messageScrollDown(int lines)
Scrolls up the message box.
Definition gui.c:258
glTexture * gui_hailIcon(void)
Gets the hail icon texture.
Definition gui.c:2071
void gui_setDefaults(void)
Definition gui.c:204
int gui_borderClickEvent(SDL_Event *event)
Handles clicks on the GUI border icons.
Definition gui.c:2137
void gui_setSystem(void)
Player just changed their system.
Definition gui.c:1799
const char * gui_pick(void)
Determines which GUI should be used.
Definition gui.c:1844
void gui_radarRender(double x, double y)
Renders the GUI radar.
Definition gui.c:883
void gui_setRadarRel(int mod)
Modifies the radar resolution.
Definition gui.c:2049
void gui_renderAsteroid(const Asteroid *a, double w, double h, double res, int overlay)
Renders an asteroid in the GUI radar.
Definition gui.c:1200
int gui_exists(const char *name)
Checks to see if a GUI exists.
Definition gui.c:1863
void gui_mouseMoveEnable(int enable)
Enables the mouse movement callback.
Definition gui.c:2254
void gui_messageScrollUp(int lines)
Scrolls up the message box.
Definition gui.c:229
void gui_mouseClickEnable(int enable)
Enables the mouse click callback.
Definition gui.c:2246
void gui_updateFaction(void)
Player's relationship with a faction was modified.
Definition gui.c:1807
int gui_load(const char *name)
Attempts to load the actual GUI.
Definition gui.c:1876
void gui_getOffset(double *x, double *y)
Gets the GUI offset.
Definition gui.c:2062
void gui_targetPilotGFX(glTexture *gfx)
Sets the pilot target GFX.
Definition gui.c:2088
void gui_setShip(void)
Player just upgraded their ship or modified it.
Definition gui.c:1791
void gui_free(void)
Frees the gui stuff.
Definition gui.c:2008
void gui_messageInit(int width, int x, int y)
Initializes the message system.
Definition gui.c:217
void gui_clearViewport(void)
Resets the viewport.
Definition gui.c:1584
void gui_radarGetRes(double *res)
Outputs the radar's resolution.
Definition gui.c:978
void gui_reload(void)
Reloads the GUI.
Definition gui.c:1756
void gui_forceBlink(void)
Force sets the spob and pilot radar blink.
Definition gui.c:1312
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:624
void gui_cooldownEnd(void)
Notifies GUI scripts that the player broke out of cooldown.
Definition gui.c:856
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:1477
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:661
void gui_cleanup(void)
Cleans up the GUI.
Definition gui.c:1954
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:1107
void gui_setNav(void)
Player just changed their nav computer target.
Definition gui.c:1775
void gui_renderReticles(double dt)
Renders the gui targeting reticles.
Definition gui.c:703
void gui_render(double dt)
Renders the player's GUI.
Definition gui.c:725
void gui_setGeneric(const Pilot *pilot)
Calls trigger functions depending on who the pilot is.
Definition gui.c:1824
void gui_targetSpobGFX(glTexture *gfx)
Sets the spob target GFX.
Definition gui.c:2079
void gui_setViewport(double x, double y, double w, double h)
Sets the viewport.
Definition gui.c:1566
void gui_setRadarResolution(double res)
Sets the radar resolution.
Definition gui.c:2039
void gui_setCargo(void)
Player just changed their cargo.
Definition gui.c:1767
Represents a single asteroid.
Definition asteroid.h:77
The representation of an in-game pilot.
Definition pilot.h:217
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Definition space.h:89
Abstraction for rendering sprite sheets.
Definition opengl_tex.h:36