Skip to content

Commit

Permalink
Fixed|Model Renderer: Rendering passes were indexed incorrectly
Browse files Browse the repository at this point in the history
When enabling and disabling rendering passes, the incorrect ones
were being accessed, due to the setup not processing the passes in
source line order (it was done alphabetically instead).
  • Loading branch information
skyjake committed Oct 27, 2015
1 parent 462f729 commit ee3d427
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions doomsday/apps/client/src/render/stateanimator.cpp
Expand Up @@ -259,7 +259,7 @@ DENG2_PIMPL(StateAnimator)
for(int i = 0; i < passCount; ++i) appearance.passMaterial << 0;
}
appearance.passMask.resize(passCount);

// The main material variable should always exist. The "render" definition
// may override this default value.
names.addText(VAR_MATERIAL, "default");
Expand All @@ -279,16 +279,18 @@ DENG2_PIMPL(StateAnimator)
// Each rendering pass is represented by a subrecord, named
// according the to the pass names.
auto passes = ScriptedInfo::subrecordsOfType(DEF_PASS, renderBlock);
DENG2_FOR_EACH_CONST(Record::Subrecords, i, passes)
for(String passName : ScriptedInfo::sortRecordsBySource(passes))
{
indexForPassName[i.key()] = passIndex++;
Record const &passDef = *passes[passName];

indexForPassName[passName] = passIndex++;

Record &passRec = names.addRecord(i.key());
Record &passRec = names.addRecord(passName);
passRec.addBoolean(VAR_ENABLED,
ScriptedInfo::isTrue(*i.value(), DEF_ENABLED, true))
ScriptedInfo::isTrue(passDef, DEF_ENABLED, true))
.audienceForChange() += this;

initVariablesForPass(*i.value(), i.key());
initVariablesForPass(passDef, passName);
}
}

Expand Down

0 comments on commit ee3d427

Please sign in to comment.