From 86b2ef3fe14d3e2de617e59ac74b294641cdbd62 Mon Sep 17 00:00:00 2001 From: Allanis Date: Mon, 15 Jul 2013 12:24:51 +0100 Subject: [PATCH] [Add] Initialize nebulae and use it in menu. --- src/lephisto.c | 4 +--- src/menu.c | 11 ++++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/lephisto.c b/src/lephisto.c index 4be0aac..6606563 100644 --- a/src/lephisto.c +++ b/src/lephisto.c @@ -139,9 +139,6 @@ int main(int argc, char** argv) { } window_caption(); - /* Time to try to load the nebulae. */ - nebu_init(); - /* OpenAL sound. */ if(nosound) LOG("Sound is disabled!"); @@ -175,6 +172,7 @@ int main(int argc, char** argv) { WARN("Error initializing AI"); /* Misc openGL init stuff. */ + nebu_init(); /* Init the nebulae. */ gl_fontInit(NULL, NULL, FONT_SIZE); /* Init default font size. */ gl_fontInit(&gl_smallFont, NULL, FONT_SIZE_SMALL); /* Small font. */ gui_init(); /* Init the GUI crap. */ diff --git a/src/menu.c b/src/menu.c index 1206792..6f4a386 100644 --- a/src/menu.c +++ b/src/menu.c @@ -7,12 +7,12 @@ #include "pilot.h" #include "space.h" #include "player.h" -#include "perlin.h" #include "mission.h" #include "ltime.h" #include "save.h" #include "land.h" #include "rng.h" +#include "nebulae.h" #include "menu.h" #define MAIN_WIDTH 130 @@ -66,15 +66,12 @@ static void menu_generic_close(char* str); void menu_main(void) { unsigned int bwid, wid; - glTexture* tex; - - tex = noise_genCloud(SCREEN_W, SCREEN_H, 5.); /* Create background image window. */ bwid = window_create("BG", -1, -1, SCREEN_W, SCREEN_H); - window_addRect(bwid, 0, 0, SCREEN_W, SCREEN_H, "rctBG", &cBlack, 0); - window_addImage(bwid, 0, 0, "imgBG", tex, 0); - window_imgColour(bwid, "imgBG", &cPurple); + /*window_addRect(bwid, 0, 0, SCREEN_W, SCREEN_H, "rctBG", &cBlack, 0);*/ + window_addCust(bwid, 0, 0, SCREEN_W, SCREEN_H, "cstBG", 0, + (void(*)(double, double, double, double))nebu_render, NULL); /* Create menu window. */ wid = window_create("Main Menu", -1, -1, MAIN_WIDTH, MAIN_HEIGHT);