Header file with generic functions and naev-specifics.
More...
#include "ncompat.h"
Go to the source code of this file.
|
| #define | APPNAME "Naev" |
| |
| #define | ABS(x) (((x)<0)?-(x):(x)) |
| |
| #define | FABS(x) (((x)<0.)?-(x):(x)) |
| |
| #define | MAX(x, y) (((x)>(y))?(x):(y)) |
| |
| #define | MIN(x, y) (((x)>(y))?(y):(x)) |
| |
| #define | CLAMP(a, b, x) ((x)<(a)?(a):((x)>(b)?(b):(x))) |
| |
| #define | SIGN(x) (((x)>0)?1:-1) |
| |
| #define | FSIGN(x) (((x)>0.)?1.:-1.) |
| |
| #define | pow2(x) ((x)*(x)) |
| |
| #define | PATH_MAX 256 |
| |
| #define | STRMAX 4096 |
| |
| #define | STRMAX_SHORT 1024 |
| |
| #define | M_PI 3.14159265358979323846 |
| |
| #define | M_SQRT1_2 0.70710678118654752440 |
| |
| #define | M_SQRT2 1.41421356237309504880 |
| |
Header file with generic functions and naev-specifics.
Definition in file naev.h.
◆ ABS
| #define ABS |
( |
|
x | ) |
(((x)<0)?-(x):(x)) |
Returns absolute value.
Definition at line 36 of file naev.h.
◆ APPNAME
Application name.
Definition at line 34 of file naev.h.
◆ CLAMP
| #define CLAMP |
( |
|
a, |
|
|
|
b, |
|
|
|
x |
|
) |
| ((x)<(a)?(a):((x)>(b)?(b):(x))) |
Clamps x between a and b: a <= x <= b.
Definition at line 41 of file naev.h.
◆ FABS
| #define FABS |
( |
|
x | ) |
(((x)<0.)?-(x):(x)) |
Returns float absolute value.
Definition at line 37 of file naev.h.
◆ FSIGN
| #define FSIGN |
( |
|
x | ) |
(((x)>0.)?1.:-1.) |
Returns the sign of a value.
Definition at line 44 of file naev.h.
◆ M_PI
| #define M_PI 3.14159265358979323846 |
◆ M_SQRT1_2
| #define M_SQRT1_2 0.70710678118654752440 |
◆ M_SQRT2
| #define M_SQRT2 1.41421356237309504880 |
◆ MAX
| #define MAX |
( |
|
x, |
|
|
|
y |
|
) |
| (((x)>(y))?(x):(y)) |
Returns maximum.
Definition at line 39 of file naev.h.
◆ MIN
| #define MIN |
( |
|
x, |
|
|
|
y |
|
) |
| (((x)>(y))?(y):(x)) |
Returns minimum.
Definition at line 40 of file naev.h.
◆ PATH_MAX
If not already defined.
Definition at line 50 of file naev.h.
◆ pow2
| #define pow2 |
( |
|
x | ) |
((x)*(x)) |
^2
Definition at line 46 of file naev.h.
◆ SIGN
| #define SIGN |
( |
|
x | ) |
(((x)>0)?1:-1) |
Returns the sign of a value.
Definition at line 43 of file naev.h.
◆ STRMAX
◆ STRMAX_SHORT
| #define STRMAX_SHORT 1024 |
◆ display_fps()
| void display_fps |
( |
const double |
dt | ) |
|
Displays FPS on the screen.
- Parameters
-
| [in] | dt | Current delta tick. |
Definition at line 915 of file naev.c.
◆ fps_setPos()
| void fps_setPos |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Sets the position to display the FPS.
Definition at line 904 of file naev.c.
◆ naev_getrealdt()
| double naev_getrealdt |
( |
void |
| ) |
|
Gets the last delta-tick.
Definition at line 1122 of file naev.c.
◆ naev_isQuit()
Get if Naev is trying to quit.
Definition at line 155 of file naev.c.
◆ naev_quit()
Flags naev to quit.
Definition at line 147 of file naev.c.
◆ naev_renderLoadscreen()
| void naev_renderLoadscreen |
( |
void |
| ) |
|
Renders the loadscreen if necessary.
Definition at line 549 of file naev.c.
◆ naev_resize()
| void naev_resize |
( |
void |
| ) |
|
Wrapper for gl_resize that handles non-GL reinitialization.
Definition at line 765 of file naev.c.
◆ naev_toggleFullscreen()
| void naev_toggleFullscreen |
( |
void |
| ) |
|
◆ naev_version()
| const char * naev_version |
( |
int |
long_version | ) |
|
Returns the version in a human readable string.
- Parameters
-
| long_version | Returns the long version if it's long. |
- Returns
- The human readable version string.
Definition at line 25 of file naev_version.c.
◆ naev_versionCompare()
| int naev_versionCompare |
( |
const char * |
version | ) |
|
Compares the version against the current naev version.
- Returns
- positive if version is newer or negative if version is older.
Definition at line 1071 of file naev.c.
◆ update_routine()
| void update_routine |
( |
double |
dt, |
|
|
int |
enter_sys |
|
) |
| |
Actually runs the updates.
- Parameters
-
| [in] | dt | Current delta tick. |
| [in] | enter_sys | Whether this is the initial update upon entering the system. |
Definition at line 998 of file naev.c.
◆ elapsed_time_mod
Elapsed modified time.
Definition at line 119 of file naev.c.
◆ fps_min
Minimum fps to run at.
Definition at line 118 of file naev.c.
◆ SDL_LOOPDONE
For custom event to exit loops.
Definition at line 101 of file naev.c.