naev 0.12.5
player_autonav.c File Reference

Contains all the player autonav related stuff. More...

#include "player_autonav.h"
#include "ai.h"
#include "map_overlay.h"
#include "ndata.h"
#include "nlua.h"
#include "nlua_pilot.h"
#include "nlua_spob.h"
#include "nlua_vec2.h"
#include "ntracing.h"
#include "pause.h"
#include "pilot.h"
#include "pilot_ew.h"
#include "player.h"
#include "sound.h"
#include "space.h"
#include "toolkit.h"
Include dependency graph for player_autonav.c:

Go to the source code of this file.

Functions

static int player_autonavSetup (void)
 Prepares the player to enter autonav.
int player_autonavInit (void)
 Initialize the autonav code.
void player_autonavResetSpeed (void)
 Resets the game speed.
void player_autonavStart (void)
 Starts autonav.
void player_autonavEnd (void)
 Ends the autonav.
void player_autonavStartWindow (unsigned int wid, const char *str)
 Starts autonav and closes the window.
void player_autonavPos (double x, double y)
 Starts autonav with a local position destination.
void player_autonavSpob (const char *name, int tryland)
 Starts autonav with a spob destination.
void player_autonavPil (unsigned int p)
 Starts autonav with a pilot to follow.
void player_autonavBoard (unsigned int p)
 Starts autonav with a pilot to board.
void player_autonavAbort (const char *reason)
 Aborts autonav.
void player_autonavReset (double s)
 Resets the game speed without disabling autonav.
void player_thinkAutonav (Pilot *pplayer, double dt)
 Handles autonav thinking.
void player_updateAutonav (double dt)
 Updates the player's autonav.
void player_autonavEnter (void)
 Signal to the autonav that a new system was entered.

Variables

static nlua_env autonav_env = LUA_NOREF
static int func_system = LUA_NOREF
static int func_spob = LUA_NOREF
static int func_pilot = LUA_NOREF
static int func_board = LUA_NOREF
static int func_pos = LUA_NOREF
static int func_reset = LUA_NOREF
static int func_end = LUA_NOREF
static int func_abort = LUA_NOREF
static int func_think = LUA_NOREF
static int func_update = LUA_NOREF
static int func_enter = LUA_NOREF
static int autonav_ending = 0

Detailed Description

Contains all the player autonav related stuff.

Definition in file player_autonav.c.

Function Documentation

◆ player_autonavAbort()

void player_autonavAbort ( const char * reason)

Aborts autonav.

Parameters
reasonHuman-readable string describing abort condition.

Definition at line 281 of file player_autonav.c.

◆ player_autonavBoard()

void player_autonavBoard ( unsigned int p)

Starts autonav with a pilot to board.

Definition at line 254 of file player_autonav.c.

◆ player_autonavEnd()

void player_autonavEnd ( void )

Ends the autonav.

Definition at line 157 of file player_autonav.c.

◆ player_autonavEnter()

void player_autonavEnter ( void )

Signal to the autonav that a new system was entered.

Definition at line 425 of file player_autonav.c.

◆ player_autonavInit()

int player_autonavInit ( void )

Initialize the autonav code.

Definition at line 54 of file player_autonav.c.

◆ player_autonavPil()

void player_autonavPil ( unsigned int p)

Starts autonav with a pilot to follow.

Definition at line 235 of file player_autonav.c.

◆ player_autonavPos()

void player_autonavPos ( double x,
double y )

Starts autonav with a local position destination.

Definition at line 193 of file player_autonav.c.

◆ player_autonavReset()

void player_autonavReset ( double s)

Resets the game speed without disabling autonav.

Parameters
sHow many seconds to wait before starting autonav again.

Definition at line 319 of file player_autonav.c.

◆ player_autonavResetSpeed()

void player_autonavResetSpeed ( void )

Resets the game speed.

Definition at line 91 of file player_autonav.c.

◆ player_autonavSetup()

int player_autonavSetup ( void )
static

Prepares the player to enter autonav.

Returns
0 on success, -1 on failure (disabled, etc.)

Definition at line 139 of file player_autonav.c.

◆ player_autonavSpob()

void player_autonavSpob ( const char * name,
int tryland )

Starts autonav with a spob destination.

Definition at line 213 of file player_autonav.c.

◆ player_autonavStart()

void player_autonavStart ( void )

Starts autonav.

Definition at line 99 of file player_autonav.c.

◆ player_autonavStartWindow()

void player_autonavStartWindow ( unsigned int wid,
const char * str )

Starts autonav and closes the window.

Definition at line 182 of file player_autonav.c.

◆ player_thinkAutonav()

void player_thinkAutonav ( Pilot * pplayer,
double dt )

Handles autonav thinking.

Parameters
pplayerPlayer doing the thinking.
dtCurrent delta tick.

Definition at line 335 of file player_autonav.c.

◆ player_updateAutonav()

void player_updateAutonav ( double dt)

Updates the player's autonav.

Parameters
dtCurrent delta tick (should be real delta tick, not game delta tick).

Definition at line 357 of file player_autonav.c.

Variable Documentation

◆ autonav_ending

int autonav_ending = 0
static

Definition at line 153 of file player_autonav.c.

◆ autonav_env

nlua_env autonav_env = LUA_NOREF
static

Autonav environment.

Definition at line 33 of file player_autonav.c.

◆ func_abort

int func_abort = LUA_NOREF
static

Definition at line 41 of file player_autonav.c.

◆ func_board

int func_board = LUA_NOREF
static

Definition at line 37 of file player_autonav.c.

◆ func_end

int func_end = LUA_NOREF
static

Definition at line 40 of file player_autonav.c.

◆ func_enter

int func_enter = LUA_NOREF
static

Definition at line 44 of file player_autonav.c.

◆ func_pilot

int func_pilot = LUA_NOREF
static

Definition at line 36 of file player_autonav.c.

◆ func_pos

int func_pos = LUA_NOREF
static

Definition at line 38 of file player_autonav.c.

◆ func_reset

int func_reset = LUA_NOREF
static

Definition at line 39 of file player_autonav.c.

◆ func_spob

int func_spob = LUA_NOREF
static

Definition at line 35 of file player_autonav.c.

◆ func_system

int func_system = LUA_NOREF
static

Definition at line 34 of file player_autonav.c.

◆ func_think

int func_think = LUA_NOREF
static

Definition at line 42 of file player_autonav.c.

◆ func_update

int func_update = LUA_NOREF
static

Definition at line 43 of file player_autonav.c.