Skip to content

Commit

Permalink
#5938: Add explicit test to check that the material coverage is resol…
Browse files Browse the repository at this point in the history
…ving to MC_OPAQUE.
  • Loading branch information
codereader committed Apr 10, 2022
1 parent 70142f0 commit 51d1b03
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/version.h
Expand Up @@ -4,7 +4,7 @@
#include <config.h>
#define RADIANT_VERSION PACKAGE_VERSION
#else
#define RADIANT_VERSION "3.0.0pre1"
#define RADIANT_VERSION "3.0.0pre3"
#endif

#define RADIANT_APPNAME "DarkRadiant"
Expand Down
8 changes: 8 additions & 0 deletions test/Materials.cpp
Expand Up @@ -1519,4 +1519,12 @@ TEST_F(MaterialsTest, MaterialFilenamePrecedence)
<< "Description does not match what is defined in the PK4 .mtr";
}

TEST_F(MaterialsTest, CoverageOfMaterialWithBlendStage)
{
auto material = GlobalMaterialManager().getMaterial("textures/parsertest/coverage1");

EXPECT_TRUE(material) << "Could not find the material textures/parsertest/coverage1";
EXPECT_EQ(material->getCoverage(), Material::MC_OPAQUE) << "Material should be opaque";
}

}
14 changes: 14 additions & 0 deletions test/resources/tdm/materials/parsertest.mtr
Expand Up @@ -1012,3 +1012,17 @@ textures/parsertest/frobstage_missing5 // mismatching map in additive stage
rgb 0.15 * parm11
}
}

// Test determining the material coverage
textures/parsertest/coverage1
{
glass
noselfshadow
qer_editorimage textures/darkmod/window/largesquare01_softerlit_ed
diffusemap _black
{
blend add
map textures/darkmod/window/largesquare01_softerlit
rgb .5
}
}

0 comments on commit 51d1b03

Please sign in to comment.