Move r_skyname handling from R_NewMap to R_LoadSkys.

r_skyname now acts as the default sky to use when no sky name is specified
by other means ("none" is still no sky). 'loadsky foo' will load the
"foo*" sky textures, 'loadsky none' gives the default sky, and 'loadsky
""' causes uses r_skyname.
This commit is contained in:
Bill Currie 2010-12-10 12:50:38 +09:00
parent 8e557e81b6
commit c4f71c0cda
2 changed files with 3 additions and 7 deletions

View file

@ -158,7 +158,6 @@ R_Init (void)
VISIBLE void
R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
{
cvar_t *r_skyname;
int i;
texture_t *tex;
@ -198,12 +197,6 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
tex = r_notexture_mip;
tex->texturechain = NULL;
tex->texturechain_tail = &tex->texturechain;
r_skyname = Cvar_FindVar ("r_skyname");
if (r_skyname != NULL)
R_LoadSkys (r_skyname->string);
else
R_LoadSkys ("none");
}
void

View file

@ -116,6 +116,9 @@ R_LoadSkys (const char *skyname)
const char *name;
int i; // j
if (!skyname || !*skyname)
skyname = r_skyname->string;
if (strcasecmp (skyname, "none") == 0) {
skyloaded = false;
return;