![]() |
naev 0.12.5
|
Contains the GUI stuff for the player. More...
#include "gui.h"#include "ai.h"#include "array.h"#include "camera.h"#include "conf.h"#include "font.h"#include "gui_omsg.h"#include "gui_osd.h"#include "input.h"#include "land.h"#include "log.h"#include "map_overlay.h"#include "menu.h"#include "ndata.h"#include "nlua.h"#include "nlua_gfx.h"#include "nlua_gui.h"#include "nlua_tk.h"#include "nstring.h"#include "ntracing.h"#include "opengl.h"#include "pause.h"#include "pilot.h"#include "player.h"#include "player_gui.h"#include "render.h"#include "space.h"#include "spfx.h"#include "start.h"#include "toolkit.h"
Go to the source code of this file.
Data Structures | |
| struct | Radar |
| Represents the player's radar. More... | |
| struct | Mesg |
| On screen player message. More... | |
Macros | |
| #define | XML_GUI_ID "GUIs" |
| #define | XML_GUI_TAG "gui" |
| #define | RADAR_BLINK_PILOT 0.5 |
| #define | RADAR_BLINK_SPOB 1. |
| #define | RADAR_RES_MAX 300. |
| #define | RADAR_RES_REF 100. |
| #define | RADAR_RES_MIN 10. |
| #define | RADAR_RES_INTERVAL 10. |
| #define | LUA_FUNC(funcname) |
| #define | LUA_CLEANUP(varname) |
Functions | |
| void | weapon_minimap (const double res, const double w, const double h, const RadarShape shape, double alpha) |
| Draws the minimap weapons (used in player.c). | |
| static void | gui_renderTargetReticles (const SimpleShader *shd, double x, double y, double radius, double angle, const glColour *c) |
| Renders spob and jump point targeting reticles. | |
| static void | gui_borderIntersection (double *cx, double *cy, double rx, double ry, double hw, double hh) |
| Gets the intersection with the border. | |
| static void | gui_renderPilotTarget (void) |
| Renders the players pilot target. | |
| static void | gui_renderSpobTarget (void) |
| Sets up rendering of spob and jump point targeting reticles. | |
| static void | gui_renderBorder (double dt) |
| Renders the ships/spobs in the border. | |
| static void | gui_renderMessages (double dt) |
| Renders the player's messages on screen. | |
| static const glColour * | gui_getSpobColour (int i) |
| Gets the colour of a spob. | |
| static void | gui_renderRadarOutOfRange (RadarShape sh, int w, int h, int cx, int cy, const glColour *col) |
| Renders an out of range marker for the spob. | |
| static void | gui_blink (double cx, double cy, double vr, const glColour *col, double blinkInterval, double blinkVar) |
| Renders the spob blink around a position on the minimap. | |
| static const glColour * | gui_getPilotColour (const Pilot *p) |
| Gets a pilot's colour, with a special colour for targets. | |
| static void | gui_calcBorders (void) |
| Calculates and sets the GUI borders. | |
| static int | gui_doFunc (int func_ref, const char *func_name) |
| Runs a GUI Lua function. | |
| static int | gui_prepFunc (int func_ref, const char *func_name) |
| Prepares to run a function. | |
| static int | gui_runFunc (const char *func, int nargs, int nret) |
| Runs a function. | |
| void | gui_setDefaults (void) |
| void | gui_messageInit (int width, int x, int y) |
| Initializes the message system. | |
| void | gui_messageScrollUp (int lines) |
| Scrolls up the message box. | |
| void | gui_messageScrollDown (int lines) |
| Scrolls down the message box. | |
| void | player_messageToggle (int enable) |
| Toggles if player should receive messages. | |
| void | player_messageRaw (const char *str) |
| Adds a mesg to the queue to be displayed on screen. | |
| void | player_message (const char *fmt,...) |
| Adds a mesg to the queue to be displayed on screen. | |
| int | gui_onScreenPilot (double *rx, double *ry, const Pilot *pilot) |
| Takes a pilot and returns whether it's on screen, plus its relative position. | |
| 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. | |
| void | gui_renderReticles (double dt) |
| Renders the gui targeting reticles. | |
| void | gui_render (double dt) |
| Renders the player's GUI. | |
| void | gui_cooldownEnd (void) |
| Notifies GUI scripts that the player broke out of cooldown. | |
| int | gui_radarInit (int circle, int w, int h) |
| Initializes the radar. | |
| void | gui_radarRender (double x, double y) |
| Renders the GUI radar. | |
| void | gui_radarGetRes (double *res) |
| Outputs the radar's resolution. | |
| void | gui_clearMessages (void) |
| Clears the GUI messages. | |
| void | gui_renderPilot (const Pilot *p, RadarShape shape, double w, double h, double res, int overlay) |
| Renders a pilot in the GUI radar. | |
| void | gui_renderAsteroid (const Asteroid *a, double w, double h, double res, int overlay) |
| Renders an asteroid in the GUI radar. | |
| void | gui_renderPlayer (double res, int overlay) |
| Renders the player cross on the radar or whatever. | |
| void | gui_forceBlink (void) |
| Force sets the spob and pilot radar blink. | |
| 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_renderJumpPoint (int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay) |
| Renders a jump point on the minimap. | |
| void | gui_setViewport (double x, double y, double w, double h) |
| Sets the viewport. | |
| void | gui_clearViewport (void) |
| Resets the viewport. | |
| int | gui_init (void) |
| Initializes the GUI system. | |
| void | gui_reload (void) |
| Reloads the GUI. | |
| void | gui_setCargo (void) |
| Player just changed their cargo. | |
| void | gui_setNav (void) |
| Player just changed their nav computer target. | |
| void | gui_setTarget (void) |
| Player just changed their pilot target. | |
| void | gui_setShip (void) |
| Player just upgraded their ship or modified it. | |
| void | gui_setSystem (void) |
| Player just changed their system. | |
| void | gui_updateFaction (void) |
| Player's relationship with a faction was modified. | |
| void | gui_updateEffects (void) |
| void | gui_setGeneric (const Pilot *pilot) |
| Calls trigger functions depending on who the pilot is. | |
| const char * | gui_pick (void) |
| Determines which GUI should be used. | |
| int | gui_exists (const char *name) |
| Checks to see if a GUI exists. | |
| int | gui_load (const char *name) |
| Attempts to load the actual GUI. | |
| void | gui_cleanup (void) |
| Cleans up the GUI. | |
| void | gui_free (void) |
| Frees the gui stuff. | |
| void | gui_setRadarResolution (double res) |
| Sets the radar resolution. | |
| void | gui_setRadarRel (int mod) |
| Modifies the radar resolution. | |
| void | gui_getOffset (double *x, double *y) |
| Gets the GUI offset. | |
| glTexture * | gui_hailIcon (void) |
| Gets the hail icon texture. | |
| void | gui_targetSpobGFX (const glTexture *gfx) |
| Sets the spob target GFX. | |
| void | gui_targetPilotGFX (const glTexture *gfx) |
| Sets the pilot target GFX. | |
| static void | gui_eventToScreenPos (int *sx, int *sy, int ex, int ey) |
| Translates a mouse position from an SDL_Event to GUI coordinates. | |
| int | gui_radarClickEvent (SDL_Event *event) |
| Handles a click at a position in the current system. | |
| int | gui_borderClickEvent (SDL_Event *event) |
| Handles clicks on the GUI border icons. | |
| int | gui_handleEvent (SDL_Event *evt) |
| Handles GUI events. | |
| void | gui_mouseClickEnable (int enable) |
| Enables the mouse click callback. | |
| void | gui_mouseMoveEnable (int enable) |
| Enables the mouse movement callback. | |
Variables | |
| static double | blink_pilot = 0. |
| static double | blink_spob = 0. |
| static double | animation_dt = 0. |
| static gl_vbo * | gui_radar_select_vbo = NULL |
| static int | gui_getMessage |
| static char * | gui_name = NULL |
| static IntList | gui_qtquery |
| unsigned int | land_wid |
| static nlua_env | gui_env = LUA_NOREF |
| static int | gui_L_mclick = 0 |
| static int | gui_L_mmove = 0 |
| static double | gui_viewport_x = 0. |
| static double | gui_viewport_y = 0. |
| static double | gui_viewport_w = 0. |
| static double | gui_viewport_h = 0. |
| static Radar | gui_radar |
| static double | gui_xoff = 0. |
| static double | gui_yoff = 0. |
| static const int | mesg_max = 128 |
| static int | mesg_pointer |
| static int | mesg_viewpoint = -1 |
| static const double | mesg_timeout = 15. |
| static Mesg * | mesg_stack |
| static int | gui_mesg_w = 0 |
| static int | gui_mesg_x = 0 |
| static int | gui_mesg_y = 0 |
| static double | gui_tr = 0. |
| static double | gui_br = 0. |
| static double | gui_tl = 0. |
| static double | gui_bl = 0. |
| static glTexture * | gui_ico_hail = NULL |
| static glTexture * | gui_target_spob = NULL |
| static glTexture * | gui_target_pilot = NULL |
| static int | gui_lua_create = LUA_NOREF |
| static int | gui_lua_render = LUA_NOREF |
| static int | gui_lua_render_cooldown = LUA_NOREF |
| static int | gui_lua_cooldown_end = LUA_NOREF |
| static int | gui_lua_mouse_move = LUA_NOREF |
| static int | gui_lua_mouse_click = LUA_NOREF |
| static int | gui_lua_update_cargo = LUA_NOREF |
| static int | gui_lua_update_nav = LUA_NOREF |
| static int | gui_lua_update_target = LUA_NOREF |
| static int | gui_lua_update_ship = LUA_NOREF |
| static int | gui_lua_update_system = LUA_NOREF |
| static int | gui_lua_update_faction = LUA_NOREF |
| static int | gui_lua_update_effects = LUA_NOREF |
| static int | can_jump |
Contains the GUI stuff for the player.
Definition in file gui.c.
| #define LUA_CLEANUP | ( | varname | ) |
| #define LUA_FUNC | ( | funcname | ) |
| #define RADAR_BLINK_PILOT 0.5 |
| #define RADAR_BLINK_SPOB 1. |
| #define RADAR_RES_INTERVAL 10. |
| #define XML_GUI_ID "GUIs" |
|
static |
| int gui_borderClickEvent | ( | SDL_Event * | event | ) |
|
static |
Gets the intersection with the border.
http://en.wikipedia.org/wiki/Intercept_theorem
| [out] | cx | X intersection. |
| [out] | cy | Y intersection. |
| rx | Center X position of intersection. | |
| ry | Center Y position of intersection. | |
| hw | Screen half-width. | |
| hh | Screen half-height. |
|
static |
| void gui_cooldownEnd | ( | void | ) |
|
static |
|
static |
| int gui_exists | ( | const char * | name | ) |
| void gui_forceBlink | ( | void | ) |
| void gui_getOffset | ( | double * | x, |
| double * | y ) |
|
static |
Gets a pilot's colour, with a special colour for targets.
| p | Pilot to get colour of. |
|
static |
| glTexture * gui_hailIcon | ( | void | ) |
| int gui_init | ( | void | ) |
| int gui_load | ( | const char * | name | ) |
| void gui_messageInit | ( | int | width, |
| int | x, | ||
| int | y ) |
| void gui_messageScrollDown | ( | int | lines | ) |
| void gui_messageScrollUp | ( | int | lines | ) |
| void gui_mouseClickEnable | ( | int | enable | ) |
| void gui_mouseMoveEnable | ( | int | enable | ) |
| int gui_onScreenPilot | ( | double * | rx, |
| double * | ry, | ||
| const Pilot * | pilot ) |
Takes a pilot and returns whether it's on screen, plus its relative position.
| [out] | rx | Relative X position (factoring in viewport offset) |
| [out] | ry | Relative Y position (factoring in viewport offset) |
| pilot | Pilot to determine the visibility and position of |
| 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.
| [out] | rx | Relative X position (factoring in viewport offset) |
| [out] | ry | Relative Y position (factoring in viewport offset) |
| jp | Jump point to determine the visibility and position of | |
| pnt | Spob to determine the visibility and position of |
| const char * gui_pick | ( | void | ) |
|
static |
| int gui_radarClickEvent | ( | SDL_Event * | event | ) |
| void gui_radarGetRes | ( | double * | res | ) |
| int gui_radarInit | ( | int | circle, |
| int | w, | ||
| int | h ) |
| void gui_radarRender | ( | double | x, |
| double | y ) |
| void gui_render | ( | double | dt | ) |
| void gui_renderAsteroid | ( | const Asteroid * | a, |
| double | w, | ||
| double | h, | ||
| double | res, | ||
| int | overlay ) |
|
static |
| void gui_renderJumpPoint | ( | int | ind, |
| RadarShape | shape, | ||
| double | w, | ||
| double | h, | ||
| double | res, | ||
| double | alpha, | ||
| int | overlay ) |
|
static |
| void gui_renderPilot | ( | const Pilot * | p, |
| RadarShape | shape, | ||
| double | w, | ||
| double | h, | ||
| double | res, | ||
| int | overlay ) |
|
static |
| void gui_renderPlayer | ( | double | res, |
| int | overlay ) |
|
static |
| void gui_renderReticles | ( | double | dt | ) |
| void gui_renderSpob | ( | int | ind, |
| RadarShape | shape, | ||
| double | w, | ||
| double | h, | ||
| double | res, | ||
| double | alpha, | ||
| int | overlay ) |
|
static |
|
static |
|
static |
| void gui_setGeneric | ( | const Pilot * | pilot | ) |
| void gui_setNav | ( | void | ) |
| void gui_setRadarRel | ( | int | mod | ) |
| void gui_setRadarResolution | ( | double | res | ) |
| void gui_setShip | ( | void | ) |
| void gui_setSystem | ( | void | ) |
| void gui_setTarget | ( | void | ) |
| void gui_setViewport | ( | double | x, |
| double | y, | ||
| double | w, | ||
| double | h ) |
| void gui_targetPilotGFX | ( | const glTexture * | gfx | ) |
| void gui_targetSpobGFX | ( | const glTexture * | gfx | ) |
| void gui_updateFaction | ( | void | ) |
| void player_message | ( | const char * | fmt, |
| ... ) |
| void player_messageRaw | ( | const char * | str | ) |
| void player_messageToggle | ( | int | enable | ) |
|
extern |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
extern |
|
static |
|
static |