naev 0.10.4
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_load( const char* name );
24void gui_cleanup (void);
25void gui_reload (void);
26
27/*
28 * Triggers.
29 */
30void gui_setCargo (void);
31void gui_setNav (void);
32void gui_setTarget (void);
33void gui_setShip (void);
34void gui_setSystem (void);
35void gui_updateFaction (void);
36void gui_updateEffects (void);
37void gui_setGeneric( const Pilot* pilot );
38
39/*
40 * Rendering.
41 */
42void gui_renderReticles( double dt );
43void gui_render( double dt );
44void gui_forceBlink (void);
45
46/*
47 * Messages.
48 */
49void gui_messageInit( int width, int x, int y );
50void gui_clearMessages (void);
51void gui_cooldownEnd (void);
52void gui_messageScrollUp( int lines );
53void gui_messageScrollDown( int lines );
54
55/*
56 * Radar.
57 */
58int gui_radarInit( int circle, int w, int h );
59void gui_radarRender( double x, double y );
60void gui_radarGetRes( double* res );
61int gui_borderClickEvent( SDL_Event *event );
62int gui_radarClickEvent( SDL_Event* event );
63
64/*
65 * Render radar.
66 */
67void gui_renderSpob( int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay );
68void gui_renderJumpPoint( int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay );
69void gui_renderPilot( const Pilot* p, RadarShape shape, double w, double h, double res, int overlay );
70void gui_renderAsteroid( const Asteroid* a, double w, double h, double res, int overlay );
71void gui_renderPlayer( double res, int overlay );
72
73/*
74 * Targeting.
75 */
76void gui_targetSpobGFX( glTexture *gfx );
77void gui_targetPilotGFX( glTexture *gfx );
78
79/*
80 * Mouse.
81 */
82int gui_handleEvent( SDL_Event *evt );
83void gui_mouseClickEnable( int enabel );
84void gui_mouseMoveEnable( int enabel );
85
86/*
87 * Misc.
88 */
89void gui_setViewport( double x, double y, double w, double h );
90void gui_clearViewport (void);
91void gui_setDefaults (void);
92void gui_setRadarResolution( double res );
93void gui_setRadarRel( int mod );
94void gui_getOffset( double *x, double *y );
96char* gui_pick (void);
97int gui_onScreenPilot( double *rx, double *ry, const Pilot *pilot );
98int 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:1344
int gui_radarClickEvent(SDL_Event *event)
Handles a click at a position in the current system.
Definition: gui.c:2067
void gui_clearMessages(void)
Clears the GUI messages.
Definition: gui.c:973
int gui_init(void)
Initializes the GUI system.
Definition: gui.c:1592
int gui_radarInit(int circle, int w, int h)
Initializes the radar.
Definition: gui.c:863
void gui_setTarget(void)
Player just changed their pilot target.
Definition: gui.c:1757
void gui_renderPlayer(double res, int overlay)
Renders the player cross on the radar or whatever.
Definition: gui.c:1239
int gui_handleEvent(SDL_Event *evt)
Handles GUI events.
Definition: gui.c:2151
void gui_messageScrollDown(int lines)
Scrolls up the message box.
Definition: gui.c:253
glTexture * gui_hailIcon(void)
Gets the hail icon texture.
Definition: gui.c:2030
void gui_setDefaults(void)
Definition: gui.c:199
int gui_borderClickEvent(SDL_Event *event)
Handles clicks on the GUI border icons.
Definition: gui.c:2096
void gui_setSystem(void)
Player just changed their system.
Definition: gui.c:1773
void gui_radarRender(double x, double y)
Renders the GUI radar.
Definition: gui.c:878
void gui_setRadarRel(int mod)
Modifies the radar resolution.
Definition: gui.c:2008
void gui_renderAsteroid(const Asteroid *a, double w, double h, double res, int overlay)
Renders an asteroid in the GUI radar.
Definition: gui.c:1172
void gui_mouseMoveEnable(int enable)
Enables the mouse movement callback.
Definition: gui.c:2211
void gui_messageScrollUp(int lines)
Scrolls up the message box.
Definition: gui.c:224
void gui_mouseClickEnable(int enable)
Enables the mouse click callback.
Definition: gui.c:2203
void gui_updateFaction(void)
Player's relationship with a faction was modified.
Definition: gui.c:1781
int gui_load(const char *name)
Attempts to load the actual GUI.
Definition: gui.c:1839
char * gui_pick(void)
Determines which GUI should be used.
Definition: gui.c:1818
void gui_getOffset(double *x, double *y)
Gets the GUI offset.
Definition: gui.c:2021
void gui_targetPilotGFX(glTexture *gfx)
Sets the pilot target GFX.
Definition: gui.c:2047
void gui_setShip(void)
Player just upgraded their ship or modified it.
Definition: gui.c:1765
void gui_free(void)
Frees the gui stuff.
Definition: gui.c:1969
void gui_messageInit(int width, int x, int y)
Initializes the message system.
Definition: gui.c:212
void gui_clearViewport(void)
Resets the viewport.
Definition: gui.c:1553
void gui_radarGetRes(double *res)
Outputs the radar's resolution.
Definition: gui.c:965
void gui_reload(void)
Reloads the GUI.
Definition: gui.c:1730
void gui_forceBlink(void)
Force sets the spob and pilot radar blink.
Definition: gui.c:1284
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:619
void gui_cooldownEnd(void)
Notifies GUI scripts that the player broke out of cooldown.
Definition: gui.c:851
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:1446
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:656
void gui_cleanup(void)
Cleans up the GUI.
Definition: gui.c:1915
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:1094
void gui_setNav(void)
Player just changed their nav computer target.
Definition: gui.c:1749
void gui_renderReticles(double dt)
Renders the gui targeting reticles.
Definition: gui.c:698
void gui_render(double dt)
Renders the player's GUI.
Definition: gui.c:720
void gui_setGeneric(const Pilot *pilot)
Calls trigger functions depending on who the pilot is.
Definition: gui.c:1798
void gui_targetSpobGFX(glTexture *gfx)
Sets the spob target GFX.
Definition: gui.c:2038
void gui_setViewport(double x, double y, double w, double h)
Sets the viewport.
Definition: gui.c:1535
void gui_setRadarResolution(double res)
Sets the radar resolution.
Definition: gui.c:1998
void gui_setCargo(void)
Player just changed their cargo.
Definition: gui.c:1741
Represents a single asteroid.
Definition: asteroid.h:76
The representation of an in-game pilot.
Definition: pilot.h:210
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Definition: space.h:88
Abstraction for rendering sprite sheets.
Definition: opengl_tex.h:34