![]() |
naev 0.12.5
|
Handles displaying backgrounds. More...
#include "background.h"#include "array.h"#include "camera.h"#include "conf.h"#include "gui.h"#include "log.h"#include "ndata.h"#include "nlua.h"#include "nlua_bkg.h"#include "nlua_camera.h"#include "nlua_colour.h"#include "nlua_gfx.h"#include "nlua_tex.h"#include "ntracing.h"#include "opengl.h"#include "pause.h"#include "player.h"#include "rng.h"
Go to the source code of this file.
Data Structures | |
| struct | background_image_t |
| Represents a background image like say a Nebula. More... | |
Macros | |
| #define | STAR_BUF 250 |
Functions | |
| static void | background_renderImages (background_image_t *bkg_arr) |
| Renders the background images. | |
| static nlua_env | background_create (const char *name) |
| Creates a background Lua state from a script. | |
| static void | background_clearCurrent (void) |
| Destroys the current running background script. | |
| static void | background_clearImgArr (background_image_t **arr) |
| Clears a background image array. | |
| static int | bkg_compare (const void *p1, const void *p2) |
| Compares two different backgrounds and sorts them. | |
| static void | bkg_sort (background_image_t *arr) |
| Sorts the backgrounds by movement. | |
| void | background_initDust (int n) |
| Initializes background dust. | |
| void | background_moveDust (double x, double y) |
| Displaces the dust, useful with camera. | |
| void | background_renderDust (const double dt) |
| Renders the dustry background. | |
| void | background_render (double dt) |
| Render the background. | |
| void | background_renderOverlay (double dt) |
| Renders the background overlay. | |
| unsigned int | background_addImage (const glTexture *image, double x, double y, double move, double scale, double angle, const glColour *col, int foreground, const glColour *radiosity) |
| Adds a new background image. | |
| int | background_init (void) |
| Initializes the background system. | |
| int | background_load (const char *name) |
| Loads a background script by name. | |
| void | background_clear (void) |
| Cleans up the background stuff. | |
| void | background_free (void) |
| Cleans up and frees memory after the backgrounds. | |
| glTexture ** | background_getStarTextures (void) |
| Returns an array (array.h) of star background images in the system background. | |
| glTexture * | background_getAmbientTexture (void) |
| Returns an overall background image (nebula, for instance), or NULL if none exists. | |
Variables | |
| static background_image_t * | bkg_image_arr_bk |
| static background_image_t * | bkg_image_arr_ft |
| static unsigned int | bkg_idgen = 0 |
| static nlua_env | bkg_cur_env = LUA_NOREF |
| Backgrounds. | |
| static nlua_env | bkg_def_env = LUA_NOREF |
| static int | bkg_L_renderbg = LUA_NOREF |
| static int | bkg_L_rendermg = LUA_NOREF |
| static int | bkg_L_renderfg = LUA_NOREF |
| static int | bkg_L_renderov = LUA_NOREF |
| static gl_vbo * | dust_vertexVBO = NULL |
| static unsigned int | ndust = 0 |
| static GLfloat | dust_x = 0. |
| static GLfloat | dust_y = 0. |
Handles displaying backgrounds.
Definition in file background.c.
| #define STAR_BUF 250 |
Area to leave around screen for dust, more = less repetition
Definition at line 74 of file background.c.
| unsigned int background_addImage | ( | const glTexture * | image, |
| double | x, | ||
| double | y, | ||
| double | move, | ||
| double | scale, | ||
| double | angle, | ||
| const glColour * | col, | ||
| int | foreground, | ||
| const glColour * | radiosity ) |
Adds a new background image.
Definition at line 328 of file background.c.
| void background_clear | ( | void | ) |
Cleans up the background stuff.
Definition at line 570 of file background.c.
|
static |
Destroys the current running background script.
Definition at line 551 of file background.c.
|
static |
Clears a background image array.
| arr | Array to clear. |
Definition at line 588 of file background.c.
|
static |
Creates a background Lua state from a script.
Definition at line 447 of file background.c.
| void background_free | ( | void | ) |
Cleans up and frees memory after the backgrounds.
Definition at line 602 of file background.c.
| glTexture * background_getAmbientTexture | ( | void | ) |
Returns an overall background image (nebula, for instance), or NULL if none exists.
Definition at line 644 of file background.c.
| glTexture ** background_getStarTextures | ( | void | ) |
Returns an array (array.h) of star background images in the system background.
Definition at line 629 of file background.c.
| int background_init | ( | void | ) |
Initializes the background system.
Definition at line 492 of file background.c.
| void background_initDust | ( | int | n | ) |
Initializes background dust.
| n | Number of dust to add (dust per 800x640 screen). |
Definition at line 97 of file background.c.
| int background_load | ( | const char * | name | ) |
Loads a background script by name.
Definition at line 502 of file background.c.
| void background_moveDust | ( | double | x, |
| double | y ) |
Displaces the dust, useful with camera.
Definition at line 145 of file background.c.
| void background_render | ( | double | dt | ) |
Render the background.
| dt | Real delta ticks elapsed. |
Definition at line 245 of file background.c.
| void background_renderDust | ( | const double | dt | ) |
Renders the dustry background.
| dt | Current delta tick. |
Definition at line 156 of file background.c.
|
static |
Renders the background images.
Definition at line 392 of file background.c.
| void background_renderOverlay | ( | double | dt | ) |
Renders the background overlay.
Definition at line 290 of file background.c.
|
static |
Compares two different backgrounds and sorts them.
Definition at line 310 of file background.c.
|
static |
Sorts the backgrounds by movement.
Definition at line 320 of file background.c.
|
static |
|
static |
Default Lua state.
Definition at line 65 of file background.c.
|
static |
ID generator for backgrounds.
Definition at line 59 of file background.c.
|
static |
Background image array to display (behind dust). Assumed to be a debris layer.
Definition at line 52 of file background.c.
|
static |
Background image array to display (in front of dust). Assumed to be a star layer.
Definition at line 55 of file background.c.
|
static |
Background rendering function.
Definition at line 66 of file background.c.
|
static |
Foreground rendering function.
Definition at line 68 of file background.c.
|
static |
Middleground rendering function.
Definition at line 67 of file background.c.
|
static |
Overlay rendering function.
Definition at line 69 of file background.c.
|
static |
Star Vertex VBO.
Definition at line 76 of file background.c.
|
static |
Star X movement.
Definition at line 78 of file background.c.
|
static |
Star Y movement.
Definition at line 79 of file background.c.
|
static |
Total dust.
Definition at line 77 of file background.c.