Controls the overall game flow: data loading/unloading and game loop.
More...
#include "ai.h"
#include "background.h"
#include "camera.h"
#include "cond.h"
#include "conf.h"
#include "console.h"
#include "damagetype.h"
#include "debug.h"
#include "dialogue.h"
#include "difficulty.h"
#include "economy.h"
#include "env.h"
#include "event.h"
#include "faction.h"
#include "font.h"
#include "gui.h"
#include "hook.h"
#include "input.h"
#include "joystick.h"
#include "land.h"
#include "load.h"
#include "log.h"
#include "map.h"
#include "map_overlay.h"
#include "map_system.h"
#include "menu.h"
#include "mission.h"
#include "music.h"
#include "ndata.h"
#include "nebula.h"
#include "news.h"
#include "nfile.h"
#include "nlua_colour.h"
#include "nlua_data.h"
#include "nlua_file.h"
#include "nlua_gfx.h"
#include "nlua_naev.h"
#include "nlua_rnd.h"
#include "nlua_tex.h"
#include "nlua_var.h"
#include "nlua_vec2.h"
#include "npc.h"
#include "ntracing.h"
#include "opengl.h"
#include "options.h"
#include "outfit.h"
#include "pause.h"
#include "pilot.h"
#include "player.h"
#include "player_autonav.h"
#include "plugin.h"
#include "render.h"
#include "rng.h"
#include "safelanes.h"
#include "semver.h"
#include "ship.h"
#include "slots.h"
#include "sound.h"
#include "space.h"
#include "spfx.h"
#include "start.h"
#include "tech.h"
#include "threadpool.h"
#include "toolkit.h"
#include "unidiff.h"
#include "weapon.h"
Go to the source code of this file.
Controls the overall game flow: data loading/unloading and game loop.
Definition in file naev.c.
◆ LOADING_STAGES
| #define LOADING_STAGES 17. |
Loads all the data, makes main() simpler.
Amount of loading stages.
Definition at line 680 of file naev.c.
◆ VERSION_FILE
| #define VERSION_FILE "VERSION" |
Version file by default.
Definition at line 96 of file naev.c.
◆ binary_comparison()
| int binary_comparison |
( |
int | x, |
|
|
int | y ) |
|
static |
◆ fps_current()
| double fps_current |
( |
void | | ) |
|
Gets the current FPS.
- Returns
- Current FPS as displayed to the player.
Definition at line 995 of file naev.c.
◆ fps_display()
| void fps_display |
( |
double | dt | ) |
|
Displays FPS on the screen.
- Parameters
-
| [in] | dt | Current delta tick. |
Definition at line 955 of file naev.c.
◆ fps_init()
Initializes the fps engine.
Definition at line 936 of file naev.c.
◆ fps_setPos()
| void fps_setPos |
( |
double | x, |
|
|
double | y ) |
Sets the position to display the FPS.
Definition at line 944 of file naev.c.
◆ load_all()
◆ loadscreen_load()
| void loadscreen_load |
( |
void | | ) |
|
|
static |
Loads a loading screen.
Definition at line 560 of file naev.c.
◆ loadscreen_unload()
| void loadscreen_unload |
( |
void | | ) |
|
|
static |
Frees the loading screen.
Definition at line 671 of file naev.c.
◆ loadscreen_update()
| void loadscreen_update |
( |
double | done, |
|
|
const char * | msg ) |
|
static |
Renders the load screen with message.
- Parameters
-
| done | Amount done (1. == completed). |
| msg | Loading screen message. |
Definition at line 652 of file naev.c.
◆ main_loop()
| void main_loop |
( |
int | nested | ) |
|
Split main loop from main() for secondary loop hack in toolkit.c.
Definition at line 795 of file naev.c.
◆ naev_doRenderLoadscreen()
| void naev_doRenderLoadscreen |
( |
void | | ) |
|
◆ naev_getrealdt()
| double naev_getrealdt |
( |
void | | ) |
|
Gets the last delta-tick.
Definition at line 1230 of file naev.c.
◆ naev_isQuit()
Get if Naev is trying to quit.
Definition at line 153 of file naev.c.
◆ naev_quit()
Flags naev to quit.
Definition at line 145 of file naev.c.
◆ naev_renderLoadscreen()
| void naev_renderLoadscreen |
( |
void | | ) |
|
Renders the loadscreen if necessary.
Definition at line 640 of file naev.c.
◆ naev_resize()
| void naev_resize |
( |
void | | ) |
|
Wrapper for gl_resize that handles non-GL reinitialization.
Definition at line 874 of file naev.c.
◆ naev_shouldRenderLoadscreen()
| int naev_shouldRenderLoadscreen |
( |
void | | ) |
|
Whether or not we want to render the loadscreen.
Definition at line 596 of file naev.c.
◆ naev_toggleFullscreen()
| void naev_toggleFullscreen |
( |
void | | ) |
|
◆ 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 1151 of file naev.c.
◆ naev_versionCompareTarget()
| int naev_versionCompareTarget |
( |
const char * | version, |
|
|
const char * | target ) |
Does a comparison with a specific target.
Definition at line 1175 of file naev.c.
◆ print_SDLversion()
| void print_SDLversion |
( |
void | | ) |
|
|
static |
Prints the SDL version to console.
Definition at line 1198 of file naev.c.
◆ unload_all()
Unloads all data, simplifies main().
Definition at line 762 of file naev.c.
◆ update_all()
| void update_all |
( |
int | dohooks | ) |
|
|
static |
Updates the game itself (player flying around and friends).
Mainly uses game dt.
Definition at line 1005 of file naev.c.
◆ update_routine()
| void update_routine |
( |
double | dt, |
|
|
int | dohooks ) |
Actually runs the updates.
- Parameters
-
| [in] | dt | Current delta tick. |
| [in] | dohooks | Whether or not we want to do hooks, such as the initial update upon entering a system. |
Definition at line 1056 of file naev.c.
◆ window_caption()
| void window_caption |
( |
void | | ) |
|
|
static |
Sets the window caption.
Definition at line 1114 of file naev.c.
◆ elapsed_time_mod
| double elapsed_time_mod = 0. |
Elapsed modified time.
Definition at line 117 of file naev.c.
◆ fps
FPS to finally display.
Definition at line 112 of file naev.c.
◆ fps_cur
FPS accumulator to trigger change.
Definition at line 113 of file naev.c.
◆ fps_dt
Display fps accumulator.
Definition at line 109 of file naev.c.
◆ fps_min
| const double fps_min = 1. / 10. |
New collisions allow larger fps_min.
Definition at line 116 of file naev.c.
◆ fps_skipped
Skipped last frame?
Definition at line 102 of file naev.c.
◆ fps_x
FPS X position.
Definition at line 114 of file naev.c.
◆ fps_y
FPS Y position.
Definition at line 115 of file naev.c.
◆ game_dt
Current game deltatick (uses dt_mod).
Definition at line 110 of file naev.c.
◆ last_t
used to calculate FPS and movement.
Definition at line 100 of file naev.c.
◆ load_env
Initial value:Environment for displaying load messages and stuff.
Definition at line 119 of file naev.c.
◆ load_force_render
| int load_force_render = 0 |
|
static |
◆ load_last_render
| unsigned int load_last_render = 0 |
|
static |
◆ load_mutex
◆ naev_icon
| SDL_Surface* naev_icon = NULL |
|
static |
◆ quit
For primary loop
Definition at line 98 of file naev.c.
◆ real_dt
Real deltatick.
Definition at line 111 of file naev.c.
◆ SDL_LOOPDONE
For custom event to exit loops.
Definition at line 99 of file naev.c.
◆ version_binary
Naev binary version.
Definition at line 104 of file naev.c.