[Change] Try to create the gen directory before creating nebulae in case

it fails.
This commit is contained in:
Allanis 2014-03-13 20:03:58 +00:00
parent fbb6d44d23
commit 1c1fcd8486

View File

@ -488,12 +488,15 @@ static int nebu_generate(void) {
/* Warn user of what is happening. */
loadscreen_render(0.05, "Generating Nebulae...");
/* Get resolution. */
w = SCREEN_W;
h = SCREEN_H;
/* Try to make the directory first if it fails. */
lfile_dirMakeExist("%sgen", lfile_basePath());
/* Generate all the nebulae backgrounds. */
nebu = noise_genNebulaeMap(w, h, NEBULAE_Z, 5.);
lfile_dirMakeExist("%sgen", lfile_basePath());
/* Save each nebulae as an image. */
for(i = 0; i < NEBULAE_Z; i++) {