[Add] Implemented loading bar for nebulae.
This commit is contained in:
parent
378f924366
commit
8573aa30ba
@ -84,7 +84,7 @@ char* namjoystick = NULL; /**< Name of joystick to use, NULL is none.
|
||||
/* Loading. */
|
||||
static void print_SDLversion(void);
|
||||
static void loadscreen_load(void);
|
||||
static void loadscreen_render(double done, const char* msg);
|
||||
void loadscreen_render(double done, const char* msg); /* nebulae.c */
|
||||
static void loadscreen_unload(void);
|
||||
static void load_all(void);
|
||||
static void unload_all(void);
|
||||
@ -306,13 +306,13 @@ void loadscreen_load(void) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn static void loadscreen_render(double done, const char* msg)
|
||||
* @fn void loadscreen_render(double done, const char* msg)
|
||||
*
|
||||
* @brief Render the load screen with message.
|
||||
* @param done Amount done (1. == completed).
|
||||
* @param msg Loading screen message.
|
||||
*/
|
||||
static void loadscreen_render(double done, const char* msg) {
|
||||
void loadscreen_render(double done, const char* msg) {
|
||||
double x, y, w, h, rh;
|
||||
|
||||
/* Clear background. */
|
||||
|
@ -28,6 +28,7 @@
|
||||
/* Extern. */
|
||||
extern double gui_xoff, gui_yoff;
|
||||
extern Vec2 shake_pos;
|
||||
extern void loadscreen_render(double done, const char* msg);
|
||||
|
||||
/* The nebulae textures. */
|
||||
static GLuint nebu_textures[NEBULAE_Z]; /**< BG Nebulae textures. */
|
||||
@ -83,8 +84,9 @@ int nebu_init(void) {
|
||||
int ret;
|
||||
|
||||
/* Special code to regenerate the nebulae. */
|
||||
if((nebu_w == -9) && (nebu_h == -9))
|
||||
if((nebu_w == -9) && (nebu_h == -9)) {
|
||||
nebu_generate();
|
||||
}
|
||||
|
||||
/* Set expected sizes. */
|
||||
nebu_w = SCREEN_W;
|
||||
@ -483,6 +485,9 @@ static int nebu_generate(void) {
|
||||
int w, h;
|
||||
int ret;
|
||||
|
||||
/* Warn user of what is happening. */
|
||||
loadscreen_render(0.05, "Generating Nebulae...");
|
||||
|
||||
w = SCREEN_W;
|
||||
h = SCREEN_H;
|
||||
|
||||
@ -513,6 +518,9 @@ static void nebu_generatePuffs(void) {
|
||||
SDL_Surface* sur;
|
||||
float* nebu;
|
||||
|
||||
/* Warn user of what is happening. */
|
||||
loadscreen_render(0.05, "Generating Nebulae Puffs.");
|
||||
|
||||
/* Generate the nebulae puffs. */
|
||||
for(i = 0; i < NEBULAE_PUFFS; i++) {
|
||||
/* Generate the nebulae. */
|
||||
|
Loading…
Reference in New Issue
Block a user