Skip to content

Commit

Permalink
Definitions: Do not derive textures from definitions missing a materi…
Browse files Browse the repository at this point in the history
…al URI

If Detail/Light/Reflection definitions fail to specify the material
they are intended for, there is no point in attempting to define the
textures.
  • Loading branch information
danij-deng committed Dec 15, 2012
1 parent f26c09c commit c71eefe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doomsday/engine/src/def_main.cpp
Expand Up @@ -1495,7 +1495,13 @@ void Def_PostInit(void)
for(int i = 0; i < defs.count.details.num; ++i)
{
ded_detailtexture_t *dtl = &defs.details[i];

// Ignore definitions which do not specify a material.
if((!dtl->material1 || Uri_IsEmpty(dtl->material1)) &&
(!dtl->material2 || Uri_IsEmpty(dtl->material2))) continue;

if(!dtl->detailTex) continue;

R_DefineTexture("Details", reinterpret_cast<de::Uri &>(*dtl->detailTex));
}

Expand Down Expand Up @@ -1528,6 +1534,9 @@ void Def_PostInit(void)
{
ded_decor_t* decor = &defs.decorations[i];

// Ignore definitions which do not specify a material.
if(!decor->material || Uri_IsEmpty(decor->material)) continue;

for(int k = 0; k < DED_DECOR_NUM_LIGHTS; ++k)
{
ded_decorlight_t* lig = &decor->lights[k];
Expand Down Expand Up @@ -1560,6 +1569,9 @@ void Def_PostInit(void)
{
ded_reflection_t* ref = &defs.reflections[i];

// Ignore definitions which do not specify a material.
if(!ref->material || Uri_IsEmpty(ref->material)) continue;

if(ref->shinyMap)
{
R_DefineTexture("Reflections", reinterpret_cast<de::Uri &>(*ref->shinyMap));
Expand Down

0 comments on commit c71eefe

Please sign in to comment.